OpenVPN에서 tls-auth를 사용할 때 키 방향을 생략하면 어떤 위험이 있나요?

OpenVPN에서 tls-auth를 사용할 때 키 방향을 생략하면 어떤 위험이 있나요?

TLS가 활성화된 OpenVPN 구성에서 를 사용하여 제공되는 추가 보안을 사용하고 싶습니다 tls-auth. 좋은 소식은 예상대로 작동한다는 것입니다. 그런데 선택적 key-direction매개변수(옵션의 두 번째 매개변수 tls-auth또는 key-direction옵션) 에 대해 질문이 있습니다 .

구성 매개변수는 맨페이지에 다음과 같이 설명되어 있습니다(버전 2.3.x, 관련 조각).

--tls-auth file [direction]
      Add  an  additional layer of HMAC authentication on top of the TLS control
      channel to protect against DoS attacks.

      In a nutshell, --tls-auth enables a kind of "HMAC firewall"  on  OpenVPN's
      TCP/UDP  port, where TLS control channel packets bearing an incorrect HMAC
      signature can be dropped immediately without response.

      file (required) is a key file which can be in one of two formats:

      (1) An OpenVPN static key file generated by --genkey (required  if  direc‐
      tion parameter is used).

      (2) A freeform passphrase file.  In this case the HMAC key will be derived
      by taking a secure  hash  of  this  file,  similar  to  the  md5sum(1)  or
      sha1sum(1) commands.

      OpenVPN  will  first  try  format (1), and if the file fails to parse as a
      static key file, format (2) will be used.

      See the --secret option for more information  on  the  optional  direction
      parameter.

      ... (snip)

--secret file [direction]
      Enable Static Key encryption mode (non-TLS).  Use pre-shared  secret  file
      which was generated with --genkey.

      The optional direction parameter enables the use of 4 distinct keys (HMAC-
      send, cipher-encrypt, HMAC-receive, cipher-decrypt),  so  that  each  data
      flow  direction  has  a different set of HMAC and cipher keys.  This has a
      number of desirable  security  properties  including  eliminating  certain
      kinds of DoS and message replay attacks.

      When  the direction parameter is omitted, 2 keys are used bidirectionally,
      one for HMAC and the other for encryption/decryption.

      The direction parameter should always be complementary on either  side  of
      the connection, i.e. one side should use "0" and the other should use "1",
      or both sides should omit it altogether.

      The direction parameter requires that file contains a 2048 bit key.  While
      pre-1.5  versions  of  OpenVPN generate 1024 bit key files, any version of
      OpenVPN which supports the direction parameter, will also support 2048 bit
      key file generation using the --genkey option.

      ... (snip)

--key-direction
      Alternative way of specifying the optional  direction  parameter  for  the
      --tls-auth  and --secret options. Useful when using inline files (See sec‐
      tion on inline files).

저는 정적 키 암호화 모드를 사용하지 않고 설명 --secret에서 제안하는 맨페이지 조각 만 표시한다는 점에 유의하세요 --tls-auth.

여기 설명을 이해하지 못했습니다. 방향(서버는 0, 클라이언트는 1)을 지정하면 보안이 향상되나요, 아니면 생략하면 안되나요?

답변1

(이 답변은 tls-auth 키에 대한 키 방향 사용에만 해당됩니다. 정적 키 모드의 경우언제나키 방향을 사용합니다.)

각 방향에 대해 서로 다른 키를 사용하면 한 피어에서 시작된 패킷이 중간자 공격자에 의해 해당 피어로 다시 재생될 수 없다는 이점이 있습니다. 물론 기본 TLS 및 OpenVPN 프로토콜~해야 한다이러한 패킷은 절대 허용하지 않지만 tls-auth의 목표는 기본 메커니즘이 실패하도록 하는 프로토콜 또는 구현의 버그로부터 (일부) 보호를 제공하는 것입니다.

관련 정보