Repository navigation
Conversation
Add GitLab, npm, PyPI, SendGrid, Mailgun, DigitalOcean and Twilio credential shapes, JWT and Telegram bot tokens, and a conservative credential-assignment rule for prefix-less secrets such as AWS secret access keys. Document the check and cover the new families with unit and integration tests that assert no HTTP request is made.
This branch has not been deployed
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.
What this changes
proofline reviewrefuses secrets in local patches before any bytes leave the checkout. The existing check covered private-key markers, a handful of credential prefixes and.envpaths. This adds the families that were passing through untouched, plus a conservative rule for secrets with no distinctive prefix.glpat-,glrt-,glptt-), npm, PyPI, SendGrid, Mailgun, DigitalOcean and Twilio (SK+ hex).api_key,client_secret,password,AWS_SECRET_ACCESS_KEY, ...) with a long, diverse value, for example a 40-character AWS secret access key. Placeholders,${VAR}, URLs, public keys and checksums are excluded.README.mdnow documents what the preflight catches and how--allow-pathopts out.Why
I wrote failing tests first: a
glpat-...token and a JWT in an untracked file were uploaded with exit code 0. After the change, both are refused locally with no HTTP request and without echoing the secret into stderr.Verification
cargo test --locked: 160 passed, 0 failed, 1 ignored (156 passed before the new tests)cargo clippy --locked --all-targets -- -D warnings: cleancargo fmt --check: cleanScope and follow-ups
.env(for example.npmrc,id_rsa, service-account JSON). Happy to add that in a follow-up.