Repository navigation
Harden CI/CD supply chain and use crates.io trusted publishing - #21
Merged
Merged
Conversation
- 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
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.
Summary
Hardens the release pipeline against supply-chain attacks.
release.yml
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: writeonly oncreate-release.publish-releaseruns in the protectedreleaseenvironment (required reviewer,v[0-9]*tags only) and authenticates with crates.io trusted publishing (OIDC) viarust-lang/crates-io-auth-action, replacing the long-livedCARGO_REGISTRY_TOKENsecret.rust.yml
permissions: contents: read.cargo install cargo-llvm-cov --locked --version 0.9.1.workflow-lintjob running actionlint (checksum-verified binary) and zizmor.All workflows
persist-credentials: falseon checkout.Dependabot
.github/dependabot.ymlforgithub-actionsandcargo, security updates only (open-pull-requests-limit: 0), 7-day cooldown.Validation
Follow-up (manual)
CARGO_REGISTRY_TOKENsecret and revoke the token on crates.io.