Add cargo-vet and cargo-deny supply-chain security#25
Open
jerrysxie wants to merge 6 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces Rust supply-chain security checks by adding cargo-vet configuration (including imported third-party audits) and integrating cargo-deny/cargo-vet into GitHub Actions workflows to continuously validate dependencies in CI.
Changes:
- Add
cargo-vetconfiguration undersupply-chain/and set up audit imports. - Add GitHub Actions workflows to run
cargo veton PRs and post/update PR comments with results. - Integrate
cargo-denyconfiguration and a CI job to check advisories/licenses/bans/sources.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| supply-chain/imports.lock | Initializes cargo-vet import lock structure for upstream audit sources. |
| supply-chain/config.toml | Configures cargo-vet and defines upstream audit import URLs. |
| supply-chain/audits.toml | Adds the local audits file scaffold for cargo-vet. |
| .github/workflows/cargo-vet.yml | Adds CI job to install and run cargo-vet on PRs and upload PR metadata artifact. |
| .github/workflows/cargo-vet-pr-comment.yml | Adds workflow_run-based PR commenting/labeling based on cargo-vet outcomes. |
| deny.toml | Adds cargo-deny policy configuration for dependency checks. |
| .github/workflows/check.yml | Adds/updates CI to run cargo-deny as part of the main check workflow. |
| @@ -0,0 +1,53 @@ | |||
| # This workflow runs whenever a PR is opened or updated. It runs cargo vet to check for unvetted dependencies in the Cargo.lock file. | |||
| permissions: | |||
| contents: read | |||
Comment on lines
+21
to
+38
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: true | ||
|
|
||
| - uses: actions/cache@v4 | ||
| with: | ||
| path: ${{ runner.tool_cache }}/cargo-vet | ||
| key: cargo-vet-bin-${{ env.CARGO_VET_VERSION }} | ||
|
|
||
| - name: Add the tool cache directory to the search path | ||
| run: echo "${{ runner.tool_cache }}/cargo-vet/bin" >> $GITHUB_PATH | ||
|
|
||
| - name: Ensure that the tool cache is populated with the cargo-vet binary | ||
| run: cargo install --root ${{ runner.tool_cache }}/cargo-vet --version ${{ env.CARGO_VET_VERSION }} cargo-vet | ||
|
|
||
| - name: Invoke cargo-vet | ||
| run: cargo vet --locked |
| run: echo "${{ runner.tool_cache }}/cargo-vet/bin" >> $GITHUB_PATH | ||
|
|
||
| - name: Ensure that the tool cache is populated with the cargo-vet binary | ||
| run: cargo install --root ${{ runner.tool_cache }}/cargo-vet --version ${{ env.CARGO_VET_VERSION }} cargo-vet |
Comment on lines
+14
to
+15
| permissions: | ||
| contents: read |
| pull-requests: write | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 2. **Audit new dependencies**: | ||
| - Inspect the `cargo vet` failures using your preferred method | ||
| - Use [gh pr checkout](https://cli.github.com/manual/gh_pr_checkout) to checkout the PR and run `cargo vet --locked` | ||
| - Use [Github Pull Requests for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github) to checkout the PR and run `cargo vet --locked` |
felipebalbi
approved these changes
May 18, 2026
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.
This PR adds supply-chain security tooling based on the
embedded-rust-template:
supply-chain/) – dependency audit tracking with importsfrom ODP shared audits, Google, and Mozilla.
deny.toml) – license, advisory, ban, and source checks.cargo-vet.yml+ PR comment workflow, and thedenyjob incheck.yml.After merging, run
cargo vetlocally to populate exemptions for anyexisting unaudited dependencies: