Skip to content

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

Open
jerrysxie wants to merge 1 commit into
OpenDevicePartnership:mainfrom
jerrysxie:add-supply-chain-security
Open

Add cargo-vet and cargo-deny supply-chain security#25
jerrysxie wants to merge 1 commit 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 on lines +37 to +38
- 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 +43 to +49
if: ${{ failure() }} || ${{ success() }}
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR
- uses: actions/upload-artifact@v4
# Need to upload the artifact in both success and failure cases so comment can be updated in either case
if: ${{ failure() }} || ${{ success() }}
pull-requests: write

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Comment on lines +74 to +96
Details about the vetting process can be found in [supply-chain/README.md](../blob/main/supply-chain/README.md)

## If the unvetted dependencies are not needed
Please modify Cargo.toml file to avoid including the dependencies.

## If the unvetted dependencies are needed
Post a new comment with the questionnaire below to the PR to help the auditors vet the dependencies.
After the auditors have vetted the dependencies, the PR will need to be rebased to pick up the new audits and pass this check.

### Copy and paste the questionnaire as a new comment and provide your answers:

**1. What crates (with version) need to be audited?**

**2. How many of the crates are version updates vs new dependencies?**

**3. To confirm none of the already included crates serve your needs, please provide a brief description of the purpose of the new crates.**

**4. Any extra notes to the auditors to help with their audits.**

<!--
This comment is auto-generated by the cargo-vet workflow.
Please do not edit it directly.

Comment thread supply-chain/config.toml
url = "https://raw.githubusercontent.com/google/rust-crate-audits/main/audits.toml"

[imports.mozilla]
url = "https://raw.githubusercontent.com/mozilla/supply-chain/main/audits.toml"
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