Forum Discussion
Squeak_117117
Nimbostratus
Jun 16, 2017Insert client certificate into APM session variable via IRule
Hello!
First time poster longtime reader.
I´m trying to extract the Subject value from a client certificate and insert the value in to a APM session variable but with no luck. The Irule in question looks like this
when CLIENTSSL_CLIENTCERT {
log local0. "Subject: [X509::subject [SSL::cert 0]]"
if {[SSL::cert count] > 0}{
set client_cert [SSL::cert 0]
set subject [findstr [X509::subject [SSL::cert 0]] "CN=" 3 ","]
ACCESS::session data set session.client.unique_id $subject
log local0. "Current ID = $subject"
}
}
when ACCESS_POLICY_COMPLETED {
set subject [ACCESS::session data get session.client.unique_id]
}
I´m able to see the subject" variable in /var/log
When I´m executing the Access Policy, the session.client.unique_id variable are not populated with the subject" variable from the Irule.
My VPE looks like this,
Thanks in advance!
//Mikael,
- Jad_Tabbara__J1
Cirrostratus
Hello Squeak,
Have you added the event "Access_Policy_Agent_Event" to set your variable ?
when ACCESS_POLICY_AGENT_EVENT { if { [ACCESS::policy agent_id] eq "id_of_your_irule_event" } { ACCESS::session data set session.client.unique_id $subject log local0. "Verifying the value of unique_id ===> [ACCESS::session data get session.client.unique_id]" } }
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