gitleaks fails the PR on `tests/fixtures/fake_rsa.pem` and `testdata/aws_creds.json`, which only contain dummy values
BeginnerTroubleshootingSAST, SCA and secrets scanning in CI
Answer
Likely causes → Fixtures match generic rules (private-key, aws-access-token) by pattern; gitleaks has no idea they are fake.
Diagnose →
gitleaks detect --source . --report-format json --report-path gl.json -v
jq -r '.[] | "\(.RuleID) \(.File):\(.StartLine) \(.Fingerprint)"' gl.json
Fix → Add a path allowlist in .gitleaks.toml for fixture folders only, or put specific fingerprints in .gitleaksignore:
[extend]
useDefault = true
[allowlist]
description = "test fixtures"
paths = ['''^tests/fixtures/''', '''^testdata/''']
Prevent → Generate fake keys at test runtime instead of committing them, and review every allowlist change in CODEOWNERS so nobody allowlists src/.
More on SAST, SCA and secrets scanning in CI
gitleaks passes locally but the CI job reports 40 old leaks nobody touched in this PRIntermediate`fatal: ambiguous argument 'origin/main..HEAD': unknown revision` in the secrets-scan stepBeginnerSemgrep flags `subprocess.run(cmd, shell=True)` in a script where `cmd` is a hard-coded constantBeginnerSemgrep in CI reports findings in `node_modules/`, `vendor/` and minified `dist/*.js`BeginnerSemgrep job takes 35 minutes and gets killed with `exit code 137`IntermediateSonarQube Quality Gate fails on "Security Hotspots Reviewed is less than 100%" but there are no vulnerabilitiesBeginner