fix(leak-scan): install gitleaks+trufflehog with SHA pins; fail-closed all-refs mode#63
Merged
Merged
Conversation
…mode Add SHA-256-pinned install steps for gitleaks v8.30.1 and trufflehog v3.95.9 to actions/leak-scan/action.yml. Each step is idempotent (skips download when the tool is already on PATH) and verifies the release tarball checksum before installation. Harden run.sh: in all-refs mode, gitleaks being absent after the install step now causes an immediate job failure (E_GITLEAKS_MISSING) instead of the previous warn-and-continue behaviour. pr-diff mode retains its graceful warning so callers that rely on deny-list-only fallback are unaffected. Add T-D7 test group (11 tests) covering install step presence, version and SHA pinning, idempotency, checksum verification, and the fail-closed all-refs contract.
…guard position Add continue-on-error: true to both install steps so that a failed download or checksum mismatch does not abort the composite action before run.sh executes. run.sh enforces the fail-closed contract for all-refs (E_GITLEAKS_MISSING) and the graceful warning for pr-diff, so the correct behaviour is preserved regardless of install outcome. Move the if __name__ == "__main__" guard to the physical end of test_deploy_platform_d.py so that the T-D7 test class is not skipped when the file is executed directly.
8082775 to
6687500
Compare
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
actions/leak-scan/action.yml. Tarballs are verified against pinned checksums before installation. Install is idempotent: skips download when the tool is already on PATH.run.sh: inall-refsmode, gitleaks being absent after the install step now causes an immediate job failure (E_GITLEAKS_MISSING) instead of the previous warn-and-continue behaviour.pr-diffmode retains its graceful warning; existing callers usingpr-diff(e.g.homelab-deploypipeline.yml) are unaffected.Verified against run https://github.com/JorisJonkers-dev/homelab-deploy/actions/runs/29074833445 which showed the silent-degradation path.
Test plan
leak-scan-all-refs.ymlto confirm a real gitleaks all-refs scan executes