OpenVPN では、tls-auth を使用するときにキー方向を省略するとどのようなリスクがありますか?

OpenVPN では、tls-auth を使用するときにキー方向を省略するとどのようなリスクがありますか?

TLS 対応の OpenVPN 構成で、 を使用することで提供される追加のセキュリティを使用したいと思います。 幸いなことに、 は期待どおりに動作します。 ただし、オプションパラメータ (オプションの 2 番目のパラメータとして、またはオプションとして)tls-authについて質問があります。key-directiontls-authkey-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説明で提案されているため、man ページのスニペットのみを表示していることに注意してください--tls-auth

ここでの説明が理解できません。方向 (サーバーの場合は 0、クライアントの場合は 1) を指定するとセキュリティは向上しますか、それとも省略すると向上しませんか?

答え1

(この回答は、tls-authキーのキー方向の使用に特化しています。静的キーモードの場合は、いつもキー方向を使用します。

各方向に異なるキーを使用する利点は、あるピアから発信されたパケットが中間者攻撃者によってそのピアに返送されることがないことです。もちろん、基礎となるTLSおよびOpenVPNプロトコルはすべきこのようなパケットは決して受け入れませんが、tls-auth の目的は、基盤となるメカニズムの失敗を引き起こすプロトコルまたは実装のバグに対して (ある程度の) 保護を提供することです。

関連情報