-
-
Notifications
You must be signed in to change notification settings - Fork 10
114 lines (95 loc) · 2.84 KB
/
sast.yml
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
name: "SAST"
on:
push:
branches:
- master
- develop
pull_request:
# The branches below must be a subset of the branches above
branches:
- master
- develop
schedule:
- cron: '0 16 * * 6'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
codeql-analyze:
name: CodeQL Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
target:
- bhaptics_tactsuit_x40
- opengloves_lucidgloves_proto4_ffb
battery_flag:
- SS_BATTERY_ENABLED=true
env:
PLATFORMIO_BUILD_FLAGS: >-
${{ matrix.battery_flag && format('-D {0}', matrix.battery_flag) || '' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
submodules: 'recursive'
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
- name: Setup PlatformIO
uses: ./.github/actions/setup-platformio
- name: Build target
run: pio run ${{ matrix.target && format('-e {0}', matrix.target) || '' }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:cpp"
semgrep:
name: Semgrep
runs-on: ubuntu-latest
container:
image: semgrep/semgrep
# Skip any PR created by dependabot to avoid permission issues:
if: (github.actor != 'dependabot[bot]')
steps:
- uses: actions/checkout@v4
- run: semgrep ci --sarif > semgrep.sarif
env:
# Connect to Semgrep AppSec Platform through your SEMGREP_APP_TOKEN.
# Generate a token from Semgrep AppSec Platform > Settings
# and add it to your GitHub secrets.
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
- name: Upload SARIF file for GitHub Advanced Security Dashboard
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: semgrep.sarif
if: always()
flawfinder:
runs-on: ubuntu-latest
strategy:
matrix:
directory:
- 'variants'
- 'firmware'
- 'include'
- 'lib'
- 'examples'
steps:
- uses: actions/checkout@v4
- uses: david-a-wheeler/[email protected]
with:
arguments: '--sarif ${{ matrix.directory }}'
output: 'flawfinder_results.sarif'
- name: Upload SARIF file for GitHub Advanced Security Dashboard
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: flawfinder_results.sarif
if: always()