ci(gitleaks): extend the centralized config and move the action to v16 - #39
Merged
Conversation
Two changes that only make sense together. The action moves from modules-actions@v6 to @v16. v6 predates the centralized gitleaks config entirely: no gitleaks/config directory, and it greps for an undotted gitleaks.toml that this module does not ship. .gitleaks.toml now extends the centralized config instead of the gitleaks defaults. "useDefault = true" extends gitleaks own defaults, so the centralized base config never applied here and its rules -- werf-secret-key, hashicorp-vault-token, openbao-token, none of which exist in any default ruleset -- never ran. Pointing [extend] at the base config is what the header of gitleaks.base.toml documents, and v16 places that file at the repository root, so the relative path resolves. Verified with the v16 layout reproduced locally: the base rules fire, the base allowlists apply, and this module reports no findings at full scan scope. Signed-off-by: v.oleynikov <vasily.oleynikov@flant.com>
duckhawk
force-pushed
the
chore/gitleaks-action-v17
branch
from
July 28, 2026 10:21
51ea818 to
622b623
Compare
fastrapier
approved these changes
Jul 28, 2026
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.
Why
.gitleaks.tomldeclared[extend] useDefault = true, which extends gitleaks' own defaults — not the centralized Deckhouse config. Sogitleaks.base.tomlnever applied here, and neither did the three rules it defines that exist in no default ruleset:werf-secret-key,hashicorp-vault-token,openbao-token. A committed Vault token or werf secret key was invisible.Pointing
[extend]at the base config is exactly what the header ofgitleaks.base.tomldocuments. Measured on a scratch repo holding a Vault token, a 32-hex.werf_secret_key, anh1:checksum and a docs placeholder:useDefault = true(before)generic-api-keyonlyuseDefault = false+path(after)hashicorp-vault-token,werf-secret-keyIn the second case
generic-api-keyalso disappears — the base allowlist suppresses the checksum, so the whole chain is live.The action moves
@v6→@v16because that is what makes the base config exist at all:v6predates it entirely (nogitleaks/config/directory, and it greps for an undottedgitleaks.tomlno module ships).v16copies the base config to the repository root, so the relativepathresolves. Only thegitleaksaction is repinned —build,cve_scan,go_*anddeploykeep their own refs.Verification
Reproduced the v16 layout locally (base config at the repository root,
-c .gitleaks.toml, run from the root) and scanned at full history scope across all live refs:Same result for all 17 storage modules, so re-enabling the centralized rules turns nobody red.
Note
No change is needed in
modules-actionsitself. The choose-one logic there is deliberate — the base config stays centralized and a module that wants additions must extend it explicitly. This module simply never honoured that contract.Two caveats worth knowing:
gitleaks detect -c .gitleaks.tomlnow fails locally withFTL failed to load extended config, becausegitleaks.base.tomlonly exists inside CI. That is inherent to the documented contract.pathresolves against the current directory, not the config file's directory, so the scan must run from the repository root. CI does.