diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index e6d1b83..026b5b1 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -62,3 +62,12 @@ jobs: steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - uses: actions/dependency-review-action@72eb423297a7cc29376c3e0026574f1a203f9052 # v4.5.0 + + cargo-deny: + name: Cargo Deny (Licenses & Bans) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: EmbarkStudios/cargo-deny-action@v2 + with: + command: check licenses bans sources diff --git a/CHANGELOG.md b/CHANGELOG.md index 468efa5..7053e87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- `ci`: Add `deny.toml` and `cargo-deny` check in `.github/workflows/security.yml` to enforce license compliance (Apache-2.0, MIT, BSD) and deny unknown registries (#91). - Stage 1 developer-experience tooling: - `.gitattributes` normalizing all tracked text to LF (`*.sh`, `*.rs`, `*.ts`, `*.md`, and the other text formats in the tree) and marking `Cargo.lock` and `package-lock.json` as generated. The tree was re-normalized once, and a new **Line Endings** workflow fails any pull request that reintroduces CRLF into the index (#85). - A **Commitlint** workflow and `commitlint.config.cjs` enforcing the Conventional Commits style documented in `CONTRIBUTING.md`; a pull request with a non-conforming commit now fails the check. Allowed scopes are documented and now include the `vault` and `common` crates (#90). diff --git a/deny.toml b/deny.toml new file mode 100644 index 0000000..0bafb02 --- /dev/null +++ b/deny.toml @@ -0,0 +1,32 @@ +# Configuration for cargo-deny (Issue #91) + +[graph] +targets = [] +all-features = false +no-default-features = false + +[licenses] +unlicensed = "deny" +allow = [ + "Apache-2.0", + "MIT", + "BSD-2-Clause", + "BSD-3-Clause", + "ISC", + "Unicode-DFS-2016", + "CC0-1.0", +] +confidence-threshold = 0.8 + +[licenses.private] +ignore = true + +[bans] +multiple-versions = "warn" +wildcards = "deny" +highlight = "all" + +[sources] +unknown-registries = "deny" +unknown-git = "deny" +allow-registry = ["https://github.com/rust-lang/crates.io-index"]