Repository navigation
63 lines (57 loc) · 2.02 KB
/
Copy pathsecurity.yml
File metadata and controls
63 lines (57 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Security
# Supply-chain checks that need no secrets and no external service beyond GitHub:
#
# Dependency review (pull requests): GitHub's dependency graph compares the pull request's
# Cargo.lock and workflow actions with the base and fails when the change adds a
# dependency with a known vulnerability of moderate severity or worse.
# RustSec advisories (weekly, and when Cargo.lock changes): `cargo audit` checks every
# crate in Cargo.lock against the RustSec advisory database and fails on a vulnerability.
# Unmaintained or yanked crates are listed as warnings. A new advisory can appear without
# any commit, which is why it also runs on a schedule.
#
# Neither is a required check. A failure on main or on the schedule shows in the Actions tab.
on:
pull_request:
paths:
- 'Cargo.lock'
- '**/Cargo.toml'
- '.github/workflows/**'
push:
branches: [main]
paths:
- 'Cargo.lock'
- '.github/workflows/security.yml'
schedule:
- cron: '41 5 * * 1'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: security-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
dependency-review:
name: Dependency review
if: github.event_name == 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
with:
fail-on-severity: moderate
rustsec:
name: RustSec advisories
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Rust toolchain (stable)
run: |
rustup toolchain install stable --profile minimal --no-self-update
rustup default stable
- name: Install cargo-audit
run: cargo install cargo-audit --locked --version 0.22.2
- name: cargo audit
run: cargo audit --file Cargo.lock