-
Notifications
You must be signed in to change notification settings - Fork 47
119 lines (97 loc) · 3.39 KB
/
codeql.yml
File metadata and controls
119 lines (97 loc) · 3.39 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
111
112
113
114
115
116
117
118
119
name: "CodeQL"
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
schedule:
# Run every Monday at midnight
- cron: "0 0 * * 1"
permissions:
contents: read
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ["cpp", "python"]
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Initialize CodeQL
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
with:
category: "/language:${{matrix.language}}"
- name: Generate CodeQL Security Report
uses: rsdmike/github-security-report-action@a149b24539044c92786ec39af8ba38c93496495d # v3.0.4
with:
template: report
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload CodeQL Security Report
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: codeql-report-${{ matrix.language }}
path: report.pdf
analyze_rust:
name: Analyze (Rust)
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install clippy
run: rustup component add clippy
- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@ec80feb9e330418e014932e5982599255eff6dbb # 1.17.4
- name: Install dependencies
run: cargo binstall --no-confirm clippy-sarif sarif-fmt
- name: Run clippy
working-directory: rust
run: |
cargo clippy --all-features --message-format=json > clippy.json
sed --in-place 's/"file_name":"itt/"file_name":"rust\/itt/g' clippy.json
clippy-sarif --input clippy.json --output clippy.sarif
continue-on-error: true
- name: Print SARIF
run: sarif-fmt --input rust/clippy.sarif
- name: Upload analysis
uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
with:
sarif_file: rust/clippy.sarif
wait-for-processing: true
analyze_bandit:
name: Analyze (Bandit Scan)
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Install dependencies
run: pip install sarif-tools
- name: Perform Bandit Analysis
uses: PyCQA/bandit-action@67a458d90fa11fb1463e91e7f4c8f068b5863c7f # v1.0.1
continue-on-error: true
with:
targets: "python"
- name: Convert SARIF report to HTML
run: sarif html --output bandit-report.html results.sarif
- name: Upload Bandit Scan report
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: bandit-report
path: bandit-report.html