Skip to content

Commit c1e23aa

Browse files
committed
feat: add deny.toml configuration for cargo-deny and update security workflow to include deny.toml
1 parent 19f9b73 commit c1e23aa

2 files changed

Lines changed: 68 additions & 0 deletions

File tree

.github/workflows/security.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ on:
55
paths:
66
- '**/Cargo.toml'
77
- '**/Cargo.lock'
8+
- 'deny.toml'
89
pull_request:
910
paths:
1011
- '**/Cargo.toml'
1112
- '**/Cargo.lock'
13+
- 'deny.toml'
1214
schedule:
1315
# Run security audit weekly on Sundays at 00:00 UTC
1416
- cron: '0 0 * * 0'

deny.toml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Configuration for cargo-deny
2+
# See: https://embarkstudios.github.io/cargo-deny/
3+
4+
[licenses]
5+
# Allow these licenses for the project
6+
allow = [
7+
"Apache-2.0",
8+
"MIT",
9+
"BSD-2-Clause",
10+
"BSD-3-Clause",
11+
"ISC",
12+
"Unicode-DFS-2016",
13+
]
14+
15+
# Deny these licenses
16+
deny = [
17+
"GPL-2.0",
18+
"GPL-3.0",
19+
"AGPL-3.0",
20+
]
21+
22+
# Configuration for license checking
23+
confidence-threshold = 0.8
24+
exceptions = []
25+
26+
[bans]
27+
# Lint level for when multiple versions of the same crate are detected
28+
multiple-versions = "warn"
29+
# Lint level for when a crate version requirement is `*`
30+
wildcards = "allow"
31+
# The graph highlighting used when creating dotgraphs for crates
32+
highlight = "all"
33+
# List of explicitly disallowed crates
34+
deny = []
35+
# Certain crates/versions that will be skipped when doing duplicate detection.
36+
skip = []
37+
# Similarly to `skip` allows you to skip certain crates from being checked.
38+
skip-tree = []
39+
40+
[advisories]
41+
# The path where the advisory database is cloned/fetched into
42+
db-path = "~/.cargo/advisory-db"
43+
# The url(s) of the advisory databases to use
44+
db-urls = ["https://github.com/rustsec/advisory-db"]
45+
# The lint level for security vulnerabilities
46+
vulnerability = "deny"
47+
# The lint level for unmaintained crates
48+
unmaintained = "warn"
49+
# The lint level for crates that have been yanked from their source registry
50+
yanked = "warn"
51+
# The lint level for crates with security notices.
52+
notice = "warn"
53+
# A list of advisory IDs to ignore.
54+
ignore = []
55+
56+
[sources]
57+
# Lint level for what to happen when a crate from a crate registry that is
58+
# not in the allow list is encountered
59+
unknown-registry = "warn"
60+
# Lint level for what to happen when a crate from a git repository that is not
61+
# in the allow list is encountered
62+
unknown-git = "warn"
63+
# List of urls or hosts to allow git sources for
64+
allow-git = []
65+
# List of registries to allow crates from
66+
allow-registry = ["https://github.com/rust-lang/crates.io-index"]

0 commit comments

Comments
 (0)