Forum Discussion
jnantel
Nimbostratus
Apr 12, 2010RADIUS iRule swam ps my RADIUS server
Seems like I am not getting any kind authentication caching with my iRULE. Each http object is generating a separate request to my radius server. My radius server in turn thinks it is under attack unless I disable most of the DoS protection.
RADIUS server is IIS
The purpose of my iRULE is to strip username out of the authenticated session and pass it to the webserver.
SSO RADIUS v02.3
simple radius auth using HTTP Authentication
when CLIENT_ACCEPTED {
log "CLIENT_ACCEPTED start"
set auth_sid [AUTH::start pam agent_source_radius_profile]
log "CLIENT_ACCEPTED end"
}
when HTTP_REQUEST {
log "HTTP_REQUEST start"
set user_name [session lookup uie UN]
log "HTTP_REQUEST adding header"
HTTP::header replace RADIUS_USER_NAME [HTTP::username]
if {$user_name != [HTTP::username]} {
log "HTTP_REQUEST do auth"
session add uie UN [HTTP::username]
AUTH::username_credential $auth_sid [HTTP::username]
AUTH::password_credential $auth_sid [HTTP::password]
AUTH::authenticate $auth_sid
HTTP::collect
}
}
when AUTH_SUCCESS {
log "AUTH_SUCCESS start"
if {$auth_sid eq [AUTH::last_event_session_id]} {
HTTP::release
}
}
when AUTH_FAILURE {
log "AUTH_FAILURE start"
if {$auth_sid eq [AUTH::last_event_session_id]} {
HTTP::respond 401
}
}
when AUTH_WANTCREDENTIAL {
log "AUTH_WANTCREDENTIAL start"
if {$auth_sid eq [AUTH::last_event_session_id]} {
HTTP::respond 401
}
}
when AUTH_ERROR {
log "AUTH_ERROR start"
if {$auth_sid eq [AUTH::last_event_session_id]} {
HTTP::respond 401
}
}
Any help would be appreciated.
jnantel
7 Replies
- hoolio
Cirrostratus
Hi,when HTTP_REQUEST { Check if a basic auth username and password were sent by client if {[HTTP::username] ne "" and [HTTP::password] ne ""} { Check if username/password are already in the session table if {[session lookup uie [HTTP::username]] eq [HTTP::password]}{ Auth was already successful on previous request log "HTTP_REQUEST adding header" HTTP::header replace RADIUS_USER_NAME [HTTP::username] } else { Save the username and password for reference in the AUTH_ events set user [HTTP::username] set pass [HTTP::password] log "HTTP_REQUEST do auth" AUTH::username_credential $auth_sid [HTTP::username] AUTH::password_credential $auth_sid [HTTP::password] AUTH::authenticate $auth_sid HTTP::collect } } else { HTTP::respond 401 } } when AUTH_SUCCESS { log "AUTH_SUCCESS start" if {$auth_sid eq [AUTH::last_event_session_id]} { Add the username and password to the session table for one hour session add uie $user $pass 3600 HTTP::release } }
- hoolio
Cirrostratus
If HTTP::username and HTTP::password don't work in AUTH_SUCCESS, you could save them in HTTP_REQUEST as user and pass, and then change the AUTH_SUCCESS line to: - jnantel
Nimbostratus
Thanks for the quick reply guys. - hoolio
Cirrostratus
Hi jnantel, - jnantel
Nimbostratus
Ah, I did miss the second post. I do have a small problem in that I am editing someone else's code. The developer we assigned to this has since left the company. Back to the code: I've done some work with HTTP:username and HTTP:password , I'm not sure how to save credentials as anything else without breaking the whole rule. - hoolio
Cirrostratus
No worries, I've updated the code example in the first reply. Can you try incorporating that with the rest of your rule (just replace your HTTP_REQUEST and AUTH_SUCCESS events with mine)? - jnantel
Nimbostratus
I'm stuck atm, my staging RADIUS server is acting up. I really appreciate the help. The rule was accepted by my LTM 1500. It looks like it is running normally in the log. The Auth server is just rejecting atm. I've reverted to an older rule and it isn't working as well.
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