-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (73 loc) · 2.13 KB
/
security.yml
File metadata and controls
91 lines (73 loc) · 2.13 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Security
on:
push:
branches: [main]
schedule:
# Every Monday at 08:00 UTC
- cron: "0 8 * * 1"
env:
CARGO_TERM_COLOR: always
jobs:
audit:
name: Dependency Audit
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-security-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-security-
- name: Install cargo-audit
uses: actions/cache@v4
id: cache-cargo-audit
with:
path: ~/.cargo/bin/cargo-audit
key: ${{ runner.os }}-cargo-audit-0.21
- name: Build cargo-audit if not cached
if: steps.cache-cargo-audit.outputs.cache-hit != 'true'
run: cargo install cargo-audit --locked
- name: Run cargo audit
run: cargo +stable audit
deny:
name: License & Dependency Compliance
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Install cargo-deny
uses: actions/cache@v4
id: cache-cargo-deny
with:
path: ~/.cargo/bin/cargo-deny
key: ${{ runner.os }}-cargo-deny-0.16
- name: Build cargo-deny if not cached
if: steps.cache-cargo-deny.outputs.cache-hit != 'true'
run: cargo install cargo-deny --locked
- name: Run cargo deny
run: cargo +stable deny check
secret-scan:
name: Secret Scanning
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run gitleaks
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}