Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Add cargo deny to audit licenses of dependencies #40

Merged
merged 2 commits 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
7 changes: 7 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,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
expressvpn-ian-c marked this conversation as resolved.
Show resolved Hide resolved
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: '17 6 * * *'
workflow_dispatch:

jobs:
cargo-deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
5 changes: 5 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ lint:
RUN rustup component add clippy
RUN apt-get install -qqy bsdextrautils
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
51 changes: 51 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[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-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",
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to add the liboqs repo here -- or maybe we can switch back to the released version now that 0.8.0 is out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes makes sense to update the deps since its released last week.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should switch back to using the crate now that it has been released. This is on my todo list for this week, but if you're already working in this area, feel free to make the change 🙂

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It became chicken and egg problem when I tried to upgrade liboqs to 0.8.0

Issue:

The latest version of wolfssl v5.6.3 was released on June 21:
https://github.com/wolfSSL/wolfssl/releases/tag/v5.6.3-stable

But liboqs renamed some of its api's on May 17 in this pr:
open-quantum-safe/liboqs#1467

and released v0.8.0 on Aug 21

WolfSSL updated its api to accomodate the above rename in this pr only on July 12:

But it is not yet released.

So if we have to move liboqs to crates version, either we have to patch the wolfssl in build script or use the master version of wolfssl. Think we can take this up in future pr

54 changes: 27 additions & 27 deletions examples/test_certs/pq-osa-ca.crt
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
-----BEGIN CERTIFICATE-----
MIIFCzCCAvOgAw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