Chore: Add Betterleaks secret scanning to commits and CI #55

Merged
claude-bot Bot merged 3 commits from chore/add-secret-scanning into main 2026-11-23 00:16:17 +01:00

What changed

  • Add a pre-commit hook that blocks staged secrets with Betterleaks.
  • Add a Secret Scan workflow that scans full Git history on PRs and pushes to main.
  • Ignore .env.* files, while still allowing .env.example.
  • Add .betterleaksignore for one old Gitea token in the deleted .env.local, confirmed revoked (API returned 401).
  • Limit 03, 04 and 05 push triggers to their own stack and workflow file.

Why

A secret stays readable in Git history after its file is deleted. The hook stops it before commit, and CI covers commits that never ran the hook. The trigger change stops unrelated workflow additions from running pulumi up.

Preview

No stack code changed. Live previews with refresh, run before this PR:

  • k8s-infra: 29 unchanged
  • k8s-apps: 7 unchanged
  • monitoring: 5 unchanged

Merging runs 03, 04 and 05 once because their own workflow files changed.

## What changed - Add a pre-commit hook that blocks staged secrets with Betterleaks. - Add a `Secret Scan` workflow that scans full Git history on PRs and pushes to `main`. - Ignore `.env.*` files, while still allowing `.env.example`. - Add `.betterleaksignore` for one old Gitea token in the deleted `.env.local`, confirmed revoked (API returned 401). - Limit `03`, `04` and `05` push triggers to their own stack and workflow file. ## Why A secret stays readable in Git history after its file is deleted. The hook stops it before commit, and CI covers commits that never ran the hook. The trigger change stops unrelated workflow additions from running `pulumi up`. ## Preview No stack code changed. Live previews with refresh, run before this PR: - `k8s-infra`: 29 unchanged - `k8s-apps`: 7 unchanged - `monitoring`: 5 unchanged Merging runs `03`, `04` and `05` once because their own workflow files changed.
claude-bot Bot added 3 commits 2026-11-23 00:13:01 +01:00
Any file under .gitea/workflows triggered pulumi up on 03, 04 and 05, so
adding an unrelated workflow would deploy all three. PR previews still
watch the whole folder.
The ignore file covers one old Gitea token in deleted .env.local, which
was confirmed revoked (API returned 401).
chore(ci): scan full Git history for secrets
Deploy Proxmox Infra / Pulumi Deploy (pull_request) Skipped
Deploy k8s Infra / Pulumi Deploy (pull_request) Skipped
Deploy k8s Apps / Pulumi Deploy (pull_request) Skipped
Deploy Monitoring / Pulumi Deploy (pull_request) Skipped
Deploy Proxmox Infra / Pulumi Preview (pull_request) Successful in 53s
Deploy k8s Infra / Pulumi Preview (pull_request) Successful in 42s
Deploy k8s Apps / Pulumi Preview (pull_request) Successful in 38s
Deploy Monitoring / Pulumi Preview (pull_request) Successful in 38s
Secret Scan / Betterleaks (pull_request) Successful in 6s
9b388ff8e2
Covers commits that never ran the local hook, such as edits made in the
Gitea web editor.
claude-bot Bot merged commit 855d1cce85 into main 2026-11-23 00:16:17 +01:00
Sign in to join this conversation.