Skip to content

ci: block committed secrets and private keys - #14

Merged
0xmanhnv merged 1 commit into
mainfrom
chore/secret-scan
Oct 18, 2026
Merged

0xmanhnv merged 1 commit into
mainfrom
chore/secret-scan

Conversation

@0xmanhnv

Copy link
Copy Markdown
Member

Adds a blocking secret scan to this repository. It changes CI only; no code or history is touched.

  • .github/workflows/secret-scan.yml:
    • Private-key guard: fails when a change adds a PEM/OpenSSH private key block, a key or keystore file (.key .p12 .pfx .jks), or anything under data/. Throwaway keys under testdata/ are allowed. The guard is the same script openctemio/openctem uses.
    • Betterleaks 1.9.0, pinned by SHA-256. A pull request scans only the commits it adds and fails on a finding. A push to main, a manual run and a weekly run scan the full history.
    • Findings are printed redacted. Nothing is uploaded.
  • .betterleaks.toml: the default rules, minus test fixtures, lock files and obvious placeholders (your-…, <…>, ${…}, example…, changeme).
  • .gitleaksignore (only where the history has matches): fingerprints of the matches already in the history. Each one was checked by hand: they are documentation placeholders and test fixtures, not credentials.
  • .gitignore: ignores .env files, key files and /data/, so they are not committed by accident.

Verified locally: a full-history scan with this config exits 0, actionlint passes, and a planted token makes the scan fail.

Pull requests are scanned with the pinned Betterleaks and the private-key guard, and the full history is scanned weekly. Matches already in the history are verified placeholders or fixtures and are listed in .gitleaksignore. Env files, key files and data/ are now ignored.
@0xmanhnv
0xmanhnv merged commit 11210ae into main Oct 18, 2026
3 checks passed
@0xmanhnv
0xmanhnv deleted the chore/secret-scan branch October 18, 2026 03:21
0xmanhnv added a commit that referenced this pull request Oct 19, 2026
Pull requests are scanned with the pinned Betterleaks and the private-key guard, and the full history is scanned weekly. Matches already in the history are verified placeholders or fixtures and are listed in .gitleaksignore. Env files, key files and data/ are now ignored.

Co-authored-by: Nguyen Manh <18032641+0xmanhnv@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant