Repository navigation
110 lines (91 loc) · 3.04 KB
/
Copy pathrust-codeql.yml
File metadata and controls
110 lines (91 loc) · 3.04 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Rust CodeQL
on:
push:
branches: [main]
paths:
- 'runner/**'
- '.github/workflows/rust-codeql.yml'
- '.github/codeql/**'
- 'scripts/test-dependencies.py'
pull_request:
paths:
- 'runner/**'
- '.github/workflows/rust-codeql.yml'
- '.github/codeql/**'
- 'scripts/test-dependencies.py'
schedule:
# Run weekly on Sunday at midnight UTC
- cron: '0 0 * * 0'
permissions:
contents: read
jobs:
analyze:
name: CodeQL Analysis
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
workspaces: runner
shared-key: codeql
cache-on-failure: true
- name: Initialize CodeQL
uses: github/codeql-action/init@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4
with:
languages: rust
build-mode: none
config-file: ./.github/codeql/codeql-config.yml
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4
continue-on-error: true
with:
category: '/language:rust'
# Additional security checks using cargo-audit
audit:
name: Security Audit
runs-on: ubuntu-latest
defaults:
run:
working-directory: runner
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable
- name: Install cargo-audit
run: cargo install cargo-audit --version 0.22.2 --locked
- name: Run security audit
run: cargo audit
# Check for known security issues in dependencies
deny:
name: Dependency Check
runs-on: ubuntu-latest
defaults:
run:
working-directory: runner
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable
- name: Install cargo-deny
run: cargo install cargo-deny --version 0.20.2 --locked
- name: Verify dependency policy boundaries
run: python3 ../scripts/test-dependencies.py
- name: Check dependencies
# cargo-deny 0.20 uses CLI overrides for the existing advisory warning policy.
run: cargo deny --locked check --warn unmaintained --warn notice