1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# cargo-deny configuration for supply chain security hardening.
# Docs: https://embarkstudios.github.io/cargo-deny/index.html
#
# MSRV: 1.80 — keep config compatible with cargo-deny 0.16+
[]
# Target platforms we build for. Cargo-deny resolves dependencies
# against these targets so we do not flag platform-specific crates
# (e.g. winapi) on unrelated platforms.
= [
{ = "x86_64-unknown-linux-gnu" },
{ = "aarch64-unknown-linux-gnu" },
{ = "x86_64-apple-darwin" },
{ = "aarch64-apple-darwin" },
]
[]
# Use the v2 advisory format (cargo-deny 0.16+).
= 2
# Path to the cached RustSec advisory database.
# Caching locally avoids repeated network fetches in CI and keeps
# builds reproducible when the remote DB is unreachable.
= "~/.cargo/advisory-db"
# Flag yanked crates as warnings. Yanked crates may contain critical
# fixes; we warn so authors can evaluate and upgrade.
= "warn"
[]
# Use the v2 license format (cargo-deny 0.16+).
= 2
# Explicit allow-list for dependency licenses.
# Only OSI-approved licenses that are widely vetted are permitted.
= [
"MIT",
"Apache-2.0",
"Unicode-3.0",
]
# NOTE: `allow-osi-fsf-free = "both"` was removed in cargo-deny 0.19
# (see embarkstudios/cargo-deny#611). Explicit license enumeration
# above provides the same strict compliance guarantees.
# Minimum confidence threshold for SPDX license expression detection.
# A value of 0.8 suppresses false positives from vague crate metadata
# (e.g. "MIT OR Apache-2.0" guessed from a one-line README).
= 0.8
[]
# Warn when multiple versions of the same crate appear in the graph.
# Duplicate versions bloat compile times and can introduce subtle
# behavioural differences if the APIs diverge.
= "warn"
# NOTE: `duplicate-warnings = true` is not a valid cargo-deny key.
# `multiple-versions = "warn"` already emits a warning for every
# duplicate crate. `highlight = "all"` below ensures full paths are
# printed for each occurrence.
# Allow wildcard dependencies (e.g. "*") only in unpublished crates.
# Wildcards make builds non-reproducible; we allow them in examples
# and internal tools but not in the library itself.
= "allow"
# Highlight all affected crate paths in diagnostic output.
# Makes it easier to trace which dependency edge pulled in a banned
# or duplicated crate.
= "all"
[]
# Restrict crate downloads to the official crates.io registry.
# Prevents accidental or malicious substitution via private registries.
= ["https://github.com/rust-lang/crates.io-index"]
# Restrict git dependencies to the author's own GitHub namespace.
# Any external git source must be explicitly added here after review.
= []
# Warn when a dependency is pulled from an unknown registry.
# Acts as a safety net in case allow-registry is ever misconfigured.
= "warn"
# Warn when a dependency is pulled from an unknown git repository.
# Complements allow-git by catching typos or unvetted git sources.
= "warn"