Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fall-through vs fast-fail plugin execution #587

Open
mc1arke opened this issue Aug 10, 2024 · 0 comments
Open

Fall-through vs fast-fail plugin execution #587

mc1arke opened this issue Aug 10, 2024 · 0 comments

Comments

@mc1arke
Copy link

mc1arke commented Aug 10, 2024

When executing plugins, OpenVPN currently iterates over all plugins and invokes each configured plugin, regardless of the result of the previous plugin execution. This could be potentially useful if there was an indicator of current state being passed onto subsequent plugin executions, but there's nothing visible in plugin calls as to what has already been run and what the outcome of any previous call has been, so it's not clear on why there's isn't a fast-fail with an abort of the loop when error == true.

Using the following plugin configuration as a multi-plugin use-case, with LDAP authentication being performed on user connect, then a subsequent multi-factor authentication challenge using Duo, if the LDAP authentication was to fail for an incorrect password but valid username, the Duo plugin would still be invoked and try to perform an MFA challenge through the likes of a push notification to a user's device.

plugin /usr/local/lib/openvpn-auth-ldap.so /etc/openvpn/server/demo/auth/ldap.conf
plugin /opt/duo/duo_openvpn.so --config-file=/etc/openvpn/server/demo/auth/duo.conf

Even where the user was to accept the MFA push from Duo, OpenVPN would (correctly) reject the authentication attempt for the first plugin call having failed, so the Duo push would have been unnecessary, and could potentially lead to MFA-challenge fatigue with a remote attacker repeatedly attempting connections with a valid username, or just a forced lock-out from repeated unacknowledged MFA calls even where the LDAP verification failed.

In the above scenario there's value in having OpenVPN abort plugin execution on first failure, but are there any use-cases where this behaviour wouldn't be desired? Would changing the flow in this area necessitate a new configuration flag (e.g. plugin-outcome-handling with options of fast-fail or fall-through, defaulting to fall-through for backwards compatibility), or would breaking out of the loop as soon as the error flag is set without any other conditions be a valid thing to do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant