Skip to content

ci(security): hardening — provenance, scanning, workflow lockdown - #122

Merged
ryanlewis merged 2 commits into
mainfrom
harden-tier1
Aug 8, 2026
Merged

ryanlewis merged 2 commits into
mainfrom
harden-tier1

Conversation

@ryanlewis

@ryanlewis ryanlewis commented Aug 8, 2026 •

Copy link
Copy Markdown
Owner

Implements the free tier of the security hardening checklist. Rebased over #114–#121, which landed some of it in parallel (digest updates, read-only default token, harden-runner egress audit).

Workflow changes

  • Provenance attestation: release tarballs + checksums.txt now get build provenance via actions/attest-build-provenance; verify with gh attestation verify <tarball> -R ryanlewis/things-cli
  • Release environment: goreleaser job runs in the release environment (tag-restricted via deployment branch policy) so release secrets are never exposed to non-tag runs
  • govulncheck, twice by design:
    • exit-code step in check — fails CI and blocks merges on reachable vulnerabilities
    • govulncheck-sarif job — same scan uploaded to the Security tab as code-scanning alerts (SARIF mode never fails the build, hence both); weekly schedule: cron keeps alerts fresh between pushes
  • dependency-review job on PRs
  • zizmor findings fixed: persist-credentials: false everywhere, job-level permissions in pages/release, no Go cache in the release build, env-var indirection for the Jekyll base_path

Also

  • SECURITY.md — private reporting via GitHub advisories + release verification docs

Applied via API alongside this PR (already live)

  • protect-main branch ruleset: PR + green check required, no force-push/deletion
  • protect-release-tags tag ruleset on v* (admin bypass for /release)
  • Tag-restricted release environment, private vulnerability reporting, CodeQL default setup, required SHA pinning for actions

Manual follow-ups (owner only)

  • Move HOMEBREW_TAP_GITHUB_TOKEN into the release environment, delete the repo-level copy
  • Confirm the tap PAT is fine-grained (homebrew-tap, Contents-only, expiry)
  • On next release: verify the tag-ruleset admin bypass and run gh attestation verify on a published artifact

- Pin ruby/setup-ruby to a commit digest (last unpinned action)
- Set persist-credentials: false on all checkouts (zizmor artipacked)
- Move pages/release permissions to job level (zizmor excessive-permissions)
- Disable Go build cache in the release job (zizmor cache-poisoning)
- Route Jekyll base_path through an env var (zizmor template-injection)
- Attest build provenance for release tarballs and checksums.txt
- Run the release job in a 'release' environment (tag-restricted secrets)
- Add govulncheck to CI plus a weekly scheduled run
- Add dependency-review job on pull requests
- Add SECURITY.md with private reporting and release verification docs
Run the same scan twice on purpose: the exit-code step in 'check' gates
merges (SARIF mode never fails the build), while the new govulncheck-sarif
job uploads findings to the Security tab for alert lifecycle and emails —
so the weekly scheduled run surfaces new advisories as alerts instead of
only a failed-run notification.
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@ryanlewis ryanlewis changed the title ci(security): tier-1 hardening — provenance, scanning, workflow lockdown ci(security): hardening — provenance, scanning, workflow lockdown Aug 8, 2026
@ryanlewis
ryanlewis merged commit c04a9f1 into main Aug 8, 2026
7 checks passed
@ryanlewis
ryanlewis deleted the harden-tier1 branch August 8, 2026 20:22
ryanlewis added a commit that referenced this pull request Aug 8, 2026
Closes the loop on the attestations shipped in #122 — the installer now
consumes them.

- `install.sh` runs `gh attestation verify` on the downloaded tarball
when `gh` is available and logged in
- **Failed verification is fatal** (refuses to install;
`SKIP_ATTESTATION=1` to bypass)
- Missing attestation (releases ≤ v0.5.0, which predate #122) warns and
continues
- gh absent or logged out: notes and continues — checksum verification
has already passed by then
- README documents the automatic check and the manual `gh attestation
verify` command

Tested against the live v0.5.0 release: warn-and-install path, skip
path, and shellcheck-clean. The fatal path will be exercised for real
once v0.5.1 ships with attestations.
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.

2 participants