diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14c9c0b9..c1b17481 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,6 +86,19 @@ jobs: - name: Test on MSRV run: cargo test ${{ matrix.packages }} --verbose + # Supply-chain audit: security advisories, license policy, banned crates, + # and source restrictions. Configured by deny.toml at the repo root. + supply-chain: + name: Supply-chain (cargo-deny) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + + - name: cargo-deny + uses: EmbarkStudios/cargo-deny-action@a531616d8ce3b9177443e48a1159bc945a099823 # v2.0.19 + with: + command: check + python: name: Python ${{ matrix.python-version }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} diff --git a/deny.toml b/deny.toml new file mode 100644 index 00000000..c5440c8a --- /dev/null +++ b/deny.toml @@ -0,0 +1,57 @@ +# cargo-deny configuration — supply-chain checks for the Wickra workspace. +# Run locally with `cargo deny check`; CI runs the same in the `supply-chain` +# job (see .github/workflows/ci.yml). + +[graph] +all-features = true + +[advisories] +# Fail on any security advisory or unmaintained/unsound crate in the tree. +version = 2 +yanked = "deny" +ignore = [ + # RUSTSEC-2025-0020 — PyString::from_object buffer overflow in pyo3 0.22. + # Reached only through the python binding (numpy 0.22 -> pyo3 0.22). The + # fix requires upgrading pyo3 to >=0.24.1, which also forces a numpy + # upgrade and a Bound-API migration of bindings/python — a separate, + # tracked piece of work. The published Rust crates and the Node/WASM + # bindings do not depend on pyo3. + { id = "RUSTSEC-2025-0020", reason = "pyo3 0.22 upgrade tracked separately; affects only bindings/python" }, +] + +[bans] +# Catch accidental duplicate versions and wildcard ("*") version requirements. +multiple-versions = "warn" +wildcards = "deny" +# Internal workspace crates are referenced by `path` without a version, which +# is a legitimate wildcard — only flag wildcards on external registry crates. +allow-wildcard-paths = true + +[licenses] +version = 2 +# Licenses permitted for every crate in the dependency graph. Wickra itself is +# PolyForm-Noncommercial-1.0.0; the rest are the permissive licenses its +# dependency tree actually uses. +allow = [ + "PolyForm-Noncommercial-1.0.0", + "MIT", + "Apache-2.0", + "BSD-2-Clause", + "ISC", + "Unicode-3.0", + "BSL-1.0", + "Zlib", + "Unlicense", +] +# Crates whose SPDX expression carries a license exception (e.g. the LLVM +# exception on Apache-2.0). The exception is only granted to the named crate. +exceptions = [ + { allow = ["Apache-2.0 WITH LLVM-exception"], crate = "target-lexicon" }, +] + +[sources] +# Only the canonical crates.io registry is allowed; no git or alternative +# registries. +unknown-registry = "deny" +unknown-git = "deny" +allow-registry = ["https://github.com/rust-lang/crates.io-index"]