Skip to content

Log External SAML Auth Requests#6155

Merged
mitchellhenke merged 10 commits intomainfrom
mitchellhenke/log-saml-auth-requests
Apr 5, 2022
Merged

Log External SAML Auth Requests#6155
mitchellhenke merged 10 commits intomainfrom
mitchellhenke/log-saml-auth-requests

Conversation

@mitchellhenke
Copy link
Contributor

Currently, we log OIDC auth requests with the OPENID_CONNECT_REQUEST_AUTHORIZATION event. SAML has a similar event in SAML_AUTH, but it's not quite the same. SAML will redirect internally and this event is only logged when a user is completely authenticated. This means we capture the event later in the process, and also potentially multiple times for one authentication request.

This PR creates a 'SAML Auth Request' event which aims to be a closer match to the behavior on the OIDC side of logging where we log the external request only and before user authentication is required. The authentication gate on the original event is what prevented from adding external as an attribute rather than creating a new event.

@mitchellhenke mitchellhenke requested a review from orenyk April 5, 2022 15:17
changelog: Internal, Logging, Log external SAML authentication requests
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/log-saml-auth-requests branch from 3b6a0d4 to 9ac4a6f Compare April 5, 2022 15:18
Copy link
Contributor

@orenyk orenyk left a comment

Choose a reason for hiding this comment

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

Two small comments/questions, otherwise looks good to me!

# @param [Integer] requested_ial
# @param [String] service_provider
# An external request for SAML Authentication was received
def saml_auth_request(
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️ thank you for adding this in the new style!

Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

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

LGTM

Mitchell Henke and others added 2 commits April 5, 2022 14:18
Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/log-saml-auth-requests branch from 80b594c to 906cec8 Compare April 5, 2022 19:53
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/log-saml-auth-requests branch from 704e265 to dced7c1 Compare April 5, 2022 21:37
Copy link
Contributor

@orenyk orenyk left a comment

Choose a reason for hiding this comment

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

:shipit: assuming specs pass!

@mitchellhenke mitchellhenke marked this pull request as ready for review April 5, 2022 22:02
@mitchellhenke mitchellhenke merged commit 24657bc into main Apr 5, 2022
@mitchellhenke mitchellhenke deleted the mitchellhenke/log-saml-auth-requests branch April 5, 2022 22:16
mitchellhenke pushed a commit that referenced this pull request Apr 5, 2022
* log SAML auth requests as well

* Account for authpost

* check for nil

* fix specs

* add SAML Auth request spec

changelog: Internal, Logging, Log external SAML authentication requests

* add POST spec

* rename analytics attributes to be clearer

* simplify analytics call

Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>

* move POST spec to feature spec

* fix SAML post url

Co-authored-by: Oren Kanner <oren.kanner@gsa.gov>
Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
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.

3 participants