Skip to content

[LG-7676] Add logging of matching certificate for SAML AuthnRequests#7047

Merged
orenyk merged 1 commit intomainfrom
oyk-saml-cert-logging
Sep 30, 2022
Merged

[LG-7676] Add logging of matching certificate for SAML AuthnRequests#7047
orenyk merged 1 commit intomainfrom
oyk-saml-cert-logging

Conversation

@orenyk
Copy link
Contributor

@orenyk orenyk commented Sep 29, 2022

Resolves LG-7676

changelog: Improvements, Authentication, Add logging of matching certificate for SAML AuthnRequests

🎫 Ticket

https://cm-jira.usa.gov/browse/LG-7676

🛠 Summary of changes

Adds a new attribute to successful SAML Auth events to track the serial number of the matching cert identified through signature validation. If the signature validation fails, this attribute will be nil, indicating that none of the configured SP public certificates could be used to validate the signature in the SAML AuthnRequest.

📜 Testing Plan

Provide a checklist of steps to confirm the changes.

  • Send signed SAML AuthnRequest with corresponding public cert in the IdP SP record
  • Check event logs in CloudWatch
  • Expect SAML Auth event to include matching_cert_serial property with corresponding cert serial number

🚀 Notes for Deployment

N/A

@orenyk orenyk requested review from a team and mitchellhenke September 29, 2022 04:15
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate this but currently we set FakeSamlRequest#service_provider to the instance of FakeSamlRequest and I didn't want to go down a rabbit hole untangling it (I tried using instance_double but ran into RSpec loading issues).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This turns off the SAML assertion signature for the AuthnRequest, so there can be no matching cert. I didn't write an explicit test for when the signature is invalid or uses a cert that isn't configured, but the result should be the same.

Resolves LG-7676

Adds a new attribute to successful `SAML Auth` events to track the
serial number of the matching cert identified through signature
validation. If the signature validation fails, this attribute will be
`nil`, indicating that none of the configured SP public certificates
could be used to validate the signature in the SAML AuthnRequest.

changelog: Improvements, Authentication, Add logging of matching certificate for SAML AuthnRequests
@orenyk orenyk force-pushed the oyk-saml-cert-logging branch from d5ad160 to 75e8c02 Compare September 29, 2022 04:23
@orenyk orenyk merged commit 189e84c into main Sep 30, 2022
@orenyk orenyk deleted the oyk-saml-cert-logging branch September 30, 2022 00:45
@aduth aduth mentioned this pull request Oct 3, 2022
jskinne3 pushed a commit that referenced this pull request Oct 12, 2022
Resolves LG-7676

Adds a new attribute to successful `SAML Auth` events to track the
serial number of the matching cert identified through signature
validation. If the signature validation fails, this attribute will be
`nil`, indicating that none of the configured SP public certificates
could be used to validate the signature in the SAML AuthnRequest.

changelog: Improvements, Authentication, Add logging of matching certificate for SAML AuthnRequests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants