Skip to content

Commit 4aa70cf

Browse files
committed
ci(cargo-deny): add dependency audit with cargo-deny
Add cargo-deny to check dependencies for vulnerabilities, license violations, and banned crates. Runs as a step in branch-checks for PRs and as a separate scheduled workflow for daily advisory scanning. Signed-off-by: Ignas Baranauskas <ibaranau@redhat.com>
1 parent f48b05e commit 4aa70cf

6 files changed

Lines changed: 125 additions & 12 deletions

File tree

.github/workflows/branch-checks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ jobs:
130130
- name: Verify system CA roots build mode compiles and excludes bundled Mozilla roots
131131
run: mise run rust:verify:system-ca-roots
132132

133+
- name: Check dependencies
134+
run: mise run rust:deny
135+
133136
- name: sccache stats
134137
if: always()
135138
run: |

.github/workflows/cargo-deny.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Cargo Deny (scheduled)
5+
6+
on:
7+
schedule:
8+
- cron: "23 7 * * *"
9+
workflow_dispatch:
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
15+
permissions:
16+
contents: read
17+
packages: read
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
cargo-deny:
25+
name: Cargo Deny
26+
runs-on: linux-amd64-cpu8
27+
container:
28+
image: ghcr.io/nvidia/openshell/ci:latest
29+
credentials:
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
steps:
33+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
34+
35+
- name: Install tools
36+
run: mise install --locked
37+
38+
- name: Check dependencies
39+
run: mise run rust:deny

deny.toml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# cargo-deny configuration
5+
# https://embarkstudios.github.io/cargo-deny/
6+
7+
[graph]
8+
all-features = false
9+
no-default-features = false
10+
11+
# -- Advisories (RustSec + NVD) ------------------------------------------------
12+
[advisories]
13+
yanked = "warn"
14+
unmaintained = "workspace"
15+
maximum-db-staleness = "P30D"
16+
ignore = [
17+
# Pre-existing advisories acknowledged at onboarding. Each should be
18+
# resolved by upgrading the affected transitive dependency and then
19+
# removing the ignore entry.
20+
{ id = "RUSTSEC-2026-0190", reason = "anyhow unsoundness in downcast_mut — awaiting upstream fix" },
21+
{ id = "RUSTSEC-2026-0204", reason = "crossbeam-epoch pointer deref — transitive via metrics/quanta" },
22+
{ id = "RUSTSEC-2023-0071", reason = "rsa Marvin attack — transitive via spiffe, no direct exposure" },
23+
{ id = "RUSTSEC-2025-0134", reason = "rustls-pemfile unmaintained — transitive via older kube/hyper" },
24+
{ id = "RUSTSEC-2026-0098", reason = "rustls-webpki URI name constraints — transitive via older rustls" },
25+
{ id = "RUSTSEC-2026-0099", reason = "rustls-webpki wildcard name constraints — transitive via older rustls" },
26+
{ id = "RUSTSEC-2026-0104", reason = "rustls-webpki CRL parsing panic — transitive via older rustls" },
27+
{ id = "RUSTSEC-2025-0068", reason = "serde_yml unsound+unmaintained — direct dep, no maintained alternative yet" },
28+
]
29+
30+
# -- Licenses ------------------------------------------------------------------
31+
[licenses]
32+
confidence-threshold = 0.8
33+
unused-allowed-license = "allow"
34+
35+
allow = [
36+
"Apache-2.0",
37+
"Apache-2.0 WITH LLVM-exception",
38+
"MIT",
39+
"MIT-0",
40+
"BSD-1-Clause",
41+
"BSD-2-Clause",
42+
"BSD-3-Clause",
43+
"BSL-1.0",
44+
"ISC",
45+
"Zlib",
46+
"0BSD",
47+
"CC0-1.0",
48+
"Unlicense",
49+
"Unicode-3.0",
50+
"CDLA-Permissive-2.0",
51+
]
52+
53+
[licenses.private]
54+
ignore = true
55+
registries = []
56+
57+
# -- Bans ----------------------------------------------------------------------
58+
[bans]
59+
multiple-versions = "warn"
60+
wildcards = "allow"
61+
highlight = "all"
62+
workspace-default-features = "allow"
63+
external-default-features = "allow"
64+
65+
# -- Sources -------------------------------------------------------------------
66+
[sources]
67+
unknown-registry = "deny"
68+
unknown-git = "deny"
69+
allow-registry = ["https://github.com/rust-lang/crates.io-index"]
70+
allow-git = []

mise.lock

Lines changed: 7 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mise.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ skaffold = "2.20.0"
4040
k3d = { version = "5.8.3", os = ["macos"] }
4141
"github:anchore/syft" = { version = "1.44.0" }
4242
"github:EmbarkStudios/cargo-about" = { version = "0.8.4", version_prefix = "" }
43+
"cargo:cargo-deny" = "0.20"
4344
zig = "0.14.1"
4445
"github:rust-cross/cargo-zigbuild" = "0.22.3"
4546
"npm:markdownlint-cli2" = "0.22.0"

tasks/rust.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ run = [
3232
]
3333
hide = true
3434

35+
["rust:deny"]
36+
description = "Check dependencies for vulnerabilities, license violations, and bans"
37+
run = "cargo deny check"
38+
hide = true
39+
3540
["rust:verify:telemetry-off"]
3641
description = "Verify telemetry emission code is compiled out with --no-default-features"
3742
run = [

0 commit comments

Comments
 (0)