build(deny): a supply-chain gate: advisories, licences, sources (cargo-deny)
Nothing checked what the program is built from. `just deny` now does, in the lint part of `just check` and weekly in scheduled.yml (an advisory is published when it is, not when we push), from one file, deny.toml: - advisories: no crate in the lock file with a known vulnerability (RustSec), none yanked; an unmaintained crate is refused when it is one of our own direct dependencies. Two advisories are lived with, each with its reason and date: the quick-xml 0.38 that typst's citation reader brings, which no XML from outside reaches. - licences: the permissive ones, plus MPL-2.0 for one unchanged crate (option-ext) and CDLA-Permissive-2.0 for Mozilla's root certificates. No font licence is allowed, so a crate that carries fonts is refused and every font we ship is a file here beside its licence. A crate offering only a copyleft licence is refused. - sources: crates.io and the bookspec repository, nothing else. - bans: no dependency by wildcard version. The crates are marked `publish = false` (one line in the workspace, inherited by all eleven): they are parts of one program, not libraries for crates.io, and with that cargo-deny accepts their path dependencies on each other. cargo-deny 0.20.2 is a build tool pinned in mise.toml, not a dependency of the program. Shown: `just deny` prints advisories ok, bans ok, licenses ok, sources ok on this tree. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
9ad6f89816
commit
1726c8b6dd
17 files changed
+124
No files matched your search
@@ -0,0 +1,86 @@
|
||||
# What a dependency must be for wanderbooks to build on it (`just deny`,
|
||||
# part of `just check`). Four questions, each a refusal:
|
||||
# advisories: no known vulnerability (RustSec), nothing yanked
|
||||
# licenses: only licences that fit a program shipped MIT OR Apache-2.0
|
||||
# sources: crates.io, and the one git repository named below
|
||||
# bans: no dependency by wildcard version
|
||||
# An exception goes here with its reason and a date, never on the command
|
||||
# line.
|
||||
|
||||
[graph]
|
||||
# The viewer, the server-only build and every platform's dependencies.
|
||||
all-features = true
|
||||
|
||||
[advisories]
|
||||
yanked = "deny"
|
||||
# "Unmaintained" is not "vulnerable". A crate wanderbooks itself depends on
|
||||
# must be maintained, since that one is ours to replace. One that arrives
|
||||
# through typst or the egui stack (bincode, yaml-rust, paste, rustybuzz,
|
||||
# ttf-parser, zvariant on 2026-11-09) is theirs to replace, and a known
|
||||
# vulnerability in it is still refused above.
|
||||
unmaintained = "workspace"
|
||||
# RustSec ids deliberately lived with, each with why and since when.
|
||||
ignore = [
|
||||
# quick-xml 0.38 (a slow or memory-hungry parse of hostile XML). The
|
||||
# reader's own quick-xml, which does parse files from outside, is 0.42.
|
||||
# This older copy comes through typst (typst -> hayagriva ->
|
||||
# citationberg) and parses citation styles only. wanderbooks renders
|
||||
# its own compiled-in templates, with no bibliography and no file
|
||||
# access, so no XML from outside reaches it. Remove these two lines
|
||||
# when typst moves to a citationberg on quick-xml 0.41 or later.
|
||||
# Since 2026-11-09.
|
||||
{ id = "RUSTSEC-2026-0194", reason = "typst's citationberg only; no outside XML reaches it" },
|
||||
{ id = "RUSTSEC-2026-0195", reason = "typst's citationberg only; no outside XML reaches it" },
|
||||
]
|
||||
|
||||
[licenses]
|
||||
# Permissive licences, and two that are not plain permissive, each for
|
||||
# a named crate:
|
||||
# MPL-2.0: option-ext (through dirs). File-level copyleft: it binds
|
||||
# changes to that crate's own files, and we ship it unchanged.
|
||||
# CDLA-Permissive-2.0: Mozilla's root certificates (webpki-root-certs).
|
||||
# No font licence is on the list (OFL-1.1, Ubuntu-font-1.0): a crate that
|
||||
# brings fonts under one is refused. The OFL itself fits (Inter is under
|
||||
# it); the point is that every font the program ships is a file in this
|
||||
# repository beside its licence (crates/ledger-gui/assets/fonts/README.md,
|
||||
# crates/ledger-import/fonts/), not something a dependency carried in.
|
||||
# That keeps out egui's default set (epaint_default_fonts), which holds
|
||||
# Ubuntu Light under the Ubuntu Font Licence 1.0, non-free to Debian and
|
||||
# Fedora.
|
||||
# GPL and LGPL appear in the tree only as one choice of an OR (self_cell,
|
||||
# r-efi); cargo-deny takes the permissive side. A crate offering only a
|
||||
# copyleft licence is refused here, which is the point.
|
||||
allow = [
|
||||
"MIT",
|
||||
"MIT-0",
|
||||
"Apache-2.0",
|
||||
"Apache-2.0 WITH LLVM-exception",
|
||||
"BSD-2-Clause",
|
||||
"BSD-3-Clause",
|
||||
"ISC",
|
||||
"Zlib",
|
||||
"0BSD",
|
||||
"BSL-1.0",
|
||||
"CC0-1.0",
|
||||
"Unlicense",
|
||||
"Unicode-3.0",
|
||||
"bzip2-1.0.6",
|
||||
"MPL-2.0",
|
||||
"CDLA-Permissive-2.0",
|
||||
]
|
||||
confidence-threshold = 0.9
|
||||
|
||||
[bans]
|
||||
# Several versions of one crate are a cost in build time, not a risk:
|
||||
# the GUI stack brings many. A wildcard version is a risk.
|
||||
multiple-versions = "allow"
|
||||
wildcards = "deny"
|
||||
allow-wildcard-paths = true
|
||||
|
||||
[sources]
|
||||
unknown-registry = "deny"
|
||||
unknown-git = "deny"
|
||||
allow-registry = ["https://github.com/rust-lang/crates.io-index"]
|
||||
# bookspec, the specification and its checker (D-68), pinned by rev in
|
||||
# crates/ledger-core/Cargo.toml.
|
||||
allow-git = ["https://git.swaits.com/swaits/bookspec"]
|
||||
Reference in new issue
Block a user