Skip to content

Harden CI/CD supply chain and use crates.io trusted publishing - #21

Merged
ririsoft merged 1 commit into
masterfrom
harden-release-pipeline
Sep 28, 2026
Merged

ririsoft merged 1 commit into
masterfrom
harden-release-pipeline

Conversation

@ririsoft

Copy link
Copy Markdown
Owner

Summary

Hardens the release pipeline against supply-chain attacks.

release.yml

  • Jobs: verify (cargo publish --dry-run) → create-release → publish-release, so a package that fails verification no longer leaves a dangling GitHub release.
  • permissions: {} at workflow level; contents: write only on create-release.
  • publish-release runs in the protected release environment (required reviewer, v[0-9]* tags only) and authenticates with crates.io trusted publishing (OIDC) via rust-lang/crates-io-auth-action, replacing the long-lived CARGO_REGISTRY_TOKEN secret.

rust.yml

  • permissions: contents: read.
  • cargo install cargo-llvm-cov --locked --version 0.9.1.
  • New workflow-lint job running actionlint (checksum-verified binary) and zizmor.

All workflows

  • Every action upgraded to its latest release and pinned to a full commit SHA.
  • persist-credentials: false on checkout.

Dependabot

  • .github/dependabot.yml for github-actions and cargo, security updates only (open-pull-requests-limit: 0), 7-day cooldown.

Validation

  • actionlint and zizmor pass locally.
  • The trusted-publishing path will be exercised end-to-end at the next real release (gated by environment approval).

Follow-up (manual)

  • Enable Dependabot security updates in repository settings.
  • After the next successful release, delete the CARGO_REGISTRY_TOKEN secret and revoke the token on crates.io.

- pin all GitHub Actions to commit SHAs (upgraded to latest releases)
- least-privilege workflow permissions, persist-credentials: false
- publish via crates.io trusted publishing from the protected release environment
- run publish dry-run before creating the GitHub release
- install cargo-llvm-cov with --locked and a pinned version
- add actionlint and zizmor workflow linting to CI
- enable Dependabot security updates only, with a 7-day cooldown
@ririsoft
ririsoft merged commit 034b50d into master Sep 28, 2026
3 checks passed
@ririsoft
ririsoft deleted the harden-release-pipeline branch September 28, 2026 16:00
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.

1 participant