Repository navigation
ci(security): allow model names and runtime keys assigned in Rust sources in gitleaks #1000
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
691a2ae
ci(security): allow model names and runtime keys assigned in Rust sou…
jussielo-amd c194758
ci(security): scope the gitleaks model and runtime-key exception to t…
jussielo-amd 036df77
ci(security): say which scope each part of the gitleaks exception pro…
jussielo-amd 00bad5e
ci(gitleaks): cap model and runtime key value length, note AND is loa…
jussielo-amd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
condition = "AND"is what keeps this to Rust files; under the default OR the path alone would allowlist every rule in.rsfiles. Please run gitleaks 8.30.1 on a throwaway.rsholding a randomapi_keynext to anapi_modelline before merge, and consider noting in the comment thatANDis load-bearing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, and the comment above the entry now says plainly that
condition = "AND"is load-bearing: under the default OR thepathsentry alone would allowlist every rule in every.rsfile, so it must not be removed. I could not run gitleaks 8.30.1 locally, because the binary is not installed in my environment and I was not able to fetch it. Instead the check is being run through the CI scan on a throwaway probe branch holding a.rsfile with a randomapi_keynext to anapi_modelline and a mixed line with both aruntime_keyand a randomapi_key; the result will be posted here, and the probe branch will never be merged.Result of the check: I ran the repository's PR-time scan, with this branch's config, on a throwaway draft pull request (#1008, closed after reading it) whose probe file holds a random 40-character
api_keyliteral, anapi_model = "Qwen3-0.6B-GGUF"line, and a mixed line with aruntime_keyfield next to a second randomapi_key. gitleaks reported exactly two findings, bothgeneric-api-key: the standaloneapi_keyliteral and theapi_keyon the mixed line. Theapi_modelline and theruntime_keyfield were not reported. So the path and pattern are combined with AND (a Rust file with a real-looking key is still scanned) and the match-level scoping holds on a mixed line.