Repository navigation
feat(detectors): detect Sentry auth tokens - #83
Merged
Merged
Conversation
Sentry DSNs are public by design and stay unflagged; only the sntrys_/sntryu_ auth tokens are reported. Closes omerbek#67.
Merged
Closed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #67.
Adds one detector for Sentry auth tokens and keeps DSNs out of the report.
SECRET_PATTERNS:("Sentry auth token", r"\bsntry[su]_[A-Za-z0-9+/=_\-]{40,}")CANDIDATE_LITERALS:"sntry", so lines without the prefix are still skipped earlytest_detects_provider_keys, plustest_detects_sentry_user_tokenforsntryu_andtest_ignores_sentry_dsnforhttps://abc@o123.ingest.sentry.io/456The DSN case matters:
SENTRY_DSNis a public value, so reporting it would be a false alarm on nearly every Sentry project. The token prefix makes the two easy to separate, and the negative test pins it.Verification:
The one error is
StagedScanTests.test_scans_index_contents_and_handles_unusual_paths, which writes a file namedodd name\n.js— Windows rejects\nin filenames (OSError: [Errno 22]). It fails identically onmainhere, so it is this machine, not the branch; Linux CI is unaffected. AllSecretScanTestspass, including the three Sentry cases.CHANGELOG.mduntouched since it is written at release time.