-
Notifications
You must be signed in to change notification settings - Fork 6
167 lines (150 loc) · 4.9 KB
/
devguard-scanner.yaml
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
# DevSecOps Workflow Definition
# This workflow is triggered on every push to the repository
name: DevGuard-Workflow
on:
push:
jobs:
# Secret scanning job to detect secrets in codebase
secret-scanning:
uses: l3montree-dev/devguard-action/.github/workflows/secret-scanning.yml@main
sast:
uses: l3montree-dev/devguard-action/.github/workflows/sast.yml@main
sca:
uses: l3montree-dev/devguard-action/.github/workflows/software-composition-analysis.yml@main
with:
asset-name: l3montree-cybersecurity/projects/devguard/assets/devguard
api-url: https://api.main.devguard.org
secrets:
devguard-token: ${{ secrets.DEVGUARD_TOKEN }}
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
args: --timeout=30m
version: v1.60
tests:
name: tests
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Run unittests
run: go test ./... -cover
# Docker image build job
build-image:
uses: l3montree-dev/devguard-action/.github/workflows/build-image.yml@main
with:
asset-name: l3montree-cybersecurity/projects/devguard/assets/devguard
api-url: https://api.main.devguard.org
secrets:
devguard-token: ${{ secrets.DEVGUARD_TOKEN }}
build-scanner-image:
uses: l3montree-dev/devguard-action/.github/workflows/build-image.yml@main
with:
image-suffix: "-scanner"
artifact-suffix: "-scanner"
asset-name: l3montree-cybersecurity/projects/devguard/assets/devguard-scanner
api-url: https://api.main.devguard.org
secrets:
devguard-token: ${{ secrets.DEVGUARD_TOKEN }}
build-args: "--context=. --dockerfile=Dockerfile.scanner"
# Image scanning job to detect vulnerabilities in the built Docker image
container-scanning:
uses: l3montree-dev/devguard-action/.github/workflows/container-scanning.yml@main
needs:
- build-image
with:
asset-name: l3montree-cybersecurity/projects/devguard/assets/devguard
api-url: https://api.main.devguard.org
secrets:
devguard-token: ${{ secrets.DEVGUARD_TOKEN }}
# Image scanning job to detect vulnerabilities in the built Docker image
scanner-container-scanning:
uses: l3montree-dev/devguard-action/.github/workflows/container-scanning.yml@main
needs:
- build-scanner-image
with:
asset-name: l3montree-cybersecurity/projects/devguard/assets/devguard-scanner
api-url: https://api.main.devguard.org
artifact-suffix: "-scanner"
secrets:
devguard-token: ${{ secrets.DEVGUARD_TOKEN }}
deploy:
needs:
- build-image
- container-scanning
- secret-scanning
- sca
- sast
- golangci
- tests
uses: l3montree-dev/devguard-action/.github/workflows/deploy.yml@main
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
with:
asset-name: l3montree-cybersecurity/projects/devguard/assets/devguard
api-url: https://api.main.devguard.org
secrets:
devguard-token: ${{ secrets.DEVGUARD_TOKEN }}
deploy-scanner:
needs:
- build-scanner-image
- scanner-container-scanning
- secret-scanning
- sca
- sast
- golangci
- tests
uses: l3montree-dev/devguard-action/.github/workflows/deploy.yml@main
with:
artifact-suffix: "-scanner"
image-suffix: "-scanner"
asset-name: l3montree-cybersecurity/projects/devguard/assets/devguard
api-url: https://api.main.devguard.org
secrets:
devguard-token: ${{ secrets.DEVGUARD_TOKEN }}
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
sign:
needs:
- build-image
- container-scanning
- secret-scanning
- sca
- sast
- golangci
- tests
uses: l3montree-dev/devguard-action/.github/workflows/sign.yml@main
with:
asset-name: l3montree-cybersecurity/projects/devguard/assets/devguard
api-url: https://api.main.devguard.org
secrets:
devguard-token: ${{ secrets.DEVGUARD_TOKEN }}
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
sign-scanner:
needs:
- build-scanner-image
- scanner-container-scanning
- secret-scanning
- sca
- sast
- golangci
- tests
uses: l3montree-dev/devguard-action/.github/workflows/sign.yml@main
with:
asset-name: l3montree-cybersecurity/projects/devguard/assets/devguard-scanner
api-url: https://api.main.devguard.org
artifact-suffix: "-scanner"
secrets:
devguard-token: ${{ secrets.DEVGUARD_TOKEN }}
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')