Repository navigation
fix: stop matching sk- keys inside longer words in the publication audit - #12
Open
Brendan-Lim wants to merge 1 commit into
Open
Brendan-Lim wants to merge 1 commit into
Brendan-Lim wants to merge 1 commit into
Conversation
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.
Summary
Publication Security on
mainfailed after #11 merged. The history audit flagged GitHub's merge commite4bc812, whose message contains the branch namefix/cask-browser-download-url. That matches the OpenAI key patternsk-[A-Za-z0-9_-]{20,}. It's a false positive, and it's now permanent inmain's history, so the pattern needs fixing (rewritingmainis not an option).An
sk-key now counts only when it isn't the tail of a longer word (cask-,task-,disk-,risk-…). Keys at the start of a line or after=, a quote or a space are still caught. The other patterns are unchanged.Evidence
Publication audit (history): 850 file versions, 788 blobs, 1 findings(git-metadata, objecte4bc812, line 24 = the merge message).audit-public-files.py --history: 0 findings. Tracked: 0 findings.test_sk_key_inside_a_longer_word_is_not_a_credential: fails on the old pattern, passes on the new one. It also checks thatsk-…alone, afterOPENAI_API_KEY=, afterkey: "and after a space are still flagged.python3 -m unittest discover -s scripts/tests: 83 OK (2 skipped).Merge Danger
Door: two-way
Blast Radius: the publication audit only. It's slightly narrower: a real
sk-key glued directly to a preceding letter or digit (e.g.abcsk-…) would no longer be flagged by this script. Gitleaks still scans independently in the same workflow. The homebrew-tap copy of the script gets the same change in a matching PR.