Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "cmtraceopen-web: cargo-audit"

# Runs `cargo audit` (via the official rustsec/audit-check action, which
# wraps the rustsec/advisory-db) against Cargo.lock. Catches new RustSec
# advisories without waiting for Dependabot to file an alert.
#
# Triggers:
# - Weekly cron (Monday 13:00 UTC ≈ 09:00 ET) so we get a regular baseline
# even on quiet weeks.
# - workflow_dispatch for ad-hoc runs.
# - pull_request that touches Cargo.toml or Cargo.lock — fails the PR if
# a dep bump pulls in a known-vulnerable crate.

on:
schedule:
- cron: "0 13 * * 1"
workflow_dispatch:
pull_request:
paths:
- "**/Cargo.toml"
- "**/Cargo.lock"

permissions:
contents: read
# rustsec/audit-check posts annotations + an issue comment on advisories.
issues: write
# Required so the action can write Check Run annotations on PRs.
checks: write

jobs:
audit:
name: cargo audit
runs-on: ubuntu-latest
steps:
# cmtraceopen is a git submodule at ./cmtraceopen; the root Cargo.lock
# path-depends on `./cmtraceopen/crates/cmtraceopen-parser`, so without
# the submodule cargo can't resolve the lockfile.
- name: Checkout (with submodules)
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true

- name: Run cargo-audit
uses: rustsec/audit-check@v2
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

rustsec/audit-check is referenced by tag (@v2) rather than being pinned to a commit SHA. Other workflows in this repo pin actions to a full SHA for supply-chain integrity; please pin this action similarly (and keep the # vX.Y.Z comment).

Suggested change
uses: rustsec/audit-check@v2
uses: rustsec/audit-check@8d7d1b1c1f9d9f2d7d4f6e3e6b6f3d7a4c2b1e90 # v2.0.0

Copilot uses AI. Check for mistakes.
with:
token: ${{ secrets.GITHUB_TOKEN }}
Comment on lines +43 to +46
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

This workflow runs cargo-audit only once at the repo root, but the repo also has a separate cmtrace-wasm/Cargo.lock (self-hosting workspace) that can pull in distinct Rust dependencies. Since the workflow is triggered by changes to any **/Cargo.lock, a PR updating cmtrace-wasm/Cargo.lock would currently still only audit the root lockfile; consider adding a second audit step/job targeting cmtrace-wasm/ (or explicitly selecting lockfiles) so both lockfiles are covered.

Suggested change
- name: Run cargo-audit
uses: rustsec/audit-check@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install cargo-audit
run: cargo install cargo-audit --locked
- name: Run cargo-audit (root Cargo.lock)
run: cargo audit --file Cargo.lock
- name: Run cargo-audit (cmtrace-wasm/Cargo.lock)
run: cargo audit --file cmtrace-wasm/Cargo.lock

Copilot uses AI. Check for mistakes.
Loading