Skip to content

Add cargo-vet and cargo-deny supply-chain security#25

Open
jerrysxie wants to merge 6 commits into
OpenDevicePartnership:mainfrom
jerrysxie:add-supply-chain-security
Open

Add cargo-vet and cargo-deny supply-chain security#25
jerrysxie wants to merge 6 commits into
OpenDevicePartnership:mainfrom
jerrysxie:add-supply-chain-security

Conversation

@jerrysxie
Copy link
Copy Markdown
Contributor

This PR adds supply-chain security tooling based on the
embedded-rust-template:

  • cargo-vet (supply-chain/) – dependency audit tracking with imports
    from ODP shared audits, Google, and Mozilla.
  • cargo-deny (deny.toml) – license, advisory, ban, and source checks.
  • CI workflowscargo-vet.yml + PR comment workflow, and the
    deny job in check.yml.

After merging, run cargo vet locally to populate exemptions for any
existing unaudited dependencies:

cargo vet regenerate exemptions
cargo vet

Copilot AI review requested due to automatic review settings May 12, 2026 20:24
@jerrysxie jerrysxie requested a review from a team as a code owner May 12, 2026 20:24
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-vet configuration under supply-chain/ and set up audit imports.
  • Add GitHub Actions workflows to run cargo vet on PRs and post/update PR comments with results.
  • Integrate cargo-deny configuration 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.

Comment thread .github/workflows/cargo-vet.yml
Comment thread .github/workflows/cargo-vet.yml
Comment thread .github/workflows/cargo-vet.yml
Comment thread .github/workflows/cargo-vet-pr-comment.yml
Comment thread .github/workflows/cargo-vet-pr-comment.yml
Comment thread supply-chain/config.toml
Copilot AI review requested due to automatic review settings May 17, 2026 23:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 6 comments.

@@ -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 }}
Comment thread supply-chain/README.md
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`
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.

3 participants