Forum Discussion
using step up auth to client cert want to insert cert into header
Have you checked what all session variables are populated from the client cert on APM. You can use any of them to add in the header. to begin with -
when ACCESS_ACL_ALLOWED {
set certsubject [ACCESS::session data get session.ssl.cert.subject]
HTTP::header insert "certsubjectdn" $certsubject
}
- AlexS_ybApr 08, 2021Cirrocumulus
Yes, well. its step up auth. so its not done on the access policy. but on a pre request policy. and also has to be done as a subroutine, so my reading tells me that per request subroutines don't have access to the session variables as writeable. only readable.
quick check via the gui interface and it show that the cert info is in the per request sub session variables. how can I insert headers from a subroutine in a pre request policy .. i thinking the only way is to use a irule event ...
but this seems rather hard.
Note - i am note sure when access_acl_allowed is fired, but I have checked the session variables - no sign of the cert in the main session variables :(
- spalandeApr 09, 2021Nacreous
Can you see if HTTP_REQUEST is able to catch and parse cert details? This iRule is just to log the details first.
when HTTP_REQUEST { if {[SSL::cert count] > 0}{ set certsubjectdn [X509::subject [SSL::cert 0]] set certissuerdn [X509::issuer [SSL::cert 0]] log local0.info "certsubjectdn: $certsubjectdn" log local0.info "certissuerdn: $certissuerdn" } else { return } }
- AlexS_ybApr 09, 2021Cirrocumulus
yes I have tried and it didn't work
my presumption is [SSL::cert] looks at the current session data and the cert is not stored there. because it was initiated from a sub session
- spalandeApr 09, 2021Nacreous
okay. Then only option I think of is configuring standard access policy where you can enable it in iRule only for uri /withcert or in VPE itself to check the uri. This should generate session variables from the cert you are looking for to send across the backend server
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] starts_with /withcert] } { ACCESS::enable } else { ACCESS::disable } } when ACCESS_ACL_ALLOWED { set certsubject [ACCESS::session data get session.ssl.cert.subject] HTTP::header insert "certsubjectdn" $certsubject }
Or log a support case on why per request policy is not working for session variables.
Recent Discussions
Related Content
* 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