별표 보안 비밀번호

별표 보안 비밀번호

나는 별표를 실행하고 있습니다라즈베리 파이 3; 그러므로 나는 비밀번호를 보호하고 싶다. 누군가 SD 카드를 제거하면 비밀번호가 일반 텍스트로 표시됩니다! 전체 OS를 암호화할 수 있다는 것을 알고 있지만 파일 하나만 보호하면 되므로 그렇게 하지 않는 것이 좋을 것입니다.

있다내가 보호하고 싶은 키/비밀번호 유형. 지금까지 나는 트리에서 2개의 비밀번호를 보호했습니다.

어쨌든 여기 내 오래된 sip.conf보호되지 않은 것이 있습니다.

[general]

  keepalive=30
  bindport=5060
  ... etc

  ; Allow tls !    
  tlsenable=yes
  tlsbindaddr=0.0.0.0
  tlscertfile=/keys/asterisk.pem     ; <---- 1st key unprotected
  tlscafile=/keys/ca.crt
  tlscipher=ALL
  tlsclientmethod=tlsv1


; Peers info ---------------------------------------------
[user1]
  secret=somePassword       ; < -------- 2nd key unprotected
  type=peer
  ... etc

[user2]
  ... etc..   ; more  unprotected keys
; ----------------------------------------------------------

; elastic sip trunks used to make outbound calls -----------
[Trunk-Provider-1] ; 
  type=peer
  host=someProvider.com
  secret=plainTextPassword    ; <------------ 3rd password unprotected
  username=foo      
; ---------------------------------------------------------

그리고 여기 나의 새로운 sip.conf"보호"가 있습니다:

[general]

  keepalive=30
  bindport=5060
  ... etc

  ; Allow tls !       
  tlsenable=yes
  tlsbindaddr=0.0.0.0                      
  tlscertfile=/dev/shm/keys/asterisk.pem   ; <---- 1st key located on memory (/dev/shm/)
  tlscafile=/dev/shm/keys/ca.crt           ; same thing. File is on memory and NOT on disk. 
  tlscipher=ALL
  tlsclientmethod=tlsv1


; Peers info ---------------------------------------------
[user1]      
  md5secret=4a8e71480c5b1ef0a5d502a8eb98576  ; < -------- 2nd key hashed (protected)
  type=peer
  ... etc

[user2]
  ... etc..   ; more hashed keys
; ----------------------------------------------------------

; elastic sip trunks used to make outbound calls -----------
[Trunk-Provider-1] ; 
  type=peer
  host=omeProvider.com
  secret=password-Of-Provider  ; <------------ 3rd password I do not know how to protect this :/ ?
  username=foo
; ---------------------------------------------------------

그래서 3가지 유형의 키/비밀번호를 보호해야 합니다.

  1. 인증서 키 통화를 암호화하는 데 사용되는 인증서입니다. 나는 컴퓨터가 부팅될 때 다운로드하여 메모리에 저장함으로써 이를 보호합니다( /dev/shm/). 컴퓨터가 꺼지면 파일이 손실됩니다.

  2. IP 전화 비밀번호(피어) 휴대폰(피어)이 사용하는 비밀번호입니다. 그것들을 보호하기 위해 나는 그것들을 해시합니다. 이 문서에서는 그 방법을 설명합니다.https://www.voip-info.org/wiki/view/Asterisk+sip+md5secret

  3. 제공업체의 비밀번호(아웃바운드 전화를 거는 데 사용됨) 이 비밀번호를 보호하는 방법을 모르겠습니다. sip.conf 파일의 위치를 ​​메모리로 옮겨볼까도 생각했지만 쉽지 않습니다. 내가 믿는 모든 구성 파일을 이동해야 합니다.

답변1

내 질문에 답하기:

심볼릭 링크를 생성하여 /etc/asterisk/sip.conf 파일을 이동했습니다. https://stackoverflow.com/a/1951752/637142

# 1. Delete /etc/asterisk/sip.conf we do not want that file on disk. It contains passwords!
rm /etc/asterisk/sip.conf

# 2. create sip.conf on memory (/dev/shm/sip.conf)
touch /dev/shm/sip.conf
... add configuration and passwords... to that file

# 3. Trick asterisk by placing a symbolic link. 
# Point file /etc/asterisk/sip.conf ---> /dev/shm/sip.conf
ln -s /dev/shm/sip.conf /etc/asterisk/sip.conf

아니요, /etc/asterisk/sip.conf에 액세스하면 실제로는 /dev/shm/sip.conf에 액세스하게 됩니다!

관련 정보