feat(auth): Add comprehensive 2FA logging to login flow#107378
Closed
sentry[bot] wants to merge 1 commit intomasterfrom
Closed
feat(auth): Add comprehensive 2FA logging to login flow#107378sentry[bot] wants to merge 1 commit intomasterfrom
sentry[bot] wants to merge 1 commit intomasterfrom
Conversation
Contributor
|
This pull request has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you add the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses a gap in our login funnel visibility by introducing new log messages specifically for the Two-Factor Authentication (2FA) process. Previously, it was difficult to track user journeys and identify drop-offs or failures during the 2FA step.
New log messages have been added at critical points in the 2FA flow:
user.auth.2fa-required: Logged when a user is identified as needing 2FA but has not yet completed it. This occurs insrc/sentry/utils/auth.py.user.auth.2fa-passed: Logged when a user successfully passes 2FA validation, marking their session as 2FA-compliant. This occurs insrc/sentry/utils/auth.py.user.auth.2fa-success: Logged upon the complete and successful sign-in of a user after passing 2FA. This occurs insrc/sentry/web/frontend/twofactor.py.user.auth.2fa-failed: Logged when a user submits an invalid 2FA code. This occurs insrc/sentry/web/frontend/twofactor.py.user.auth.2fa-rate-limited: Logged when a user exceeds the allowed number of 2FA attempts. This occurs insrc/sentry/web/frontend/twofactor.py.These new logs will provide much-needed insight into the 2FA stage of the login process, allowing for better analysis of user experience, identification of friction points, and improved debugging capabilities for 2FA-related issues.
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.