generated from SocialGouv/dashlord
-
Notifications
You must be signed in to change notification settings - Fork 0
195 lines (175 loc) · 5.73 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
name: DashLord scans
on:
workflow_dispatch:
inputs:
url:
description: "Single url to scan or scan all urls"
required: false
default: ""
push:
branches:
- master
- main
paths:
- 'dashlord.yaml'
- 'dashlord.yml'
- 'urls.txt'
schedule:
- cron: "5 4 * * *"
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@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@v4
- run: |
mkdir scans
- uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Screenshot Website
uses: swinton/screenshot-website@v1.x
if: ${{ matrix.sites.tools.screenshot }}
timeout-minutes: 10
with:
source: "${{ matrix.sites.url }}"
type: jpeg
destination: screenshot.jpeg
width: 1280
scaleFactor: 0.5
- 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.14.0
timeout-minutes: 10
if: ${{ matrix.sites.tools.zaproxy }}
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@v12
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.httpobs }}
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: 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
- name: nmap vulnerabilities scan
if: ${{ matrix.sites.tools.nmap }}
timeout-minutes: 10
continue-on-error: true
uses: "MTES-MCT/nmap-action@main"
with:
host: ${{ steps.hostname.outputs.value }}
outputDir: "scans"
outputFile: "nmapvuln.json"
withVulnerabilities: true
raw: false
- uses: SocialGouv/dashlord-actions/save@main
with:
url: ${{ matrix.sites.url }}
- uses: EndBug/add-and-commit@v9
with:
add: '["results"]'
default_author: github_actions
default_email: actions@github.com
message: "update: ${{ matrix.sites.url }}"