G9: Add secret scanning #57

Open
opened 2026-11-09 17:06:03 +00:00 by claude · 1 comment
Member

Add gitleaks to CI to catch new secrets, and scan existing history once.

Important: never post findings in issues, commit messages, CI logs, or Discourse, since these are public. Configure redaction. Record history-scan results only in the private assessment and raise them with Eric via a needs-eric comment that says only that a finding exists.

Acceptance: the CI check blocks a planted fake secret. History scan is done for the repos in G5 plus DevOps/www and this repo.

Depends on: G2.

Add gitleaks to CI to catch new secrets, and scan existing history once. **Important**: never post findings in issues, commit messages, CI logs, or Discourse, since these are public. Configure redaction. Record history-scan results only in the private assessment and raise them with Eric via a `needs-eric` comment that says only that a finding exists. **Acceptance**: the CI check blocks a planted fake secret. History scan is done for the repos in G5 plus DevOps/www and this repo. Depends on: G2.
claude added this to the CI/CD 2: Quality gates milestone 2026-11-09 17:06:03 +00:00
claude added the
priority
high
cicd
labels 2026-11-09 17:06:03 +00:00
claude added this to the CI/CD Roadmap project 2026-11-09 17:07:33 +00:00
Author
Member

CI check committed (ef693ff), not yet run on the runner. History scan done.

What's committed

  • .gitea/workflows/reusable-secret-scan.yaml: a reusable workflow (workflow_call). It downloads gitleaks 8.30.1, checks the tarball's SHA-256 (the same pin as the G1 image), and scans the pushed commits (before..sha), the PR's commits (base..head), or the current tree for a manual run or a new branch. Logs show only a count and the scanned range, with values redacted and no rule, file or line, because these logs are public. show-details: true is there for private repos. The failure message gives the local command to see details, and says to rotate a real secret before anything else.
  • .gitea/workflows/secret-scan.yaml: this repo's caller, manual-only until S8 (#41) passes. The push/pull_request trigger is written in its header. The commit started no runs, which I checked.
  • .gitleaks.toml: default rules, plus an allowlist for Helm checksum/* annotations (SHA-256 hashes, not secrets).
  • docs/ci-cd/secret-scanning.md: usage, inputs, what to do when it fails, known false positives, and the history-scan policy (done privately, never in CI).

Tested locally, by running the workflow step's script verbatim in a container against throwaway repos:

Case Result
Planted fake token: push range, new-branch push, PR fails, count only, value not in output
Clean push range with a checksum annotation passes
Range after the token is removed / tree after removal passes
Same file with no .gitleaks.toml flagged, so the allowlist is what clears it
Wrong tarball checksum fails before scanning
This repo's current tree passes

actionlint 1.7.12 (with shellcheck) and yamllint pass.

History scan: done for the G5 roles, DevOps/www and this repo with the same gitleaks version, across all refs, with values redacted. The results are in the private assessment for Eric. Per this issue, they stay out of public places.

Remaining before close

  1. S8 passes. Then switch the caller to push/pull_request and show the check blocking a planted fake secret on the runner, in a cicd-test-* repo rather than here.
  2. Roll the caller out to the G5 roles and DevOps/www with G2/G5. www needs an allowlist for Stripe publishable keys, which are public by design. Cross-repo uses: is untested here, and G2 (#50) covers that.

— eom-cicd-roadmap

**CI check committed (ef693ff), not yet run on the runner. History scan done.** **What's committed** - `.gitea/workflows/reusable-secret-scan.yaml`: a reusable workflow (`workflow_call`). It downloads gitleaks 8.30.1, checks the tarball's SHA-256 (the same pin as the G1 image), and scans the pushed commits (`before..sha`), the PR's commits (`base..head`), or the current tree for a manual run or a new branch. Logs show only a count and the scanned range, with values redacted and no rule, file or line, because these logs are public. `show-details: true` is there for private repos. The failure message gives the local command to see details, and says to rotate a real secret before anything else. - `.gitea/workflows/secret-scan.yaml`: this repo's caller, **manual-only** until S8 (#41) passes. The `push`/`pull_request` trigger is written in its header. The commit started no runs, which I checked. - `.gitleaks.toml`: default rules, plus an allowlist for Helm `checksum/*` annotations (SHA-256 hashes, not secrets). - `docs/ci-cd/secret-scanning.md`: usage, inputs, what to do when it fails, known false positives, and the history-scan policy (done privately, never in CI). **Tested locally**, by running the workflow step's script verbatim in a container against throwaway repos: | Case | Result | |---|---| | Planted fake token: push range, new-branch push, PR | fails, count only, value not in output | | Clean push range with a checksum annotation | passes | | Range after the token is removed / tree after removal | passes | | Same file with no `.gitleaks.toml` | flagged, so the allowlist is what clears it | | Wrong tarball checksum | fails before scanning | | This repo's current tree | passes | `actionlint` 1.7.12 (with shellcheck) and `yamllint` pass. **History scan:** done for the G5 roles, DevOps/www and this repo with the same gitleaks version, across all refs, with values redacted. The results are in the private assessment for Eric. Per this issue, they stay out of public places. **Remaining before close** 1. S8 passes. Then switch the caller to `push`/`pull_request` and show the check blocking a planted fake secret on the runner, in a `cicd-test-*` repo rather than here. 2. Roll the caller out to the G5 roles and DevOps/www with G2/G5. www needs an allowlist for Stripe publishable keys, which are public by design. Cross-repo `uses:` is untested here, and G2 (#50) covers that. — eom-cicd-roadmap
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DevOps/software-infrastructure#57