OpenVPN / openvpn

OpenVPN is an open source VPN daemon
http://openvpn.net
Other
10.75k stars 2.99k forks source link

Information available to hook scripts is too limited #481

Open akorn opened 9 months ago

akorn commented 9 months ago

In particular, the tls-crypt-v2-verify hook script doesn't even get envvars configured via setenv or setenv-safe, or $config, passed in; only $metadata_file, $metadata_type and $script_type are set.

(In less recent experiments, the iproute script didn't have $script_type, and the ipchange hook didn't have $dev.)

Expected behaviour

Hook scripts should have all the information available to openvpn at the time of their calling passed in in the documented envvars.

Version information (please complete the following information):

Additional context

My particular use case is that I tried to follow the openvpn-nl deployment guide which recommends the following:

(The idea is to reduce the attack surface by performing these checks before exposing the TLS stack to an attacker.)

To implement these checks I'd have to either

I checked with the folks in #openvpn-devel and the consensus was that the current behaviour is intentional and is, IMO ironically, meant to "reduce the attack surface".

I don't agree that withholding available information that's not controlled by the client (who is a potential attacker) from hook scripts is a good way of reducing the attack surface. As explained above, the actual result is that it makes the hook scripts more expensive to maintain and/or unnecessarily complex.

Please reconsider the decision to deliberately withhold information from hook scripts.