ci: supply-chain hardening (gitleaks, Dependabot, zizmor) + develop/main branch model#120
Merged
Merged
Conversation
…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>
This was referenced Jun 18, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #117. Part of the tooling epic #116; the broader pre-commit hook set is left to #118.
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
.github/workflows/security.ymlgitleaksjob 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.8.30.1, sha256 verified), mirroring the existing shellcheck/shfmt install pattern — reproducible, no runner-image drift, noaptmirror flakiness..pre-commit-config.yamlhook pinned to the same gitleaks version so a leak is caught locally before it's ever pushed (local == CI).2. Dependabot
.github/dependabot.ymlfor thegithub-actionsecosystem only — RigForge is pure shell, so there's nopip/npm/dockerecosystem 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
security.ymlzizmorjob static-audits the workflows (template injection, over-broadGITHUB_TOKEN, unpinned actions, credential persistence). Pinned to1.25.2viapipx.GH_TOKENlets theknown-vulnerable-actionsaudit 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.ci.yml: top-level least-privilegepermissions: contents: read.ci.yml+release.yml:persist-credentials: falseon everyactions/checkout.Branch model (mirrors Pithead)
developis now the default/integration branch;mainis the release branch.developmerges tomainat each release (1.1 onward), and tags are cut frommain.ci.yml+security.ymlrun onpush: [main, develop]; the coverage gate now diffs against the PR's actual base branch (github.base_ref) instead of a hardcodedorigin/main, so patch coverage stays correct oncedevelopdiverges.CONTRIBUTING.md/RELEASING.mddocument the model and the release promotion flow.Acceptance (#117)
.github/dependabot.yml(github-actions) liveValidation
no leaks foundover full history (168 commits) and the working tree.No findings to report(exit 0) across all three workflows, offline and online, after the hardening (baseline was 12 findings: 6artipacked, 6excessive-permissions).Scope notes
.editorconfigare tooling: DX glue + config/docs lint (.editorconfig, pre-commit, yamllint, markdownlint + lychee) #118's deliverable; this PR only seeds.pre-commit-config.yamlwith the gitleaks hook so tooling: DX glue + config/docs lint (.editorconfig, pre-commit, yamllint, markdownlint + lychee) #118 extends it cleanly.🤖 Generated with Claude Code