Skip to content

Commit 4fbcb2a

Browse files
author
Mathias
committed
trivy fix
1 parent a6b9744 commit 4fbcb2a

1 file changed

Lines changed: 60 additions & 27 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 60 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -120,34 +120,67 @@ jobs:
120120
needs: build-and-push
121121
runs-on: ubuntu-latest
122122
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
123-
123+
permissions:
124+
contents: read
125+
security-events: write
124126
steps:
125-
- name: Run Trivy vulnerability scanner
126-
uses: aquasecurity/trivy-action@master
127-
with:
128-
image-ref: ${{ env.DOCKER_IMAGE }}:latest
129-
format: 'sarif'
130-
output: 'trivy-results.sarif'
131-
severity: 'CRITICAL,HIGH'
132-
133-
- name: Upload Trivy results to GitHub Security
134-
uses: github/codeql-action/upload-sarif@v2
135-
if: always()
136-
with:
137-
sarif_file: 'trivy-results.sarif'
138-
139-
- name: Run npm audit
140-
uses: actions/checkout@v4
141-
142-
- name: Setup Node.js
143-
uses: actions/setup-node@v4
144-
with:
145-
node-version: ${{ env.NODE_VERSION }}
146-
147-
- name: NPM Audit
148-
run: |
149-
npm audit --audit-level=high
150-
continue-on-error: true
127+
- name: Checkout code
128+
uses: actions/checkout@v4
129+
- name: Run Trivy vulnerability scanner
130+
uses: aquasecurity/trivy-action@master
131+
with:
132+
image-ref: ${{ env.DOCKER_IMAGE }}:latest
133+
format: sarif
134+
output: trivy-results.sarif
135+
severity: CRITICAL,HIGH
136+
- name: Upload Trivy results to GitHub Security
137+
uses: github/codeql-action/upload-sarif@v3
138+
if: always()
139+
with:
140+
sarif_file: trivy-results.sarif
141+
- name: Setup Node.js
142+
uses: actions/setup-node@v4
143+
with:
144+
node-version: ${{ env.NODE_VERSION }}
145+
cache: npm
146+
- name: Install dependencies
147+
run: npm ci
148+
- name: NPM Audit
149+
run: npm audit --audit-level=high
150+
continue-on-error: true
151+
# security-scan:
152+
# name: Security Scan
153+
# needs: build-and-push
154+
# runs-on: ubuntu-latest
155+
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
156+
157+
# steps:
158+
# - name: Run Trivy vulnerability scanner
159+
# uses: aquasecurity/trivy-action@master
160+
# with:
161+
# image-ref: ${{ env.DOCKER_IMAGE }}:latest
162+
# format: 'sarif'
163+
# output: 'trivy-results.sarif'
164+
# severity: 'CRITICAL,HIGH'
165+
166+
# - name: Upload Trivy results to GitHub Security
167+
# uses: github/codeql-action/upload-sarif@v2
168+
# if: always()
169+
# with:
170+
# sarif_file: 'trivy-results.sarif'
171+
172+
# - name: Run npm audit
173+
# uses: actions/checkout@v4
174+
175+
# - name: Setup Node.js
176+
# uses: actions/setup-node@v4
177+
# with:
178+
# node-version: ${{ env.NODE_VERSION }}
179+
180+
# - name: NPM Audit
181+
# run: |
182+
# npm audit --audit-level=high
183+
# continue-on-error: true
151184

152185
notify:
153186
name: Notification

0 commit comments

Comments
 (0)