Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What are your recommendations about sending authentication failures to Sentry? #84153

Open
craigmcc opened this issue Jan 28, 2025 · 3 comments

Comments

@craigmcc
Copy link

I am not talking about problems with Sentry itself.

I am talking about when a user tries to log in to my system, and the username/password match (or whatever depending on your auth implementation) fails. For simplicity sake, let's assume we are talking about self username password authentication. Should that be reported in a Sentry event?

I can think of at least three alternatives:

  • Send a failure notice to Sentry, including both the failed username and password.
  • Send a failure notice to Sentry, including maybe only the proposed username.
  • Do not send a failure notice to Sentry (and maybe deal with it locally).

Either of the first two alternatives seems like a risk of unwarranted sharing of PII (think about a user that gets their username right but has an off-by-one character mis-type in the password). In the second case, it can potentially be determined that a particular username is under attack.

But what happens if Sentry itself is breached?

I am inclined towards the third alternative, but that puts the onus of protecting information back on me, of course.

What does Sentry recommend your users do in this kind of scenario?

@getsantry
Copy link
Contributor

getsantry bot commented Jan 28, 2025

Assigning to @getsentry/support for routing ⏲️

@getsantry
Copy link
Contributor

getsantry bot commented Jan 28, 2025

Routing to @getsentry/product-owners-settings-auth for triage ⏲️

@getsantry getsantry bot moved this from Waiting for: Support to Waiting for: Product Owner in GitHub Issues with 👀 3 Jan 28, 2025
@leedongwei
Copy link
Member

Hello @craigmcc

Sentry is generally meant for bugs in your code, and a user putting in a wrong password is not a bug.

If you're concerned about regressions on your authentication API, then we have an alerting feature that can ping you when the throughput or error count from the API becomes anomalous. You would not need to send user information for this use case.

If you're concerned about attacks on a specific user, then you need to consider the actions you'd want to take and then pick your tooling from there.

If you have to send user information to Sentry, then user_id should be more than sufficient for your purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants