-
Notifications
You must be signed in to change notification settings - Fork 2
286 lines (285 loc) · 10.2 KB
/
scandog-combined-scanner.yml
File metadata and controls
286 lines (285 loc) · 10.2 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# Combined configuration from 12 templates
# Scanners: Semgrep, OWASP Depscan + cdxgen, tfsec, grype, Gitleaks, CDXGen, Trivy, checkov, Trivy, osv-scanner, Trufflehog, opengrep
# Generated for GITHUB by ScanDog
name: Combined Security Scanner Pipeline
on:
pull_request:
branches:
- master
workflow_dispatch:
jobs:
# Jobs from template: Semgrep
scandog_semgrep_scan:
runs-on: ubuntu-latest
container:
image: semgrep/semgrep
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: semgrep scan
run: semgrep scan --config auto --json > semgrep.json
- name: Import results to ScanDog
uses: scandogio/scandog-import@v1.0
with:
ci_run_id: ${{ github.run_id }}
report_file: semgrep.json
workflow_id: "77870259287eac45b40e65decf2207c3"
scan_type: SAST
scanner: Semgrep
backend_api_token: ${{ secrets.SCANDOG_BACKEND_API_TOKEN }}
backend_url: ${{ secrets.SCANDOG_BACKEND_URL }}
# Jobs from template: OWASP Depscan + cdxgen
scandog_depscan_sca:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install OWASP-depscan
run: |
pip install owasp-depscan
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 21
- name: Install cdxgen
run: npm install -g @cyclonedx/cdxgen
- name: scan SBOM by OWASP depscan
run: |
cd $GITHUB_WORKSPACE
export FETCH_LICENSE=true
depscan -i . --reports-dir .
- name: Import results to ScanDog
uses: scandogio/scandog-import@v1.0
with:
ci_run_id: ${{ github.run_id }}
report_file: sbom-universal.vdr.json
workflow_id: "77870259287eac45b40e65decf2207c3"
scan_type: SCA
scanner: depscan
backend_api_token: ${{ secrets.SCANDOG_BACKEND_API_TOKEN }}
backend_url: ${{ secrets.SCANDOG_BACKEND_URL }}
# Jobs from template: tfsec
scandog_tfsec_scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run tfsec
uses: aquasecurity/tfsec-action@v1.0.0
with:
format: json
out: tfsec-results.json
- name: Import results to ScanDog
uses: scandogio/scandog-import@v1.0
with:
ci_run_id: ${{ github.run_id }}
report_file: tfsec-results.json
workflow_id: "77870259287eac45b40e65decf2207c3"
scan_type: IaC Scanner
scanner: tfsec
backend_api_token: ${{ secrets.SCANDOG_BACKEND_API_TOKEN }}
backend_url: ${{ secrets.SCANDOG_BACKEND_URL }}
# Jobs from template: grype
scandog_grype_sca:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Grype
uses: anchore/scan-action@v6
with:
path: .
output-format: json
output-file: grype-results.json
fail-build: false
- name: Import results to ScanDog
uses: scandogio/scandog-import@v1.0
with:
ci_run_id: ${{ github.run_id }}
report_file: grype-results.json
workflow_id: "77870259287eac45b40e65decf2207c3"
scan_type: SCA
scanner: grype
backend_api_token: ${{ secrets.SCANDOG_BACKEND_API_TOKEN }}
backend_url: ${{ secrets.SCANDOG_BACKEND_URL }}
# Jobs from template: Gitleaks
scandog_gitleaks_scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install & Run Gitleaks
run: |
git clone https://github.com/gitleaks/gitleaks.git
cd gitleaks
make build
cd $GITHUB_WORKSPACE
gitleaks dir . -f json -r gitleaks.json
- name: Import results to ScanDog
uses: scandogio/scandog-import@v1.0
with:
ci_run_id: ${{ github.run_id }}
report_file: gitleaks.json
workflow_id: "77870259287eac45b40e65decf2207c3"
scan_type: Secret Scanning
scanner: gitleaks
backend_api_token: ${{ secrets.SCANDOG_BACKEND_API_TOKEN }}
backend_url: ${{ secrets.SCANDOG_BACKEND_URL }}
# Jobs from template: CDXGen
scandog_cdxgen_scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cdxgen
run: npm install -g @cyclonedx/cdxgen
- name: Generate SBOM
run: cdxgen --input . --output sbom.json
- name: Import results to ScanDog
uses: scandogio/scandog-import@v1.0
with:
ci_run_id: ${{ github.run_id }}
report_file: sbom.json
workflow_id: "77870259287eac45b40e65decf2207c3"
scan_type: SBOM
scanner: cdxgen
backend_api_token: ${{ secrets.SCANDOG_BACKEND_API_TOKEN }}
backend_url: ${{ secrets.SCANDOG_BACKEND_URL }}
# Jobs from template: Trivy
scandog_trivy_scan_a:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: rabbitmq:management
format: 'json'
output: 'trivy-results.json'
- name: Import results to ScanDog
uses: scandogio/scandog-import@v1.0
with:
ci_run_id: ${{ github.run_id }}
report_file: trivy-results.json
workflow_id: "77870259287eac45b40e65decf2207c3"
scan_type: Container Scanner
scanner: Trivy
backend_api_token: ${{ secrets.SCANDOG_BACKEND_API_TOKEN }}
backend_url: ${{ secrets.SCANDOG_BACKEND_URL }}
# Jobs from template: checkov
scandog_checkov_scan:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkov GitHub Action
uses: bridgecrewio/checkov-action@v12
with:
soft_fail: true
output_format: json
output_file_path: .
- name: Import results to ScanDog
uses: scandogio/scandog-import@v1.0
with:
ci_run_id: ${{ github.run_id }}
report_file: results_json.json
workflow_id: "77870259287eac45b40e65decf2207c3"
scan_type: IaC Scanner
scanner: checkov
backend_api_token: ${{ secrets.SCANDOG_BACKEND_API_TOKEN }}
backend_url: ${{ secrets.SCANDOG_BACKEND_URL }}
# Jobs from template: Trivy
scandog_trivy_scan_b:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: .
format: 'json'
output: 'trivy-results.json'
scanners: 'misconfig'
- name: Import results to ScanDog
uses: scandogio/scandog-import@v1.0
with:
ci_run_id: ${{ github.run_id }}
report_file: trivy-results.json
workflow_id: "77870259287eac45b40e65decf2207c3"
scan_type: IaC Scanner
scanner: Trivy
backend_api_token: ${{ secrets.SCANDOG_BACKEND_API_TOKEN }}
backend_url: ${{ secrets.SCANDOG_BACKEND_URL }}
# Jobs from template: osv-scanner
scandog_osv_scanner_scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install osv-scanner
run: |
sudo apt-get update
sudo apt-get install -y snapd
sudo snap install osv-scanner
- name: Run osv-scanner
run: osv-scanner scan . --json osv-results.json
- name: Import results to ScanDog
uses: scandogio/scandog-import@v1.0
with:
ci_run_id: ${{ github.run_id }}
report_file: osv-results.json
workflow_id: "77870259287eac45b40e65decf2207c3"
scan_type: SCA
scanner: osv-scanner
backend_api_token: ${{ secrets.SCANDOG_BACKEND_API_TOKEN }}
backend_url: ${{ secrets.SCANDOG_BACKEND_URL }}
# Jobs from template: Trufflehog
scandog_trufflehog_scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install & Run Trufflehog
run: |
curl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh | sh -s -- -b /usr/local/bin
trufflehog filesystem --json . > trufflehog.json
- name: Import results to ScanDog
uses: scandogio/scandog-import@v1.0
with:
ci_run_id: ${{ github.run_id }}
report_file: trufflehog.json
workflow_id: "77870259287eac45b40e65decf2207c3"
scan_type: Secret Scanning
scanner: trufflehog
backend_api_token: ${{ secrets.SCANDOG_BACKEND_API_TOKEN }}
backend_url: ${{ secrets.SCANDOG_BACKEND_URL }}
# Jobs from template: opengrep
scandog_opengrep_scan:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Opengrep
run: |
apt-get update && apt-get install -y curl jq
latest_version=$(curl --silent "https://api.github.com/repos/opengrep/opengrep/releases/latest" | jq -r .tag_name)
curl -L -o opengrep "https://github.com/opengrep/opengrep/releases/download/${latest_version}/opengrep_manylinux_x86"
chmod +x opengrep
mv opengrep /usr/local/bin/opengrep
- name: Run Opengrep
run: opengrep scan --config auto --json-output=opengrep.json .
- name: Import results to ScanDog
uses: scandogio/scandog-import@v1.0
with:
ci_run_id: ${{ github.run_id }}
report_file: opengrep.json
workflow_id: "77870259287eac45b40e65decf2207c3"
scan_type: SAST
scanner: opengrep
backend_api_token: ${{ secrets.SCANDOG_BACKEND_API_TOKEN }}
backend_url: ${{ secrets.SCANDOG_BACKEND_URL }}