Skip to content

Commit

Permalink
chore(deps): Add deny.yaml and a cargo deny CI job to check dependenc…
Browse files Browse the repository at this point in the history
…ies for vulnerabilities

Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
  • Loading branch information
iamjpotts committed Mar 19, 2024
1 parent 9ba488c commit 3a0415a
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/sqlx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ on:
- '*-dev'

jobs:
deny:
name: Cargo Deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1

format:
name: Format
runs-on: ubuntu-20.04
Expand Down
70 changes: 70 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[advisories]
ignore = [
# No upgrade available for rsa 0.9.4, a direct dependency of sqlx-mysql
"RUSTSEC-2023-0071",
]
version = 2

[licenses]
allow = [
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause",
"ISC",
"MIT",
"MPL-2.0",
"OpenSSL",
"Unicode-DFS-2016",
"Zlib",
]
confidence-threshold = 0.9
version = 2

[[licenses.clarify]]
name = "ring"
expression = "MIT AND ISC AND OpenSSL"
license-files = [
{ path = "LICENSE", hash = 0xbd0eed23 }
]

[bans]
allow = []
deny = []
multiple-versions = "deny"
skip = [
# async-std 1.12 uses two versions - this older version directly, and a newer verison transitively.
{ name = "async-channel", version = "=1.9.0" },
# async-global-executor transitively depends on two different versions of this crate
{ name = "event-listener", version = "^4.0.0" },
# async-global-executor transitively depends on two different versions of this crate
{ name = "event-listener-strategy", version = "=0.4.0" },
# criterion 0.5.1 uses this older version of itertools
# Note that cargo deny will warn about this being unmatched with the --all-features flag set
{ name = "itertools", version = "=0.10.5" },
# mac_address 1.1.5, an optional feature of sqlx-core, this older version as a direct dependency
{ name = "nix", version = "=0.23.2" },
# native-tls 0.2.11 has this older version as a transitive dependency
{ name = "spin", version = "=0.5.2" },
# syn 2.0 has not been adopted by many crates using syn 1.x due to difficult breaking changes
{ name = "syn", version = "<2" },
]
skip-tree = [
# async-std 1.12 uses two versions - this older version directly, and a newer verison transitively.
{ name = "async-io", version = "=1.13.0" },
]

# Warn, rather than deny, due to sqlx crates not referencing each other by a specific version
wildcards = "warn"

[sources]
allow-git = []
allow-registry = [
"https://github.com/rust-lang/crates.io-index"
]
unknown-git = "deny"
unknown-registry = "deny"

[sources.allow-org]
bitbucket = []
github = []
gitlab = []
1 change: 1 addition & 0 deletions sqlx-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "sqlx-test"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
publish = false

[dependencies]
Expand Down

0 comments on commit 3a0415a

Please sign in to comment.