-
Notifications
You must be signed in to change notification settings - Fork 63
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
OpenVPN LDAP Plugin doesn't run in asynchronous mode #66
Comments
I opened a PR for this issue #67 which I'm hoping helps solve this issue. |
Had this weird packet losses. I found a workaround (actually solution) using auth-user-pass-verify script which support deferred auth since OpenVPN 2.5+. Some source links: OpenVPN server config file:
Example of ldap_auth.sh script (use your
After using this you should see deferred auth messages in OpenVPN server log: Username/Password authentication deferred for username 'username' Hope this will help |
Thank you very much @kirik . We were facing the exact same issue. Here is our version of the script that perform the check against 2 different DN (we have real user and service account) #!/bin/bash
ourname=ldap_auth.sh
facility=auth
output=$(mktemp)
error=$(mktemp)
log_this () {
echo "$1"
}
log_this "Connection from username: $username at $(date)"
exit_if_ok() {
if [ $status -eq 0 ]; then
numentries=$(awk '/numEntries:/{ne = $3} END{print ne + 0}' "$output")
if [ $numentries -eq 1 ]; then
log_this "User ${username} authenticated successfully"
echo "1" > "${auth_control_file}"
exit 0
fi
fi
}
# child process - try simple shell backgrounding
(
# check email
ldapsearch -x -H ldaps://ldap.domain:636 \
-D "uid=${username},ou=People,o=domain.com" \
-w "${password}" \
-b "ou=People,o=domain.com" \
"uid=${username}" 1>"${output}" 2>"${error}"
status=$?
exit_if_ok
# # check service account
ldapsearch -x -H ldaps://ldap.domaint:636 \
-D "cn=${username},ou=Applications,o=domain.com" \
-w "${password}" \
-b "ou=Applications,o=domain.com" \
"cn=${username}" 1>"${output}" 2>"${error}"
status=$?
exit_if_ok
log_this "User ${username} NOT authenticated"
echo "0" > "${auth_control_file}"
exit 1
) &
# tell openvpn that auth will be deferred
exit 2 |
Hello, there is an OpenVPN ticket regarding packet loss when auth plugins are used with OpenVPN.
https://community.openvpn.net/openvpn/ticket/585#no1
This plugin does not seem to contain the asychronous method calls?
The text was updated successfully, but these errors were encountered: