forked from ErdemOzgen/blackdagger
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (71 loc) · 2.01 KB
/
DevSecOps.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
name: Run Gosec and ZAP Scan
on:
workflow_dispatch:
jobs:
tests:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- name: Set up Nodejs
uses: actions/setup-node@v3
with:
node-version: 20
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21.x
- name: Install Protoc
uses: arduino/setup-protoc@v2
- name: Checkout Source
id: checkout
uses: actions/checkout@v3
- name: Generate SBOM
id: sbom
uses: anchore/sbom-action@v0
- name: GitLeaks
id: gitleaks
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run Gosec Security Scanner
id: gosec
uses: securego/gosec@master
with:
args: '-no-fail -fmt sarif -out results.sarif ./...'
- name: Save Gosec output as artifact
uses: actions/upload-artifact@v3
with:
name: gosec-results
path: results.sarif
- name: Depcheck
uses: dependency-check/Dependency-Check_Action@main
id: Depcheck
with:
project: 'test'
path: '.'
format: 'HTML'
out: 'reports'
args: >
--enableRetired
- name: Upload Test results
uses: actions/upload-artifact@master
with:
name: Depcheck report
path: ${{github.workspace}}/reports
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
- name: Build App
run: go build -o blackdagger main.go
- name: Change Permissions
run: chmod +x blackdagger
- name: Start App
run: './blackdagger server & sleep 10'
- name: ZAP Full Scan
id: zap-scan
uses: zaproxy/action-full-scan@v0.10.0
with:
token: ${{ secrets.github_token }}
target: http://localhost:8080