Skip to content

ci: supply-chain hardening (gitleaks, Dependabot, zizmor) + develop/main branch model#120

Merged
VijitSingh97 merged 3 commits into
developfrom
claude/epic-chebyshev-74969b
Jun 18, 2026
Merged

ci: supply-chain hardening (gitleaks, Dependabot, zizmor) + develop/main branch model#120
VijitSingh97 merged 3 commits into
developfrom
claude/epic-chebyshev-74969b

Conversation

@VijitSingh97

@VijitSingh97 VijitSingh97 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Closes #117. Part of the tooling epic #116; the broader pre-commit hook set is left to #118.

Targets develop. This PR also adopts the develop/main branch model (see below); develop is now the repo default. It'll ride into main at the 1.1 release.

RigForge is already supply-chain-hardened where it counts (SHA-pinned actions, version+commit-pinned & verified XMRig build, checksum-verified CI tool installs). This PR adds only the cross-cutting gaps from #117 — it does not redo that work.

1. gitleaks — secret scanning

  • New .github/workflows/security.yml gitleaks job scans the full git history for committed secrets (pool credentials, tokens, the Worker setup: fetch the stratum access-password → default-on stratum auth (Pithead #208 · #152 Phase 2) #113 stratum access-password) on every push and PR.
  • The binary is version- and checksum-pinned (8.30.1, sha256 verified), mirroring the existing shellcheck/shfmt install pattern — reproducible, no runner-image drift, no apt mirror flakiness.
  • Matching .pre-commit-config.yaml hook pinned to the same gitleaks version so a leak is caught locally before it's ever pushed (local == CI).

2. Dependabot

  • .github/dependabot.yml for the github-actions ecosystem only — RigForge is pure shell, so there's no pip/npm/docker ecosystem to track. Keeps the hand-pinned action SHAs current (bumps the pin and the trailing version comment) and surfaces action advisories. Bumps roll up into one weekly PR.

3. zizmor — workflow audit

  • New security.yml zizmor job static-audits the workflows (template injection, over-broad GITHUB_TOKEN, unpinned actions, credential persistence). Pinned to 1.25.2 via pipx.
  • Online audits are on (zizmor's default): GH_TOKEN lets the known-vulnerable-actions audit cross-reference our pinned actions against the GitHub Advisory Database, so a disclosed CVE fails the gate. Runs on push/PR plus a weekly schedule, so a freshly-published advisory trips against the default branch even with no open PRs. Complements Dependabot: zizmor blocks the merge, Dependabot opens the bump.
  • To make the audit clean, hardened the existing workflows:
    • ci.yml: top-level least-privilege permissions: contents: read.
    • ci.yml + release.yml: persist-credentials: false on every actions/checkout.

Branch model (mirrors Pithead)

  • develop is now the default/integration branch; main is the release branch. develop merges to main at each release (1.1 onward), and tags are cut from main.
  • ci.yml + security.yml run on push: [main, develop]; the coverage gate now diffs against the PR's actual base branch (github.base_ref) instead of a hardcoded origin/main, so patch coverage stays correct once develop diverges.
  • CONTRIBUTING.md / RELEASING.md document the model and the release promotion flow.

Acceptance (#117)

  • gitleaks gate green in CI + pre-commit hook active
  • .github/dependabot.yml (github-actions) live
  • zizmor clean (no allowlist needed)

Validation

  • gitleaks 8.30.1no leaks found over full history (168 commits) and the working tree.
  • zizmor 1.25.2No findings to report (exit 0) across all three workflows, offline and online, after the hardening (baseline was 12 findings: 6 artipacked, 6 excessive-permissions).

Scope notes

🤖 Generated with Claude Code

VijitSingh97 and others added 3 commits June 17, 2026 21:56
…117)

Adds the three cross-cutting gates from #117 on top of RigForge's existing
SHA-pinned actions and commit-verified XMRig build. Scope is only the gaps,
not a redo of that work.

- gitleaks: new Security workflow scans the full git history for committed
  secrets (pool creds, tokens, the #113 stratum access-password) on every push
  and PR, with a matching pre-commit hook. Binary is version+checksum pinned,
  mirroring the shellcheck/shfmt installs.
- Dependabot: .github/dependabot.yml for the github-actions ecosystem only
  (RigForge has no pip/npm/docker deps) — keeps the action pins current and
  surfaces advisories.
- zizmor: audits the workflows for template injection, over-broad GITHUB_TOKEN,
  and credential persistence. Hardened ci.yml/release.yml to a read-only default
  token and persist-credentials: false on checkout so the audit is clean.

The broader pre-commit hook set (shellcheck/shfmt/yamllint/markdownlint +
freebies) is left to #118, which extends .pre-commit-config.yaml.

Validated locally: gitleaks clean over full history, zizmor reports no findings.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Run zizmor with online audits on (its default) so the known-vulnerable-actions
audit cross-references the actions we pin against the GitHub Advisory Database —
a CVE disclosed against a pinned action now fails the gate, not just structural
issues. GH_TOKEN is the built-in read-only token (advisory data is public; it's
only for API access).

Add a weekly schedule so a freshly-published advisory trips against main even
with no open PRs (the online audit is time-varying by design). gitleaks is
skipped on the scheduled tick — history doesn't change between pushes.

Complements Dependabot: zizmor blocks the merge, Dependabot opens the bump.
Validated: zizmor online reports no findings against the current pins.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pithead uses develop as the default integration branch and main as the release
branch; mirror that here (develop is now the repo default).

- ci.yml + security.yml: run on push to [main, develop] (PRs already run on any
  base via the unfiltered pull_request trigger).
- coverage: diff-cover now compares against the PR's actual base branch
  (github.base_ref, falling back to the pushed branch) instead of a hardcoded
  origin/main — so patch coverage stays correct once develop diverges from main.
- CONTRIBUTING: document the two-branch model; PRs target develop.
- RELEASING: build the release commit on develop, fast-forward into main, tag
  from main. develop is merged to main at each release (1.1 onward).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@VijitSingh97 VijitSingh97 changed the base branch from main to develop June 18, 2026 03:06
@VijitSingh97 VijitSingh97 changed the title ci: supply-chain & secrets hardening (gitleaks, Dependabot, zizmor) ci: supply-chain hardening (gitleaks, Dependabot, zizmor) + develop/main branch model Jun 18, 2026
@VijitSingh97 VijitSingh97 merged commit a6c2c5c into develop Jun 18, 2026
14 checks passed
@VijitSingh97 VijitSingh97 deleted the claude/epic-chebyshev-74969b branch June 18, 2026 06:14
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.

tooling: supply-chain & secrets hardening (gitleaks, Dependabot, zizmor)

1 participant