Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cargo deny to audit licenses of dependencies #15

Merged
merged 1 commit into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches: [main]
pull_request: null # target every PR

jobs:
test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -31,3 +32,10 @@ jobs:
- uses: actions/checkout@v3
- name: Lint crate
run: earthly --ci +lint
cargo-deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check bans licenses sources
12 changes: 12 additions & 0 deletions .github/workflows/nightly-cargo-deny.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Nightly `cargo deny` checks
on:
schedule:
- cron: '24 12 * * *'
workflow_dispatch:

jobs:
cargo-deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
6 changes: 6 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,9 @@ lint:
FROM +copy-src
RUN rustup component add clippy
RUN cargo clippy --all-features --all-targets -- -D warnings


check-license:
RUN cargo install --locked cargo-deny
COPY --dir src tests Cargo.toml Cargo.lock deny.toml ./
RUN cargo deny --all-features check bans license sources
53 changes: 53 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[advisories]
db-path = "~/.cargo/advisory-db"
db-urls = ["https://github.com/rustsec/advisory-db"]
vulnerability = "deny"
unmaintained = "deny"
yanked = "deny"
notice = "deny"
ignore = [
#"RUSTSEC-0000-0000",
]
# * None - CVSS Score 0.0
# * Low - CVSS Score 0.1 - 3.9
# * Medium - CVSS Score 4.0 - 6.9
# * High - CVSS Score 7.0 - 8.9
# * Critical - CVSS Score 9.0 - 10.0
severity-threshold = "High"

[licenses]
default = "deny"
copyleft = "deny"
unlicensed = "deny"
allow = [
"MIT",
"Apache-2.0",
"Unicode-DFS-2016",
"BSD-3-Clause",
"ISC",
]
allow-osi-fsf-free = "neither"
confidence-threshold = 0.8
exceptions = [
{ name = "wolfssl", allow = ["GPL-2.0"], version = "*" },
{ name = "wolfssl-sys", allow = ["GPL-2.0"], version = "*" },
]

[licenses.private]
ignore = true

[bans]
multiple-versions = "warn"
wildcards = "allow"
highlight = "all"
workspace-default-features = "allow"
external-default-features = "allow"

[sources]
unknown-registry = "deny"
unknown-git = "deny"
allow-registry = ["https://github.com/rust-lang/crates.io-index"]
allow-git = [
"https://github.com/open-quantum-safe/liboqs-rust",
"https://github.com/expressvpn/wolfssl-sys",
]