generated from SocialGouv/dashlord
-
Notifications
You must be signed in to change notification settings - Fork 17
293 lines (265 loc) · 8.99 KB
/
scans.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
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
287
288
289
290
291
292
293
name: DashLord scans
on:
workflow_dispatch:
inputs:
url:
description: "Single url to scan or scan all urls"
required: false
default: ""
tool:
description: "Single tool to run or use all tools"
type: choice
default: all
options:
- all
- codescan
- dependabot
- ecoindex
- lighthouse
- sonarcloud
- trivy
- zap
- ecoindex
- dsfr
- declaration-a11y
- declaration-rgpd
schedule:
- cron: "0 0 * * 0" # At 00:00 on Sunday
jobs:
init:
runs-on: ubuntu-latest
name: Prepare
outputs:
sites: ${{ steps.init.outputs.sites }}
config: ${{ steps.init.outputs.config }}
steps:
- uses: actions/checkout@v4
- id: init
uses: "SocialGouv/dashlord-actions/init@v1"
with:
url: ${{ github.event.inputs.url }}
tool: ${{ github.event.inputs.tool }}
- id: updown-init
uses: "SocialGouv/dashlord-actions/updown-init@v1"
env:
UPDOWNIO_API_KEY: ${{ secrets.UPDOWNIO_API_KEY }}
scans:
runs-on: ubuntu-latest
name: Scan
needs: init
continue-on-error: true
strategy:
fail-fast: false
max-parallel: 3
matrix:
sites: ${{ fromJson(needs.init.outputs.sites) }}
steps:
- uses: actions/checkout@v4
- run: |
mkdir scans
- uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: dsfr
continue-on-error: true
timeout-minutes: 10
uses: "socialgouv/dashlord-actions/dsfr@v1"
if: ${{ matrix.sites.tools.dsfr }}
with:
url: ${{ matrix.sites.url }}
output: scans/dsfr.json
- name: eco-index
continue-on-error: true
timeout-minutes: 10
uses: "socialgouv/dashlord-actions/ecoindex@v1"
if: ${{ matrix.sites.tools.ecoindex }}
with:
url: ${{ matrix.sites.url }}
output: scans/ecoindex.json
- name: Screenshot Website
if: ${{ matrix.sites.tools.screenshot }}
uses: swinton/[email protected]
continue-on-error: true
timeout-minutes: 10
with:
source: "${{ matrix.sites.url }}"
type: jpeg
destination: screenshot.jpeg
width: 1280
scaleFactor: 0.5
- name: Déclaration a11y
continue-on-error: true
timeout-minutes: 10
uses: "socialgouv/dashlord-actions/declaration-a11y@v1"
if: ${{ matrix.sites.tools['declaration-a11y'] }}
with:
url: ${{ matrix.sites.url }}
output: scans/declaration-a11y.json
- name: Wappalyzer scan
if: ${{ matrix.sites.tools.wappalyzer }}
uses: "socialgouv/wappalyzer-action@master"
continue-on-error: true
timeout-minutes: 10
with:
url: "${{ matrix.sites.url }}"
output: scans/wappalyzer.json
- name: ZAP Scan
if: ${{ matrix.sites.tools.zap }}
uses: zaproxy/[email protected]
continue-on-error: true
timeout-minutes: 10
with:
token: "" # disable issue creation
rules_file_name: "zap-rules.tsv"
docker_name: "owasp/zap2docker-stable"
target: "${{ matrix.sites.url }}"
cmd_options: "-a"
- name: Lighthouse scan
if: ${{ matrix.sites.tools.lighthouse }}
continue-on-error: true
timeout-minutes: 20
uses: SocialGouv/dashlord-actions/lhci@v1
with:
url: "${{ join(matrix.sites.subpages, ',') }}"
- name: Mozilla HTTP Observatory
if: ${{ matrix.sites.tools.http }}
continue-on-error: true
id: http
timeout-minutes: 10
uses: SocialGouv/httpobs-action@master
with:
url: "${{ matrix.sites.url }}"
output: "scans/http.json"
- name: Mozilla HTTP Observatory retry
if: steps.http.outcome=='failure'
continue-on-error: true
timeout-minutes: 10
uses: SocialGouv/httpobs-action@master
with:
url: "${{ matrix.sites.url }}"
output: "scans/http.json"
- name: Third-party scripts scan
if: ${{ matrix.sites.tools.thirdparties }}
continue-on-error: true
timeout-minutes: 10
uses: SocialGouv/thirdparties-action@master
id: thirdparties
with:
url: "${{ matrix.sites.url }}"
output: "scans/thirdparties.json"
- name: Déclaration RGPD
continue-on-error: true
uses: SocialGouv/dashlord-actions/declaration-rgpd@v1
if: ${{ matrix.sites.tools['declaration-rgpd'] }}
with:
thirdparties: ${{ steps.thirdparties.outputs.json }}
url: ${{ matrix.sites.url }}
output: scans/declaration-rgpd.json
# testssl.sh action needs an hostname to save its output so we build it here
- name: Extract hostname
id: hostname
run: |
HOSTNAME=$(echo "${{ matrix.sites.url }}" | sed -e 's/[^/]*\/\/\([^@]*@\)\?\([^:/]*\).*/\2/')
echo "::set-output name=value::$HOSTNAME"
- name: testssl.sh scan
if: ${{ matrix.sites.tools.testssl }}
continue-on-error: true
timeout-minutes: 10
uses: "mbogh/[email protected]"
with:
host: ${{ steps.hostname.outputs.value }}
output: scans
grade: "F"
options: "--fast"
- name: nmap vulnerabilities scan
if: ${{ matrix.sites.tools.nmap }}
continue-on-error: true
timeout-minutes: 10
uses: "MTES-MCT/nmap-action@main"
with:
host: ${{ steps.hostname.outputs.value }}
outputDir: "scans"
outputFile: "nmapvuln.json"
withVulnerabilities: true
raw: false
- name: Nuclei scan
if: ${{ matrix.sites.tools.nuclei }}
continue-on-error: true
timeout-minutes: 10
uses: "SocialGouv/dashlord-nuclei-action@master"
with:
url: ${{ matrix.sites.url }}
output: "scans/nuclei.log"
- name: Updown.io checks
if: ${{ matrix.sites.tools.updownio }}
continue-on-error: true
timeout-minutes: 10
uses: "MTES-MCT/updownio-action@main"
with:
apiKey: ${{ secrets.UPDOWNIO_API_KEY }}
url: ${{ matrix.sites.url }}
output: scans/updownio.json
- name: Betagouv API scan
if: ${{ matrix.sites.tools.betagouv }}
continue-on-error: true
timeout-minutes: 10
id: betagouv
uses: betagouv/dashlord-startup-action@main
with:
id: "${{ matrix.sites.betaId }}"
output: "scans/betagouv.json"
- name: Stats page
continue-on-error: true
timeout-minutes: 10
uses: "SocialGouv/dashlord-actions/check-url@v1"
if: ${{ matrix.sites.tools.stats }}
with:
url: ${{ steps.betagouv.outputs.stats_url }}
output: scans/stats.json
- name: Budget page
continue-on-error: true
timeout-minutes: 10
uses: "SocialGouv/dashlord-actions/check-url@v1"
if: ${{ matrix.sites.tools.budget_page }}
with:
url: ${{ steps.betagouv.outputs.budget_url }}
output: scans/budget_page.json
- name: Open Github repository
continue-on-error: true
timeout-minutes: 10
uses: "SocialGouv/dashlord-actions/check-url@v1"
if: ${{ matrix.sites.tools.betagouv }}
with:
url: ${{ steps.betagouv.outputs.github_repository }}
output: scans/github_repository.json
- name: Dependabot vulnerabilities alerts
continue-on-error: true
timeout-minutes: 10
if: ${{ matrix.sites.tools.dependabot && matrix.sites.repositories }}
uses: "MTES-MCT/dependabotalerts-action@main"
with:
token: ${{ secrets.DEPENDABOTALERTS_TOKEN }}
repositories: ${{ join(matrix.sites.repositories) }}
output: scans/dependabotalerts.json
- name: Code quality alerts
if: ${{ matrix.sites.tools.codescan && matrix.sites.repositories }}
continue-on-error: true
timeout-minutes: 10
uses: "MTES-MCT/codescanalerts-action@main"
with:
token: ${{ secrets.CODESCANALERTS_TOKEN }}
repositories: ${{ join(matrix.sites.repositories) }}
output: scans/codescanalerts.json
- uses: SocialGouv/dashlord-actions/save@v1
with:
url: ${{ matrix.sites.url }}
# only clean up previous stats when all tools runned
cleanup: ${{ github.event.inputs.tool == 'all' && true || false }}
- uses: EndBug/add-and-commit@v9
with:
add: "results"
author_name: "DashlordBetaGouvBot"
author_email: "[email protected]"
message: "update: ${{ matrix.sites.url }}"
pull: "--rebase --autostash"