I have a requirement to maintain session credential attribute information across multiple authentication levels. In my case, the user first authenticates to a cert required webseal instance and hence the first auth level is ssl. During this authentication, I use the user name mapping module XSLT (could just as easily use LUA) to grab various x509 attributes, such as the cert fingerprint and valid to/from information, and put in various session credential attributes. These attributes are then passed to backend applications using HTTP headers or other means as they are required to either present information to the backend for authorization decisions or user informational screens.
When the user changes authentication levels upwards to another level, for example password or EAI, these session credential attributes are not preserved. I have tried both using the user name mapping module and LUA to try to preserve these attributes with no success. During the user name mapping module, if stepping up to password, the x509 attributes are not available during the password step-up authentication. For LUA, the same applies.
Regarding LUA, I turned on every stage of transformation on a test LUA rule that outputs the entire context. I then enabled debugging on pdweb.http.transformation (level 9) and collected the output to try to determine during the POST /pkmslogin.form if I could grab the previous session credential attributes before the authentication occurred and then set them back later. Unfortunately it seems the pkmslogin.form can only be transformed at the request and postauthn:password stage. At the request stage, there are no session attributes available. At the postauthn stage, the authentication has already occurred and I've lost the x509 data I need.
I then had the idea of perhaps I could set actual session attributes, not session credential attributes. However, if I try to use Session.setSessionAttribute() in the LUA rule at the response stage, I get "service unavailable" from webseal and see DSC issues in the webseal logs. If I try to set it at the postauthn:ssl stage, there is no session ID and there is a message reported in the debug that notes "Not adding the session attribute: ... (no session)". Note, I can successfully set session credential attributes using Session.setCredentialAttribute. I was hoping, however, that perhaps if I set an actual session attribute it would be preserved after the credential changes from ssl to password, and hence in the postauthn:password stage I might be able to retrieve those session attributes from the ssl stage and put them on the session password credential attributes.
In my case, my requirement is to make the ssl x509 information available after a step-up password authentication has occurred, and to not to make a call to an external dependency (i.e. the runtime) to reduce potential impacts to authentication (latency and reliability). One of my other thoughts was to try coding a LUA EAI for the password authentication, but this would also mean having to handle password changes, etc. which would be a lot of code to maintain and hence complexity. In addition, from what I've seen, I still don't think the x509 attributes would be available even to the EAI when the step-up occurs. The only other thought was to use LUA to make use of some external means to store the x509 information between the authentication levels, meaning, using a database, LDAP, Redis, or something custom to maintain the cert data in between the authentication levels. However, using an external store introduces a dependency into the authentication flow which is against my initial set of requirements.
I'm hoping that perhaps someone else has had to preserve x509 attributes from an ssl authentication for a later stage of authentication, such as after additional MFA occurs. Any thoughts would be greatly appreciated. Thus far I have hit a dead end on this, yet this is a customer requirement I have to meet.
------------------------------
Matt Jenkins
------------------------------