mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-27 11:31:05 +00:00
Adds cargo-deny to scan for vulnerabilities and license issues regarding rust crates. GitHub Actions does not have an obvious way to loop over each of the Cargo.toml files. To avoid hardcoding it, I worked around the problem using a composite action that first generates the cargo-deny action by finding all Cargo.toml files before calling this new generated action in the master workflow. Uses recommended deny.toml from cargo-deny repo with the following modifications: ignore = ["RUSTSEC-2020-0071"] because chrono is dependent on the version of time with the vulnerability and there is no simple workaround multiple-versions = "allow" Because of the above error and other packages, there are instances where some crates require different versions of a crate. unknown-git = "allow" I don't see a particular issue with allowing crates from other repos. An alternative would be the manually set each repo we want in an allow-git list, but I see this as more of a nuisance that its worth. We could leave this as a warning (default), but to avoid clutter I'm going to allow it. If deny.toml needs to be edited in the future, here's the guide: https://embarkstudios.github.io/cargo-deny/index.html Fixes #3359 Signed-off-by: Derek Lee <derlee@redhat.com>
34 lines
733 B
TOML
34 lines
733 B
TOML
targets = [
|
|
{ triple = "x86_64-apple-darwin" },
|
|
{ triple = "x86_64-unknown-linux-gnu" },
|
|
{ triple = "x86_64-unknown-linux-musl" },
|
|
]
|
|
|
|
[advisories]
|
|
vulnerability = "deny"
|
|
unsound = "deny"
|
|
unmaintained = "deny"
|
|
ignore = ["RUSTSEC-2020-0071"]
|
|
|
|
[bans]
|
|
multiple-versions = "allow"
|
|
deny = [
|
|
{ name = "cmake" },
|
|
{ name = "openssl-sys" },
|
|
]
|
|
|
|
[licenses]
|
|
unlicensed = "deny"
|
|
allow-osi-fsf-free = "neither"
|
|
copyleft = "allow"
|
|
# We want really high confidence when inferring licenses from text
|
|
confidence-threshold = 0.93
|
|
allow = ["0BSD", "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause", "CC0-1.0", "ISC", "MIT", "MPL-2.0"]
|
|
private = { ignore = true}
|
|
|
|
exceptions = []
|
|
|
|
[sources]
|
|
unknown-registry = "allow"
|
|
unknown-git = "allow"
|