Skip to main content

max / makenotwork

7.2 KB · 148 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, s3-storage and tagtree carry `license = "MIT"`, per the licensing
11 # strategy (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-2025-0134", # rustls-pemfile unmaintained, via AWS SDK TLS.
23 # RUSTSEC-2024-0436 (paste) was dropped 2026-08-19: the dependency trim in
24 # 2a53c900 took the last path to it and `paste` is no longer in Cargo.lock.
25 #
26 # RUSTSEC-2026-0173 (proc-macro-error2) is deliberately NOT mirrored here,
27 # which is the one place this file and `.cargo/audit.toml` diverge. The crate
28 # IS still in the graph, so the ignore stays load-bearing over there; it is
29 # `informational = "unmaintained"`, which `[advisories] version = 2` does not
30 # report for a transitive crate, so mirroring it only bought a permanent
31 # `advisory-not-detected` warning on every run.
32 #
33 # Two wasmtime advisories, both via yara-x 1.19.0, which declares
34 # wasmtime "43.0.2" with default-features = false and only the cranelift and
35 # runtime features. The fixes skip the 43 line, so neither is reachable by
36 # bumping anything we control.
37 #
38 # RUSTSEC-2026-0222 (3.8 low): needs two wasmtime Engines and production
39 # builds exactly one (scanning/mod.rs:505).
40 #
41 # RUSTSEC-2026-0269 (8.8 high): a WASI filesystem sandbox escape. WASI is
42 # not compiled here at all; wasmtime-wasi, wasi-common and the cap-std
43 # family are absent from Cargo.lock, so there is no sandbox to escape.
44 #
45 # Full rationale and the conditions that would invalidate each:
46 # .cargo/audit.toml.
47 "RUSTSEC-2026-0222",
48 "RUSTSEC-2026-0269",
49 ]
50
51 [bans]
52 # Duplicate versions are the supply-chain smell the audits track (x509/crypto
53 # cluster, rustls 0.21/0.23 dual stack via the AWS SDK). Surface them as
54 # warnings rather than failing the build: they are transitive and not yet
55 # de-duplicable: so a *new* duplicate is visible in CI output without blocking
56 # a deploy. Promote to "deny" with a `skip` list once the tree is de-duped.
57 multiple-versions = "warn"
58 wildcards = "deny" # a `*` version requirement on any dependency fails the build
59 allow-wildcard-paths = true # ...except first-party path deps, which legitimately use path, not version
60 highlight = "all"
61
62 # The C crypto backends, banned by name. Two comments in Cargo.toml (on
63 # webauthn-rs and on async-stripe) already said cargo-deny banned openssl-sys;
64 # until now it did not, and nothing here could see the server sitting on
65 # aws-lc-rs while the rest of the tree moved to ring. These are the `-sys`
66 # crates rather than their wrappers because the wrapper is reachable as a
67 # no-op feature, and it is the C toolchain that is the cost: it lands on the
68 # build path for every architecture built natively (fw13, astra, mbp,
69 # windows-x86) and it is what stops miri from ever reaching a verdict.
70 #
71 # The standing choice is the most-Rust backend available: rust_crypto > ring >
72 # aws-lc-rs. If a transitive dep drags one of these back in, that is a real
73 # finding and the fix is a feature selection, not an entry in this list.
74 deny = [
75 { name = "openssl-sys" },
76 { name = "aws-lc-sys" },
77 ]
78
79 [sources]
80 unknown-registry = "deny" # no crate may come from a registry other than the allow-list below
81 unknown-git = "deny" # no crate may come from an unsanctioned git remote
82 allow-registry = ["https://github.com/rust-lang/crates.io-index"]
83 # Our own forge. docengine is consumed as a git dep on purpose (Cargo.toml:122)
84 # so a container build can take it without the repo checked out beside this one;
85 # multithreaded and GoingsOn keep path deps to the same crate.
86 #
87 # This is invisible on a dev box: ~/Code/.cargo/config.toml patches this URL (and
88 # three more makenot.work git deps) to local checkouts, so `cargo deny` run from
89 # ~/Code sees a path dependency and reports sources ok. The Sando worktree lives
90 # under /srv/sando and inherits no such patch, which is why the gate is the thing
91 # that sees the real dependency graph. When these disagree, the gate is right.
92 allow-git = [
93 "https://makenot.work/git/max/docengine.git",
94 # The description layer. Four crates out of one repo (quasi-router,
95 # quasi-http, quasi-axum, quasi-webview), taken as git deps for the same
96 # reason docengine is. Public on our forge since 2026-08-08.
97 #
98 # Missing here since the G1 spike added the deps, and invisible until now
99 # for exactly the reason the paragraph above gives: no Sando build had run
100 # in between, and a dev box's `cargo deny` sees the patched path deps. The
101 # gate caught it on the first build that carried them, which is the gate
102 # working.
103 "https://makenot.work/git/max/quasi.git",
104 # The house font pipeline, rev-pinned (Cargo.toml:261). Caught on
105 # 2026-08-19 by the same mechanism and for the same reason as the quasi
106 # entry above: the dep was added, no Sando build ran while it was there,
107 # and every dev box read it as a path dep through the ~/Code patch.
108 "https://makenot.work/git/max/quasi-type.git",
109 ]
110
111 [licenses]
112 version = 2
113 # Every license family present in the tree today. All permissive/weak-copyleft;
114 # `r-efi`'s LGPL-2.1-or-later is satisfied by its MIT/Apache OR-clause.
115 allow = [
116 "MIT",
117 "MIT-0",
118 "Apache-2.0",
119 "BSD-1-Clause",
120 "BSD-2-Clause",
121 "BSD-3-Clause",
122 "0BSD",
123 "ISC",
124 "BSL-1.0",
125 "Zlib",
126 "MPL-2.0",
127 "CC0-1.0",
128 "Unlicense",
129 "Unicode-3.0",
130 "CDLA-Permissive-2.0",
131 "BlueOak-1.0.0",
132 "bzip2-1.0.6",
133 # cranelift, via yara-x. Apache-2.0 with the LLVM linking exception:
134 # more permissive than bare Apache-2.0, no copyleft obligation.
135 "Apache-2.0 WITH LLVM-exception",
136 ]
137 confidence-threshold = 0.9
138 # First-party product crates carry the product license; allow it for exactly
139 # these, not tree-wide.
140 # The identifier must carry the `LicenseRef-` prefix, because PolyForm is not on
141 # the SPDX list and `license = "PolyForm-Noncommercial-1.0.0"` is not a valid
142 # expression. These exceptions were written without it and so matched nothing —
143 # cargo-deny reported both as `license-exception-not-encountered` while
144 # simultaneously rejecting the crates they were meant to cover.
145 exceptions = [
146 { name = "makenotwork", allow = ["LicenseRef-PolyForm-Noncommercial-1.0.0"] },
147 ]
148