generated from finos-labs/project-blueprint
-
Notifications
You must be signed in to change notification settings - Fork 58
169 lines (164 loc) · 5.26 KB
/
security.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
name: CVE Scanning
on:
workflow_dispatch:
schedule:
- cron: '0 8,18 * * 1-5'
push:
paths:
- '**/build.gradle'
- '**/package.json'
- '**/package-lock.json'
- '**/*.csproj'
- '**/Dockerfile'
- '.github/workflows/*-ignore-list.xml'
- '.github/workflows/security.yml'
jobs:
node-modules-scan:
name: ${{ matrix.module-folder }}-node-scan
runs-on: ubuntu-latest
continue-on-error: false
strategy:
matrix:
module-folder: [
'reference-data',
'trade-feed',
'web-front-end/angular',
'web-front-end/react']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Build project with NPM
run: npm install --omit=dev
working-directory: ${{ matrix.module-folder }}
- name: Depcheck
uses: dependency-check/Dependency-Check_Action@main
id: Depcheck
with:
project: '${{ matrix.module-folder }}'
path: '${{ matrix.module-folder }}'
format: 'HTML'
out: '${{ matrix.module-folder }}-reports'
args: >
--suppression .github/node-cve-ignore-list.xml
--nodeAuditSkipDevDependencies
--nodePackageSkipDevDependencies
--failOnCVSS 5
--enableRetired
- run: |
echo `echo UPNAME=${{matrix.module-folder}} | tr '/' '-'` >> $GITHUB_ENV
shell: bash
- name: Upload Test results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: Depcheck report ${{ env.UPNAME }}
path: ${{ github.workspace }}/${{ matrix.module-folder }}-reports
dotnet-modules-scan:
name: ${{ matrix.module-folder }}-dotnet-scan
runs-on: ubuntu-latest
continue-on-error: false
strategy:
matrix:
module-folder: ['people-service']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build project with dotnet
run: dotnet build --configuration Release
working-directory: ${{ matrix.module-folder }}
- name: List vulnerable libraries
run: dotnet list package --vulnerable --include-transitive
working-directory: ${{ matrix.module-folder }}
- name: Depcheck
uses: dependency-check/Dependency-Check_Action@main
id: Depcheck
with:
project: '${{ matrix.module-folder }}'
path: '${{ matrix.module-folder }}'
format: 'HTML'
out: '${{ matrix.module-folder }}-reports'
args: >
--suppression .github/dotnet-cve-ignore-list.xml
--failOnCVSS 5
--enableRetired
- name: Upload Test results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: Depcheck report ${{ github.job }} ${{ github.job_workflow_sha}}
path: ${{ github.workspace }}/${{ matrix.module-folder }}-reports
gradle-modules-scan:
name: ${{ matrix.module-folder }}-gradle-scan
runs-on: ubuntu-latest
continue-on-error: false
strategy:
matrix:
module-folder: [
'account-service',
'database',
'position-service',
'trade-processor',
'trade-service',]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
- name: Build project with Gradle
run: gradle clean build
working-directory: ${{ matrix.module-folder }}
- name: Depcheck
uses: dependency-check/Dependency-Check_Action@main
id: Depcheck
env:
JAVA_HOME: /opt/jdk
with:
project: '${{ matrix.module-folder }}'
path: '${{ matrix.module-folder }}'
format: 'HTML'
out: '${{ matrix.module-folder }}-reports'
args: >
--suppression .github/gradle-cve-ignore-list.xml
--failOnCVSS 5
--enableRetired
- name: Upload Test results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: Depcheck report ${{ github.job }} ${{ matrix.module-folder }}
path: ${{ github.workspace }}/${{ matrix.module-folder }}-reports
dockerfile-scan:
name: ${{ matrix.module-folder }}-dockerfile-scan
runs-on: ubuntu-latest
continue-on-error: false
strategy:
matrix:
module-folder: [
'trade-processor',
'database',
'account-service',
'trade-feed',
'position-service',
'trade-service',
'web-front-end/angular',
'people-service',
'reference-data']
steps:
- uses: actions/checkout@v4
- uses: docker-practice/actions-setup-docker@master
- name: Build
run: docker build -f Dockerfile -t user/app:latest .
working-directory: ${{ matrix.module-folder }}
- name: Scan for vulnerabilities
uses: crazy-max/ghaction-container-scan@v3
with:
image: user/app:latest
dockerfile: ./Dockerfile
severity: HIGH