Skip to content

Commit e8f4f5f

Browse files
authored
Merge pull request #1975 from habitat-sh/audit
add cargo audit workflow to ci
2 parents 7a2e2d6 + 69d174b commit e8f4f5f

5 files changed

Lines changed: 132 additions & 150 deletions

File tree

.cargo/audit.toml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# cargo audit config file
2+
# https://github.com/rustsec/rustsec/blob/main/cargo-audit/audit.toml.example
3+
#
4+
# All of the options which can be passed via CLI arguments can also be
5+
# permanently specified in this file.
6+
7+
[advisories]
8+
9+
# advisory IDs to ignore e.g. ["RUSTSEC-2019-0001", ...]
10+
ignore = []
11+
12+
# warn for categories of informational advisories
13+
informational_warnings = ["notice", "unmaintained", "unsound"]
14+
15+
# CVSS severity ("none", "low", "medium", "high", "critical")
16+
severity_threshold = "none"
17+
18+
# Advisory Database Configuration
19+
[database]
20+
path = ".cargo/advisory-db" # Path where advisory git repo will be cloned
21+
url = "https://github.com/RustSec/advisory-db.git" # URL to git repo
22+
fetch = true # Perform a `git fetch` before auditing (default: true)
23+
stale = false # Allow stale advisory DB (i.e. no commits for 90 days, default: false)
24+
25+
# Output Configuration
26+
[output]
27+
deny = ["warnings", "unmaintained", "unsound", "yanked"] # exit on error if these are found
28+
format = "terminal" # "terminal" (human readable report) or "json"
29+
quiet = false # Only print information on error
30+
show_tree = true # Show inverse dependency trees along with advisories (default: true)
31+
32+
[yanked]
33+
enabled = true # Warn for yanked crates in Cargo.lock (default: true)
34+
update_index = true # Auto-update the crates.io index (default: true)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# https://github.com/actions-rs/audit-check
2+
name: Rust Cargo Audit
3+
on:
4+
push:
5+
permissions:
6+
contents: read
7+
jobs:
8+
security_audit:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v6
12+
- uses: dtolnay/rust-toolchain@1.91.1
13+
id: toolchain
14+
- run: rustup override set ${{steps.toolchain.outputs.name}}
15+
- uses: ClementTsang/cargo-action@v0.0.7
16+
with:
17+
command: install
18+
args: cargo-audit
19+
- uses: ClementTsang/cargo-action@v0.0.7
20+
with:
21+
command: audit

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
*.rustfmt
33
*.sig.key
44
*.sym.key
5+
.cargo/advisory-db/
6+
.cargo/advisory-db..lock
57
.DS_Store
68
.secrets/*
79
!.secrets/habitat-env.sample

0 commit comments

Comments
 (0)