Skip to content

Commit 4dfe205

Browse files
committed
ci(audit): add new cargo audit job
- add new `audit.yml` CI job. - add new `.cargo/audit.toml`.
1 parent cdb89a2 commit 4dfe205

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

.cargo/audit.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# `cargo audit` config file
2+
#
3+
# All of the options which can be passed via CLI arguments can also be
4+
# permanently specified in this file.
5+
#
6+
# See original example: https://raw.githubusercontent.com/rustsec/rustsec/refs/heads/main/cargo-audit/audit.toml.example
7+
8+
[advisories]
9+
ignore = [] # advisory IDs to ignore e.g. ["RUSTSEC-2019-0001", ...]
10+
11+
# Output Configuration
12+
[output]
13+
quiet = false # Only print information on error
14+
show_tree = true # Show inverse dependency trees along with advisories (default: true)
15+
16+
[yanked]
17+
enabled = true # Warn for yanked crates in Cargo.lock (default: true)
18+
update_index = true # Auto-update the crates.io index (default: true)

.github/workflows/audit.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Audit
2+
3+
# Performs a security audit of Rust dependencies using `cargo-audit` through the `actions-rust-lang/audit` action.
4+
# Runs nightly on schedule and when Cargo.toml, Cargo.lock, or audit.toml files are modified.
5+
# Helps identify known security vulnerabilities in the dependency tree.
6+
7+
on:
8+
push:
9+
paths:
10+
# Run if workflow changes
11+
- '.github/workflows/audit.yml'
12+
# Run on changed dependencies
13+
- '**/Cargo.toml'
14+
- '**/Cargo.lock'
15+
# Run if the configuration file changes
16+
- '**/audit.toml'
17+
# Rerun periodically to pick up new advisories
18+
schedule:
19+
- cron: '0 0 * * *' # Nightly
20+
# Run manually
21+
workflow_dispatch:
22+
23+
jobs:
24+
audit:
25+
runs-on: ubuntu-latest
26+
permissions:
27+
contents: read
28+
issues: write
29+
steps:
30+
- uses: actions/checkout@v6
31+
with:
32+
persist-credentials: false
33+
- uses: actions-rust-lang/audit@v1
34+
name: Audit Rust Dependencies

0 commit comments

Comments
 (0)