Skip to main content

max / makenotwork

5.5 KB · 114 lines History Blame Raw
1 # cargo-deny configuration: supply-chain gate for the MNW server.
2 #
3 # Run by Sando's `cargo_deny` gate as `cargo deny check` (all four checks).
4 # This complements `cargo audit`: `bans` surfaces duplicate-version clusters
5 # (the x509/crypto and rustls dual stacks the audits flag), and `sources` fails
6 # the build if any dependency is pulled from a registry or git remote we did not
7 # sanction.
8 #
9 # `licenses` is now part of the gate. The cleanup it was waiting on has landed:
10 # docengine and s3-storage carry `license = "MIT"`, per the licensing strategy
11 # (reusable infra is MIT, products are PolyForm-Noncommercial).
12
13 [advisories]
14 version = 2
15 # Mirror of `.cargo/audit.toml`: every entry is a transitive advisory we cannot
16 # resolve by bumping our own direct deps, kept in sync with the cargo-audit
17 # posture. Directly-fixable advisories are fixed in Cargo.toml, never parked here.
18 ignore = [
19 "RUSTSEC-2023-0071", # rsa Marvin timing side-channel, only via signature *verification* crates; we never decrypt with rsa.
20 "RUSTSEC-2025-0141", # bincode unmaintained, transitive tooling, no code change available.
21 "RUSTSEC-2020-0095", # difference unmaintained, via a dev/test dep.
22 "RUSTSEC-2024-0436", # paste unmaintained, via proc-macro deps.
23 "RUSTSEC-2025-0134", # rustls-pemfile unmaintained, via AWS SDK TLS.
24 "RUSTSEC-2026-0173", # proc-macro-error2 unmaintained, via a macro dep. Was in .cargo/audit.toml but never mirrored here.
25 # wasmtime "Stores can mix up type indices between engines" (3.8 low), via
26 # yara-x 1.19.0, which pins the 43 line while the fixes skip it. Not
27 # applicable: the bug needs two wasmtime Engines and production builds
28 # exactly one (scanning/mod.rs:499). Full rationale + the condition that
29 # would invalidate it: .cargo/audit.toml.
30 "RUSTSEC-2026-0222",
31 ]
32
33 [bans]
34 # Duplicate versions are the supply-chain smell the audits track (x509/crypto
35 # cluster, rustls 0.21/0.23 dual stack via the AWS SDK). Surface them as
36 # warnings rather than failing the build: they are transitive and not yet
37 # de-duplicable: so a *new* duplicate is visible in CI output without blocking
38 # a deploy. Promote to "deny" with a `skip` list once the tree is de-duped.
39 multiple-versions = "warn"
40 wildcards = "deny" # a `*` version requirement on any dependency fails the build
41 allow-wildcard-paths = true # ...except first-party path deps, which legitimately use path, not version
42 highlight = "all"
43
44 # The C crypto backends, banned by name. Two comments in Cargo.toml (on
45 # webauthn-rs and on async-stripe) already said cargo-deny banned openssl-sys;
46 # until now it did not, and nothing here could see the server sitting on
47 # aws-lc-rs while the rest of the tree moved to ring. These are the `-sys`
48 # crates rather than their wrappers because the wrapper is reachable as a
49 # no-op feature, and it is the C toolchain that is the cost: it lands on the
50 # build path for every architecture built natively (fw13, astra, mbp,
51 # windows-x86) and it is what stops miri from ever reaching a verdict.
52 #
53 # The standing choice is the most-Rust backend available: rust_crypto > ring >
54 # aws-lc-rs. If a transitive dep drags one of these back in, that is a real
55 # finding and the fix is a feature selection, not an entry in this list.
56 deny = [
57 { name = "openssl-sys" },
58 { name = "aws-lc-sys" },
59 ]
60
61 [sources]
62 unknown-registry = "deny" # no crate may come from a registry other than the allow-list below
63 unknown-git = "deny" # no crate may come from an unsanctioned git remote
64 allow-registry = ["https://github.com/rust-lang/crates.io-index"]
65 # Our own forge. docengine is consumed as a git dep on purpose (Cargo.toml:122)
66 # so a container build can take it without the repo checked out beside this one;
67 # multithreaded and GoingsOn keep path deps to the same crate.
68 #
69 # This is invisible on a dev box: ~/Code/.cargo/config.toml patches this URL (and
70 # three more makenot.work git deps) to local checkouts, so `cargo deny` run from
71 # ~/Code sees a path dependency and reports sources ok. The Sando worktree lives
72 # under /srv/sando and inherits no such patch, which is why the gate is the thing
73 # that sees the real dependency graph. When these disagree, the gate is right.
74 allow-git = ["https://makenot.work/git/max/docengine.git"]
75
76 [licenses]
77 version = 2
78 # Every license family present in the tree today. All permissive/weak-copyleft;
79 # `r-efi`'s LGPL-2.1-or-later is satisfied by its MIT/Apache OR-clause.
80 allow = [
81 "MIT",
82 "MIT-0",
83 "Apache-2.0",
84 "BSD-1-Clause",
85 "BSD-2-Clause",
86 "BSD-3-Clause",
87 "0BSD",
88 "ISC",
89 "BSL-1.0",
90 "Zlib",
91 "MPL-2.0",
92 "CC0-1.0",
93 "Unlicense",
94 "Unicode-3.0",
95 "CDLA-Permissive-2.0",
96 "BlueOak-1.0.0",
97 "bzip2-1.0.6",
98 # cranelift, via yara-x. Apache-2.0 with the LLVM linking exception:
99 # more permissive than bare Apache-2.0, no copyleft obligation.
100 "Apache-2.0 WITH LLVM-exception",
101 ]
102 confidence-threshold = 0.9
103 # First-party product crates carry the product license; allow it for exactly
104 # these, not tree-wide.
105 # The identifier must carry the `LicenseRef-` prefix, because PolyForm is not on
106 # the SPDX list and `license = "PolyForm-Noncommercial-1.0.0"` is not a valid
107 # expression. These exceptions were written without it and so matched nothing —
108 # cargo-deny reported both as `license-exception-not-encountered` while
109 # simultaneously rejecting the crates they were meant to cover.
110 exceptions = [
111 { name = "makenotwork", allow = ["LicenseRef-PolyForm-Noncommercial-1.0.0"] },
112 { name = "tagtree", allow = ["LicenseRef-PolyForm-Noncommercial-1.0.0"] },
113 ]
114