Forum Discussion
sam_111661
Nimbostratus
Nov 27, 2008brute force mitigation
I want to use this irule to authenticate users and allow them only if they have a specific LDAP attribute ldap_attr_value. I would like to know if there is a way to prevent brute force attacks by preventing the username to log in for 15 minutes after 3 authentication failures, many thanks in advance
when HTTP_REQUEST {
set username [HTTP::username]
set password [HTTP::password]
set asid_ldap [AUTH::start pam default_ldap]
AUTH::subscribe $asid_ldap
AUTH::username_credential $asid_ldap $username
AUTH::password_credential $asid_ldap $password
AUTH::authenticate $asid_ldap
HTTP::collect
}
when AUTH_RESULT {
array set auth_response_data [AUTH::response_data]
set ldap_attr [lindex [array get auth_response_data ldap:attr:ldap_attr] 1]
if {[AUTH::status $asid_ldap] == 0 && $ldap_attr equals "ldap_attr_value"} {
HTTP::release
log local0. "ldap_attr is set to: $ldap_attr"
}
else {
HTTP::respond 401
}
}
- sam_111661
Nimbostratus
Already figured this out - sam_111661
Nimbostratus
Sure, most of the code is from devcentral so credits go to others and devcentral. This is for mobile activesync access, it does allow access only to activesync (not OWA or so) authenticates the user, checks if he has one of the required attributes in LDAP and allows three authentication failures before it blacklists the user. I have taken the original ldap auth irule and modified it. And yes it is working but the issue I'm having is with authenticating each and every get / post which is not ideal, I'm trying now to add HTTP cookie auth (not sure is supported by mobile activesync) to it but the command HTTP::cookie decrypt is not working for me as it should - Colin_Walker_12Historic F5 AccountNice, thanks for sharing!
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects