Skip to content

Commit b3c2400

Browse files
committed
chore(deps): Add deny.yaml and a cargo deny CI job to check dependencies for vulnerabilities
Signed-off-by: Joshua Potts <[email protected]>
1 parent 235604f commit b3c2400

File tree

5 files changed

+101
-31
lines changed

5 files changed

+101
-31
lines changed

.github/workflows/sqlx.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ on:
88
- '*-dev'
99

1010
jobs:
11+
deny:
12+
name: Cargo Deny
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: EmbarkStudios/cargo-deny-action@v1
17+
1118
format:
1219
name: Format
1320
runs-on: ubuntu-20.04

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ target/
1717
# Integration testing extension library for SQLite.
1818
ipaddr.dylib
1919
ipaddr.so
20+
21+
# Temporary files from running the tests locally like they would be run from CI
22+
.sqlx

Cargo.lock

Lines changed: 20 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deny.toml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
[advisories]
2+
ignore = [
3+
# No upgrade available for rsa 0.9.4, a direct dependency of sqlx-mysql
4+
"RUSTSEC-2023-0071",
5+
]
6+
notice = "deny"
7+
unmaintained = "deny"
8+
vulnerability = "deny"
9+
yanked = "deny"
10+
11+
[licenses]
12+
allow = [
13+
"Apache-2.0",
14+
"BSD-2-Clause",
15+
"BSD-3-Clause",
16+
"ISC",
17+
"MIT",
18+
"MPL-2.0",
19+
"OpenSSL",
20+
"Unicode-DFS-2016",
21+
"Zlib",
22+
]
23+
default = "deny"
24+
confidence-threshold = 0.9
25+
unlicensed = "deny"
26+
27+
[[licenses.clarify]]
28+
name = "ring"
29+
expression = "MIT AND ISC AND OpenSSL"
30+
license-files = [
31+
{ path = "LICENSE", hash = 0xbd0eed23 }
32+
]
33+
34+
[bans]
35+
allow = []
36+
deny = []
37+
multiple-versions = "deny"
38+
skip = [
39+
# async-std 1.12 uses two versions - this older version directly, and a newer verison transitively.
40+
{ name = "async-channel", version = "=1.9.0" },
41+
# criterion 0.5.1 uses this older version of itertools
42+
# Note that cargo deny will warn about this being unmatched with the --all-features flag set
43+
{ name = "itertools", version = "=0.10.5" },
44+
# mac_address 1.1.5, an optional feature of sqlx-core, this older version as a direct dependency
45+
{ name = "nix", version = "=0.23.2" },
46+
# native-tls 0.2.11 has this older version as a transitive dependency
47+
{ name = "spin", version = "=0.5.2" },
48+
# syn 2.0 has not been adopted by many crates using syn 1.x due to difficult breaking changes
49+
{ name = "syn", version = "<2" },
50+
]
51+
skip-tree = [
52+
# async-std 1.12 uses two versions - this older version directly, and a newer verison transitively.
53+
{ name = "async-io", version = "=1.13.0" },
54+
]
55+
56+
# Warn, rather than deny, due to sqlx crates not referencing each other by a specific version
57+
wildcards = "warn"
58+
59+
[sources]
60+
allow-git = []
61+
allow-registry = [
62+
"https://github.com/rust-lang/crates.io-index"
63+
]
64+
unknown-git = "deny"
65+
unknown-registry = "deny"
66+
67+
[sources.allow-org]
68+
bitbucket = []
69+
github = []
70+
gitlab = []

sqlx-test/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "sqlx-test"
33
version = "0.1.0"
44
edition = "2021"
5+
license = "MIT OR Apache-2.0"
56
publish = false
67

78
[dependencies]

0 commit comments

Comments
 (0)