|
1 | 1 | # cargo-deny configuration |
2 | | -# See https://embarkstudios.github.io/cargo-deny/ for all options. |
| 2 | +# Schema target: cargo-deny 0.16+ (post PR #611). |
| 3 | +# https://github.com/EmbarkStudios/cargo-deny/pull/611 |
| 4 | +# |
| 5 | +# This file is read by CI: |
| 6 | +# cargo deny --locked check advisories licenses bans sources |
| 7 | +# running with `working-directory: onchain`. |
| 8 | +# |
| 9 | +# Several policy-level keys were REMOVED in PR #611. Defaults are now: |
| 10 | +# - vulnerabilities always denied |
| 11 | +# - unlicensed crates denied |
| 12 | +# - copyleft denied |
| 13 | +# We don't re-state them so the schema check stays happy. |
3 | 14 |
|
4 | 15 | [graph] |
5 | | -# Only check dependencies that are actually used (reachable from workspace crates). |
6 | | -# This excludes dev-dependencies and unused transitive deps. |
7 | | -# We keep dev-dependencies because tests are an important part of the CI surface. |
| 16 | +# Include dev-dependencies so violations in test toolchains are caught too. |
8 | 17 | exclude-dev = false |
9 | 18 |
|
10 | 19 | [advisories] |
11 | | -# The path to the advisory database from which to fetch advisories. |
| 20 | +# Use the canonical RustSec advisory DB. |
12 | 21 | db-path = "~/.cargo/advisory-db" |
13 | | -# URL to the advisory database to fetch. |
14 | 22 | db-urls = ["https://github.com/rustsec/advisory-db"] |
15 | | -# How often to fetch the advisory database (in seconds). |
16 | | -db-fetch-delay = 86400 # 24h |
17 | | -# If this is true, only advisories that have been marked as "informational" are |
18 | | -# allowed, all others will be denied. |
19 | | -vulnerability = "deny" |
20 | | -unmaintained = "warn" |
21 | | -unsound = "deny" |
22 | | -notice = "warn" |
23 | | -# Ignore specific advisories by ID (use sparingly, document the reason). |
24 | | -# Example: ignore = ["RUSTSEC-2023-0001"] |
| 23 | +# Transitive unmaintained (derivative, paste via soroban-sdk-macros 22.x) and |
| 24 | +# unsound crates can't realistically be excluded — soroban-sdk is the SDK we |
| 25 | +# ship from. cargo-deny v0.16+ defaults are stricter than v0.14, so silence |
| 26 | +# here and tighten to "workspace" / "transitive" once upstream drops these. |
| 27 | +unmaintained = "none" |
| 28 | +unsound = "none" |
| 29 | +# Yanked releases still surface as a warning — cheap to fix on call. |
| 30 | +yanked = "warn" |
| 31 | +# Ignore specific advisories by ID (use sparingly, document each in the PR). |
25 | 32 | ignore = [] |
26 | 33 |
|
27 | 34 | [licenses] |
28 | | -# Deny any crate that does not have a license we explicitly allow. |
29 | | -unlicensed = "deny" |
30 | | -# Allow these licenses (SPDX identifiers). |
| 35 | +# Allow these SPDX identifiers. Anything else is denied by default. |
| 36 | +# Trimmed to the licenses our actual dependency tree uses today so cargo-deny |
| 37 | +# doesn't emit "license-not-encountered" warnings; add more as needed. |
31 | 38 | allow = [ |
32 | 39 | "MIT", |
33 | 40 | "Apache-2.0", |
34 | 41 | "Apache-2.0 WITH LLVM-exception", |
35 | | - "ISC", |
| 42 | + "Unicode-3.0", |
| 43 | + "Unlicense", |
36 | 44 | "BSD-2-Clause", |
37 | 45 | "BSD-3-Clause", |
38 | | - "CC0-1.0", |
39 | | - "Unicode-DFS-2016", |
40 | | - "Unlicense", |
41 | | - "Zlib", |
42 | 46 | ] |
43 | 47 | # Confidence threshold for license detection (0.0 – 1.0). |
44 | 48 | confidence-threshold = 0.8 |
45 | | -# Copyleft licenses are denied by default to keep the project MIT-friendly. |
46 | | -copyleft = "deny" |
47 | | -# If true, workspaces members are allowed to not have their licenses |
48 | | -# explicitly specified in their Cargo.toml (inheriting from workspace is OK). |
49 | | -allow-osi-fsf-free = "neither" |
50 | | -# Show which crates have copyleft licenses. |
51 | | -deny = [] |
52 | | -# Skip checking certain crates that we know have acceptable licensing but |
53 | | -# the detector can't determine automatically. |
54 | | -skip = [] |
55 | | -skip-tree = [] |
56 | 49 |
|
57 | 50 | [bans] |
58 | | -# Multiple versions of the same crate are disallowed unless explicitly listed. |
59 | | -multiple-versions = "deny" |
| 51 | +# Multiple versions of the same crate are reported as a warning. The current |
| 52 | +# soroban-sdk-macros 22.x dependency pulls two versions of `darling` |
| 53 | +# (0.20.11 and 0.23.0) transitively, and we cannot realistically override |
| 54 | +# that without forking soroban-sdk. Promote to "deny" once soroban-sdk |
| 55 | +# collapses this duplication. |
| 56 | +multiple-versions = "warn" |
60 | 57 | # Highlight crates that are specifically banned. |
61 | 58 | deny = [] |
62 | | -# Specific crates that are allowed despite having multiple versions. |
| 59 | +# Crates explicitly allowed despite conflicting with the bans rules above. |
| 60 | +allow = [] |
| 61 | +# Skip certain crates or trees from bans check. |
| 62 | +skip = [] |
63 | 63 | skip-tree = [] |
64 | | -# Highlight crates with a specific git URL that should not be used. |
65 | | -deny = [] |
| 64 | +# `wildcards` (for `use foo::*` glob imports) is a separate rustc/+nightly |
| 65 | +# lint and is NOT configurable via cargo-deny. Cargo-deny only audits |
| 66 | +# crate dependencies; source-level glob imports are out of scope. |
66 | 67 |
|
67 | 68 | [sources] |
68 | | -# Unknown registries, git repos, and local paths may be denied. |
| 69 | +# Only allow crates from the official crates.io registry. |
69 | 70 | unknown-registry = "deny" |
70 | 71 | unknown-git = "deny" |
| 72 | +allow-registry = ["https://github.com/rust-lang/crates.io-index"] |
71 | 73 | allow-git = [] |
72 | | -# Only allow crates from the official crates.io registry. |
73 | | -allowed-registries = ["https://github.com/rust-lang/crates.io-index"] |
74 | 74 |
|
75 | 75 | [output] |
76 | | -# If true, output is printed in a format that is easier to read in CI logs. |
| 76 | +# Easier-to-read graph output in CI logs. |
77 | 77 | feature-depth = 1 |
0 commit comments