Interview Prep/DevSecOps/SAST, SCA and secrets scanning in CI

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/.

All DevSecOps questions Roadmap: Security in the pipeline

More on SAST, SCA and secrets scanning in CI