generated from SocialGouv/dashlord
-
Notifications
You must be signed in to change notification settings - Fork 0
214 lines (191 loc) · 6.29 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
name: DashLord scans
on:
workflow_dispatch:
inputs:
url:
description: "Single url to scan or scan all urls"
required: false
default: ""
schedule:
- cron: "0 0 * * 0" # see https://crontab.guru
push:
branches:
- master
- main
paths:
- 'dashlord.yaml'
- 'dashlord.yml'
- 'urls.txt'
# allow only one concurrent scan action
concurrency:
cancel-in-progress: true
group: scans
jobs:
init:
runs-on: ubuntu-latest
name: Prepare
outputs:
sites: ${{ steps.init.outputs.sites }}
config: ${{ steps.init.outputs.config }}
steps:
- uses: actions/checkout@v2
- id: init
uses: "SocialGouv/dashlord-actions/init@main"
with:
url: ${{ github.event.inputs.url }}
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@v2
- run: |
mkdir scans
- uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Detect 404s
continue-on-error: true
uses: "socialgouv/detect-404-action@master"
if: ${{ matrix.sites.tools['404'] }}
with:
url: ${{ matrix.sites.url }}
output: scans/404.json
- name: Screenshot Website
uses: swinton/screenshot-website@v1.x
if: ${{ matrix.sites.tools.screenshot }}
timeout-minutes: 10
with:
source: "${{ matrix.sites.url }}"
destination: screenshot.jpeg
- name: Stats page
continue-on-error: true
uses: "MTES-MCT/stats-action@main"
if: ${{ matrix.sites.tools.stats }}
with:
url: ${{ matrix.sites.url }}
uri: 'stats'
output: scans/stats.json
- name: Wappalyzer scan
uses: "socialgouv/wappalyzer-action@master"
timeout-minutes: 10
if: ${{ matrix.sites.tools.wappalyzer }}
continue-on-error: true
with:
url: "${{ matrix.sites.url }}"
output: scans/wappalyzer.json
- name: ZAP Scan
uses: zaproxy/action-baseline@v0.4.0
timeout-minutes: 10
if: ${{ matrix.sites.tools.zap }}
continue-on-error: true
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
continue-on-error: true
timeout-minutes: 10
uses: treosh/lighthouse-ci-action@v7
if: ${{ matrix.sites.tools.lighthouse }}
with:
urls: "${{ matrix.sites.url }}"
uploadArtifacts: false
temporaryPublicStorage: false
configPath: "./lighthouserc.json"
- name: Mozilla HTTP Observatory
timeout-minutes: 10
if: ${{ matrix.sites.tools.http }}
continue-on-error: true
uses: SocialGouv/httpobs-action@master
with:
url: "${{ matrix.sites.url }}"
output: "scans/http.json"
- name: Third-party scripts scan
timeout-minutes: 10
if: ${{ matrix.sites.tools.thirdparties }}
continue-on-error: true
uses: SocialGouv/thirdparties-action@master
with:
url: "${{ matrix.sites.url }}"
output: "scans/thirdparties.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
timeout-minutes: 10
continue-on-error: true
uses: "mbogh/test-ssl-action@v1.1"
if: ${{ matrix.sites.tools.testssl }}
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
timeout-minutes: 10
continue-on-error: true
uses: "SocialGouv/dashlord-nuclei-action@master"
if: ${{ matrix.sites.tools.nuclei }}
with:
url: ${{ matrix.sites.url }}
output: "scans/nuclei.log"
- name: Updown.io checks
continue-on-error: true
timeout-minutes: 10
uses: "MTES-MCT/updownio-action@main"
if: ${{ matrix.sites.tools.updownio }}
with:
apiKey: ${{ secrets.UPDOWNIO_API_KEY }}
url: ${{ matrix.sites.url }}
output: scans/updownio.json
- name: Dependabot vulnerabilities alerts
continue-on-error: true
timeout-minutes: 10
uses: "MTES-MCT/dependabotalerts-action@main"
if: ${{ matrix.sites.tools.dependabot && matrix.sites.repositories }}
with:
token: ${{ secrets.DEPENDABOTALERTS_TOKEN }}
repositories: ${{ join(matrix.sites.repositories) }}
output: scans/dependabotalerts.json
- name: Code quality alerts
continue-on-error: true
timeout-minutes: 10
uses: "MTES-MCT/codescanalerts-action@main"
if: ${{ matrix.sites.tools.codescan && matrix.sites.repositories }}
with:
token: ${{ secrets.CODESCANALERTS_TOKEN }}
repositories: ${{ join(matrix.sites.repositories) }}
output: scans/codescanalerts.json
- uses: SocialGouv/dashlord-actions/save@main
with:
url: ${{ matrix.sites.url }}
- uses: EndBug/add-and-commit@v7
with:
add: '["results"]'
author_name: ${{ secrets.SOCIALGROOVYBOT_NAME }}
author_email: ${{ secrets.SOCIALGROOVYBOT_EMAIL }}
message: "update: ${{ matrix.sites.url }}"