Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / deny.toml
deny.toml141 lines · 6.1 KiBRaw
| 1 | # cargo-deny configuration - automated dependency monitoring (SUPPLY_CHAIN_RISKS.md 6.6). |
| 2 | # |
| 3 | # Run locally with: |
| 4 | # cargo deny --config deny.toml check advisories bans licenses sources |
| 5 | # |
| 6 | # This file is the single config for the repo-root Cargo workspace (the one |
| 7 | # tracked Cargo.lock and monitored workspace root — see |
| 8 | # .github/workflows/cargo-deny.yml). CI passes it explicitly with --config |
| 9 | # rather than relying on a deny.toml sitting next to each manifest. |
| 10 | # `personal/uniflix` is a detached workspace of its own with a gitignored |
| 11 | # lockfile and is intentionally not monitored here. |
| 12 | |
| 13 | [graph] |
| 14 | # Everything shipped in an APK is built for aarch64-linux-android; the |
| 15 | # scripts/maps/* tools are host-side. Left unrestricted on purpose so an |
| 16 | # advisory in a host-only or Windows-only dependency is still reported. |
| 17 | all-features = false |
| 18 | |
| 19 | [output] |
| 20 | feature-depth = 1 |
| 21 | |
| 22 | # --------------------------------------------------------------------------- |
| 23 | # Advisories |
| 24 | # --------------------------------------------------------------------------- |
| 25 | # No advisories are pre-ignored. If a finding turns out to be a false positive |
| 26 | # or genuinely unreachable, add the real RUSTSEC id here with a one-line reason |
| 27 | # and a link to the task - do not add speculative entries. |
| 28 | [advisories] |
| 29 | version = 2 |
| 30 | db-urls = ["https://github.com/rustsec/advisory-db"] |
| 31 | ignore = [] |
| 32 | # A yanked crate is worth knowing about but is not itself a vulnerability, and |
| 33 | # upstream yanks land without warning, so this must not break an unrelated PR. |
| 34 | yanked = "warn" |
| 35 | |
| 36 | # --------------------------------------------------------------------------- |
| 37 | # Licenses |
| 38 | # --------------------------------------------------------------------------- |
| 39 | # This is the minimal list that satisfies every third-party crate in the |
| 40 | # committed lockfiles - nothing here is speculative and nothing is unused. |
| 41 | # |
| 42 | # Derived by resolving `cargo metadata --offline` for all nine workspace roots |
| 43 | # (516 third-party package instances, 29 distinct SPDX expressions, zero crates |
| 44 | # without a license field) and reducing to the smallest set that satisfies |
| 45 | # every expression. `cargo metadata` reports the whole lockfile across all |
| 46 | # target platforms, so this is not host-specific. |
| 47 | # |
| 48 | # Most entries are carried by an OR expression and need no comment. These are |
| 49 | # the ones that are actually load-bearing, i.e. the only crate(s) forcing them: |
| 50 | # IJG jpeg-encoder "(MIT OR Apache-2.0) AND IJG" |
| 51 | # Unicode-3.0 the 18 icu_*/zerovec crates, plus unicode-ident via AND |
| 52 | # BSD-3-Clause curve25519-dalek, ed25519-dalek, x25519-dalek, subtle, |
| 53 | # alloc-no-stdlib, alloc-stdlib; also encoding_rs and brotli |
| 54 | # via AND |
| 55 | # BSD-2-Clause arrayref, openjp2 |
| 56 | # ISC libloading |
| 57 | # Zlib foldhash |
| 58 | # MPL-2.0 adblock (the Brave Shields engine, see root Cargo.toml) |
| 59 | # |
| 60 | # MPL-2.0 is the only copyleft entry and is file-level, which is fine for an |
| 61 | # unmodified dependency. If adblock is ever vendored and patched, that needs |
| 62 | # re-reviewing rather than silently staying on this list. |
| 63 | # |
| 64 | # Adding a crate that needs a new license will fail CI. That is intended: the |
| 65 | # fix is to review the license and add it here deliberately. |
| 66 | [licenses] |
| 67 | version = 2 |
| 68 | confidence-threshold = 0.8 |
| 69 | allow = [ |
| 70 | "Apache-2.0", |
| 71 | "BSD-2-Clause", |
| 72 | "BSD-3-Clause", |
| 73 | "IJG", |
| 74 | "ISC", |
| 75 | "MIT", |
| 76 | "MPL-2.0", |
| 77 | "Unicode-3.0", |
| 78 | "Zlib", |
| 79 | ] |
| 80 | # The workspace's own crates (including the vendored third_party/betocore |
| 81 | # ones) are `publish = false`, and their licensing is a repo decision rather |
| 82 | # than a third-party one. |
| 83 | private = { ignore = true } |
| 84 | exceptions = [] |
| 85 | |
| 86 | # --------------------------------------------------------------------------- |
| 87 | # Bans |
| 88 | # --------------------------------------------------------------------------- |
| 89 | [bans] |
| 90 | # Duplicate versions are unavoidable across a 400-crate graph and are a |
| 91 | # code-size concern, not a security one - report, don't fail. |
| 92 | multiple-versions = "warn" |
| 93 | # Deliberately "warn", not "deny". An earlier revision of this file set "deny" |
| 94 | # on the strength of a grep for a literal `"*"` in the manifests, which found |
| 95 | # nothing. That grep was the wrong instrument: a path dependency written |
| 96 | # without a version, e.g. `jni_http = { path = "..." }`, carries an implicit |
| 97 | # `*` requirement that never appears as a literal in the file. Measured |
| 98 | # properly via `cargo metadata`, the tree has 77 wildcard requirements (72 in |
| 99 | # the root workspace, 3 in mamaps_build, 1 each in tile_build and wikidesc), |
| 100 | # so "deny" would have failed CI on the first run. |
| 101 | # |
| 102 | # What the measurement does show, and what makes "warn" adequate for now: all |
| 103 | # 77 are path dependencies. Zero crates.io dependencies use a wildcard, which |
| 104 | # is the case actually worth denying, since there the lockfile would be the |
| 105 | # only thing pinning the version. |
| 106 | # |
| 107 | # To make this "deny": cargo-deny's `allow-wildcard-paths = true` exempts path |
| 108 | # dependencies, but only for crates that are private (`publish = false`). |
| 109 | # Seven packages here are not - weather_om, camera_stitch, euicc, measure_vio, |
| 110 | # youpipe_extractor, share_nearby and wikidesc do not inherit the root |
| 111 | # `[workspace.package] publish = false`. Give those seven `publish.workspace = |
| 112 | # true` (or an explicit `publish = false`), then flip this to "deny" with |
| 113 | # `allow-wildcard-paths = true` and confirm with a real run. |
| 114 | wildcards = "warn" |
| 115 | allow = [] |
| 116 | skip = [] |
| 117 | skip-tree = [] |
| 118 | |
| 119 | [[bans.deny]] |
| 120 | # The root Cargo.toml states the invariant: Rust reaches the network through |
| 121 | # library/jni-http over the JNI bridge, so no shipped .so links its own TLS. |
| 122 | # Verified absent from every committed Cargo.lock; this keeps it that way. |
| 123 | name = "openssl" |
| 124 | |
| 125 | [[bans.deny]] |
| 126 | name = "openssl-sys" |
| 127 | |
| 128 | [[bans.deny]] |
| 129 | name = "native-tls" |
| 130 | |
| 131 | # --------------------------------------------------------------------------- |
| 132 | # Sources |
| 133 | # --------------------------------------------------------------------------- |
| 134 | # Verified: every `source` entry in every committed Cargo.lock is crates.io - |
| 135 | # there are no git dependencies. Third-party code that is not from crates.io |
| 136 | # is vendored under third_party/ and reviewed as part of the repo. |
| 137 | [sources] |
| 138 | unknown-registry = "deny" |
| 139 | unknown-git = "deny" |
| 140 | allow-registry = ["https://github.com/rust-lang/crates.io-index"] |
| 141 | allow-git = [] |