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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# This template contains all of the possible sections and their default values
# Note that all fields that take a lint level have these possible values:
# * deny - An error will be produced and the check will fail
# * warn - A warning will be produced, but the check will not fail
# * allow - No warning or error will be produced, though in some cases a note
# will be
# The values provided in this template are the default values that will be used
# when any section or field is not specified in your own configuration
# Root options
# The graph table configures how the dependency graph is constructed and thus
# which crates the checks are performed against
[]
# If 1 or more target triples (and optionally, target_features) are specified,
# only the specified targets will be checked when running `cargo deny check`.
# This means, if a particular package is only ever used as a target specific
# dependency, such as, for example, the `nix` crate only being used via the
# `target_family = "unix"` configuration, that only having windows targets in
# this list would mean the nix crate, as well as any of its exclusive
# dependencies not shared by any other crates, would be ignored, as the target
# list here is effectively saying which targets you are building for.
= [
# The triple can be any string, but only the target triples built in to
# rustc (as of 1.40) can be checked against actual config expressions
#"x86_64-unknown-linux-musl",
# You can also specify which target_features you promise are enabled for a
# particular target. target_features are currently not validated against
# the actual valid features supported by the target architecture.
#{ triple = "wasm32-unknown-unknown", features = ["atomics"] },
]
# When creating the dependency graph used as the source of truth when checks are
# executed, this field can be used to prune crates from the graph, removing them
# from the view of cargo-deny. This is an extremely heavy hammer, as if a crate
# is pruned from the graph, all of its dependencies will also be pruned unless
# they are connected to another crate in the graph that hasn't been pruned,
# so it should be used with care. The identifiers are [Package ID Specifications]
# (https://doc.rust-lang.org/cargo/reference/pkgid-spec.html)
#exclude = []
# If true, metadata will be collected with `--all-features`. Note that this can't
# be toggled off if true, if you want to conditionally enable `--all-features` it
# is recommended to pass `--all-features` on the cmd line instead
= false
# If true, metadata will be collected with `--no-default-features`. The same
# caveat with `all-features` applies
= false
# If set, these feature will be enabled when collecting metadata. If `--features`
# is specified on the cmd line they will take precedence over this option.
#features = []
# The output table provides options for how/if diagnostics are outputted
[]
# When outputting inclusion graphs in diagnostics that include features, this
# option can be used to specify the depth at which feature edges will be added.
# This option is included since the graphs can be quite large and the addition
# of features from the crate(s) to all of the graph roots can be far too verbose.
# This option can be overridden via `--feature-depth` on the cmd line
= 1
[]
# MAXIMUM SECURITY: Zero tolerance for any security advisories
# All vulnerabilities and unsound practices must be addressed immediately
= []
# If this is true, then cargo deny will use the git executable to fetch advisory database.
# If this is false, then it uses a built-in git library.
# Setting this to true can be helpful if you have special authentication requirements that cargo-deny does not support.
# See Git Authentication for more information about setting up git authentication.
#git-fetch-with-cli = true
# This section is considered when running `cargo deny check licenses`
# More documentation for the licenses section can be found here:
# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html
[]
# List of explicitly allowed licenses
# See https://spdx.org/licenses/ for list of possible licenses
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
= [
"MIT",
"Apache-2.0",
"Apache-2.0 WITH LLVM-exception",
"Unicode-3.0",
"BSD-2-Clause",
"BSD-3-Clause",
"ISC",
"MPL-2.0",
"CDLA-Permissive-2.0",
]
# SECURITY: Higher confidence threshold for license detection
# Require exact license matching to prevent license confusion attacks
# [possible values: any between 0.0 and 1.0].
= 0.95
# Allow 1 or more licenses on a per-crate basis, so that particular licenses
# aren't accepted for every possible crate as with the normal allow list
= [
# Each entry is the crate and version constraint, and its specific allow
# list
#{ allow = ["Zlib"], crate = "adler32" },
]
# Some crates don't have (easily) machine readable licensing information,
# adding a clarification entry for it allows you to manually specify the
# licensing information
#[[licenses.clarify]]
# The package spec the clarification applies to
#crate = "ring"
# The SPDX expression for the license requirements of the crate
#expression = "MIT AND ISC AND OpenSSL"
# One or more files in the crate's source used as the "source of truth" for
# the license expression. If the contents match, the clarification will be used
# when running the license check, otherwise the clarification will be ignored
# and the crate will be checked normally, which may produce warnings or errors
# depending on the rest of your configuration
#license-files = [
# Each entry is a crate relative path, and the (opaque) hash of its contents
#{ path = "LICENSE", hash = 0xbd0eed23 }
#]
[]
# If true, ignores workspace crates that aren't published, or are only
# published to private registries.
# To see how to mark a crate as unpublished (to the official registry),
# visit https://doc.rust-lang.org/cargo/reference/manifest.html#the-publish-field.
= false
# One or more private registries that you might publish crates to, if a crate
# is only published to private registries, and ignore is true, the crate will
# not have its license(s) checked
= [
#"https://sekretz.com/registry
]
# This section is considered when running `cargo deny check bans`.
# More documentation about the 'bans' section can be found here:
# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html
[]
# SECURITY CRITICAL: Multiple versions = larger attack surface and potential for version confusion attacks
= "deny"
# Never allow wildcard dependencies for reproducible builds
= "deny"
# The graph highlighting used when creating dotgraphs for crates
# with multiple versions
= "all"
# The default lint level for `default` features for crates that are members of
# the workspace that is being checked.
= "allow"
# The default lint level for `default` features for external crates
= "allow"
# MAXIMUM SECURITY: Comprehensive banned crates and versions
= [
# System TLS libraries - enforce pure Rust crypto
{ = "openssl@0.10", = "Use rustls instead for better security and no system dependencies" },
{ = "native-tls", = "Use rustls-tls feature instead for reproducible builds" },
{ = "security-framework", = "Use rustls instead of macOS system crypto" },
# Vulnerable/problematic versions - STRICT version requirements
{ = "chrono@<0.4.20", = "Contains potential segfault vulnerabilities" },
{ = "regex@<1.5.5", = "Contains ReDoS vulnerabilities" },
{ = "time@<0.3.5", = "Contains segfault vulnerabilities" },
{ = "url@<2.2.2", = "Contains URL parsing vulnerabilities" },
{ = "serde_json@<1.0.85", = "Contains parsing vulnerabilities" },
# Crypto-related security requirements
{ = "ring@<0.16.20", = "Require latest cryptographic implementations" },
{ = "rustls@<0.21.0", = "Enforce modern TLS versions and security" },
# Web security
{ = "hyper@<0.14.18", = "Contains HTTP/2 security issues" },
{ = "reqwest@<0.11.18", = "Contains request smuggling protections" },
]
# List of features to allow/deny
# Each entry the name of a crate and a version range. If version is
# not specified, all versions will be matched.
#[[bans.features]]
#crate = "reqwest"
# Features to not allow
#deny = ["json"]
# Features to allow
#allow = [
# "rustls",
# "__rustls",
# "__tls",
# "hyper-rustls",
# "rustls",
# "rustls-pemfile",
# "rustls-tls-webpki-roots",
# "tokio-rustls",
# "webpki-roots",
#]
# If true, the allowed features must exactly match the enabled feature set. If
# this is set there is no point setting `deny`
#exact = true
# IMPORTANT: We don't skip duplicates for security reasons
# Multiple versions of the same crate can introduce:
# 1. Version confusion attacks (different APIs/behaviors)
# 2. Expanded attack surface (more code to audit)
# 3. Supply chain risks (different maintainers/sources)
# 4. Memory safety issues (different allocator versions)
# 5. Crypto vulnerabilities (different crypto implementations)
#
# Current duplicates should be resolved by:
# - Updating dependencies to use consistent versions
# - Using [patch] sections in Cargo.toml if needed
# - Working with maintainers to update transitive deps
#
# Only skip in extreme cases with documented security analysis
= [
# TEMPORARY: Allow rand ecosystem duplicates during transition
# These are being resolved by ecosystem-wide version bumps
# Risk: Low - both versions are actively maintained and secure
# TODO: Remove once rand 0.9 adoption is complete
{ = "getrandom@0.2", = "Chromiumoxide deps still on older rand ecosystem, low risk as both versions secure" },
{ = "rand@0.8", = "WebSocket deps need older rand, both versions maintained" },
{ = "rand_core@0.6", = "Crypto stack compatibility, both versions actively maintained" },
{ = "rand_chacha@0.3", = "Crypto stack compatibility, both versions actively maintained" },
# Windows-sys version spread - Microsoft maintained, low security risk
# Risk assessment: LOW - All versions are Microsoft maintained with regular security updates
{ = "windows-sys@0.48", = "Legacy compatibility, Microsoft maintained, regular security updates" },
{ = "windows-sys@0.52", = "Legacy compatibility, Microsoft maintained, regular security updates" },
{ = "windows-sys@0.59", = "Legacy compatibility, Microsoft maintained, regular security updates" },
{ = "windows-sys@0.60", = "Legacy compatibility, Microsoft maintained, regular security updates" },
{ = "windows-targets@0.48", = "Microsoft Windows toolchain, consistent maintainer" },
{ = "windows-targets@0.52", = "Microsoft Windows toolchain, consistent maintainer" },
{ = "windows-targets@0.53", = "Microsoft Windows toolchain, consistent maintainer" },
{ = "windows_aarch64_gnullvm@0.48", = "Microsoft Windows toolchain component" },
{ = "windows_aarch64_gnullvm@0.52", = "Microsoft Windows toolchain component" },
{ = "windows_aarch64_gnullvm@0.53", = "Microsoft Windows toolchain component" },
{ = "windows_aarch64_msvc@0.48", = "Microsoft Windows toolchain component" },
{ = "windows_aarch64_msvc@0.52", = "Microsoft Windows toolchain component" },
{ = "windows_aarch64_msvc@0.53", = "Microsoft Windows toolchain component" },
{ = "windows_i686_gnu@0.48", = "Microsoft Windows toolchain component" },
{ = "windows_i686_gnu@0.52", = "Microsoft Windows toolchain component" },
{ = "windows_i686_gnu@0.53", = "Microsoft Windows toolchain component" },
{ = "windows_i686_gnullvm@0.52", = "Microsoft Windows toolchain component" },
{ = "windows_i686_gnullvm@0.53", = "Microsoft Windows toolchain component" },
{ = "windows_i686_msvc@0.48", = "Microsoft Windows toolchain component" },
{ = "windows_i686_msvc@0.52", = "Microsoft Windows toolchain component" },
{ = "windows_i686_msvc@0.53", = "Microsoft Windows toolchain component" },
{ = "windows_x86_64_gnu@0.48", = "Microsoft Windows toolchain component" },
{ = "windows_x86_64_gnu@0.52", = "Microsoft Windows toolchain component" },
{ = "windows_x86_64_gnu@0.53", = "Microsoft Windows toolchain component" },
{ = "windows_x86_64_gnullvm@0.48", = "Microsoft Windows toolchain component" },
{ = "windows_x86_64_gnullvm@0.52", = "Microsoft Windows toolchain component" },
{ = "windows_x86_64_gnullvm@0.53", = "Microsoft Windows toolchain component" },
{ = "windows_x86_64_msvc@0.48", = "Microsoft Windows toolchain component" },
{ = "windows_x86_64_msvc@0.52", = "Microsoft Windows toolchain component" },
{ = "windows_x86_64_msvc@0.53", = "Microsoft Windows toolchain component" },
]
= [
# Skip entire Windows ecosystem trees - all Microsoft maintained
# Risk assessment: Low - consistent maintainer, regular security updates
]
# This section is considered when running `cargo deny check sources`.
# More documentation about the 'sources' section can be found here:
# https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html
[]
# Strict source control for supply chain security
= "deny"
= "deny"
# Only allow crates.io for maximum supply chain security
= ["https://github.com/rust-lang/crates.io-index"]
# No git dependencies allowed in production builds
= []
[]
# No organizational git sources allowed for maximum security
= []
= []
= []