Repository navigation
fix: stop flagging ordinary words as secrets in posts that mention Docker - #600
Closed
rohitsasi720 wants to merge 1 commit into
Closed
rohitsasi720 wants to merge 1 commit into
rohitsasi720 wants to merge 1 commit into
Conversation
rohitsasi720
force-pushed
the
fix/secret-warning-docker-usernames
branch
from
October 19, 2026 14:44
370b12a to
321c964
Compare
Contributor
|
i had same issue with this commit -> https://dev-null.sh/@kachelle/commits/01a15590-b0fa-7136-855c-cba9b2c082a3 It flagged the uuid of the github-commit |
5 tasks
Contributor
Author
…cker Two Docker Hub rules in the secret scanner look for a username: once a post mentions Docker, they flag the word after any "id", "user" or "usr", even inside words, so "I didn't want Docker on my Mac" flagged "want". A username isn't a secret, and Docker's tokens have a rule of their own, so the composer now ignores those two rules. Fixes dev-null-sh#572
rohitsasi720
force-pushed
the
fix/secret-warning-docker-usernames
branch
from
October 22, 2026 09:53
321c964 to
f5a06cb
Compare
Member
|
Note This message is generated by gpt-6.1-sol on behalf of xHeaven. It may contain errors—verify important details. Closing because the secret scanner and all related warnings have been removed in #999, so this scanner-specific fix is no longer needed. |
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.
Fixes #572.
Problem
The composer warned that a perfectly normal reply contained a secret, and "Select possible secret" selected the word
want.Two Docker Hub rules in
@sanity-labs/secret-scan,dockerhub-v1-1anddockerhub-v2-1, share this regex, run whenever the text mentions "docker", and have no entropy floor:/(?:user|usr|-u|id)\S{0,40}?[:=\s]{1,3}[ '"=]?([a-zA-Z0-9]{4,40})\b/imSo the word after any
id,userorusr, even inside another word, counts as a secret:wantlovegoodrohit(the username, not the token)They come from TruffleHog, where they find the username half of a username and token pair. A username isn't a secret, and Docker's tokens have a rule of their own (
dockerhub-v2-2).Fix
resources/js/lib/sensitive-text.ts, the only place that calls the scanner, ignores those two rules:findSecretsleaves their findings out,removeSecretskeeps their text, andstashableBodyfollowsfindSecrets, so these drafts are stashed again too.Only these two of the scanner's 1,115 rules use this pattern. Leaving them out changes nothing else, and is narrower than an entropy floor on every rule, which could also hide real short passwords.
wantloverohitTests
tests/Unit/SensitiveText.test.ts: posts that mention Docker keep their words (no findings, nothing redacted, stashable), and a Docker access token next todocker login -uis still found, without the username. Both tests fail onproductionand pass here.bun run test:unit(69 tests),bun run test:lint,bun run test:typesand the component tests pass.productionand on this branch.While checking prose for other false positives, the
tru-2rule also flagged file paths such asresources/js/pages/terminal/show.tsx. That's a separate pattern, so it's not part of this PR.