Welches Risiko besteht bei OpenVPN, wenn bei Verwendung von TLS-Auth die Schlüsselrichtung weggelassen wird?

Welches Risiko besteht bei OpenVPN, wenn bei Verwendung von TLS-Auth die Schlüsselrichtung weggelassen wird?

In meiner TLS-fähigen OpenVPN-Konfiguration möchte ich die zusätzliche Sicherheit nutzen, die durch die Verwendung von geboten wird tls-auth. Die gute Nachricht ist, dass es wie erwartet funktioniert. Ich habe jedoch eine Frage zum optionalen key-directionParameter (entweder als zweiter Parameter zur tls-authOption oder als key-directionOption).

Der Konfigurationsparameter wird in der Manpage wie folgt beschrieben (Version 2.3.x, relevante Snippets):

--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).

Beachten Sie, dass ich nicht den statischen Schlüsselverschlüsselungsmodus verwende, sondern nur den --secretManpage-Ausschnitt anzeige, weil dies in der --tls-authBeschreibung vorgeschlagen wird.

Ich verstehe die Erklärungen hier nicht. Verbessert sich die Sicherheit, wenn man eine Richtung angibt (0 für Server, 1 für Client) oder nicht, wenn man sie weglässt?

Antwort1

(Diese Antwort bezieht sich speziell auf die Verwendung der Schlüsselrichtung für TLS-Authentifizierungsschlüssel. Für den statischen Schlüsselmodus verwenden Sie bittestetsverwenden Sie die Tastenrichtung.)

Der Vorteil der Verwendung unterschiedlicher Schlüssel für jede Richtung besteht darin, dass Pakete, die von einem Peer stammen, von einem Man-in-the-Middle-Angreifer niemals an diesen Peer zurückgesendet werden können. Natürlich sind die zugrunde liegenden TLS- und OpenVPN-ProtokollesollenAkzeptieren Sie solche Pakete niemals, aber das Ziel von TLS-Auth besteht darin, (einen gewissen) Schutz vor Fehlern im Protokoll oder der Implementierung zu bieten, die zum Versagen der zugrunde liegenden Mechanismen führen.

verwandte Informationen