fix(ci): uppdatera security-workflow till kanonisk mall (volymscan + låsfils-guard)
This commit is contained in:
@@ -59,9 +59,20 @@ jobs:
|
||||
# Trivy filsystem, blockerar på HIGH och CRITICAL (SUP-*)
|
||||
- name: Trivy filesystem scan
|
||||
run: |
|
||||
# node_modules/dist/.next/vendor skannas inte: de är byggartefakter,
|
||||
# inte källkod. --ignorefile används bara när repot har en granskad
|
||||
# .trivyignore (annars faller trivy på en saknad fil).
|
||||
docker run --rm -v "$SCAN_VOLUME:/repo" -w /repo \
|
||||
aquasec/trivy:latest fs --scanners vuln,secret,misconfig \
|
||||
--severity HIGH,CRITICAL --exit-code 1 --no-progress /repo
|
||||
aquasec/trivy:latest sh -c '
|
||||
set -e
|
||||
common="fs --scanners vuln,secret,misconfig --severity HIGH,CRITICAL --exit-code 1 --no-progress \
|
||||
--skip-dirs /repo/node_modules --skip-dirs /repo/.next --skip-dirs /repo/dist \
|
||||
--skip-dirs /repo/build --skip-dirs /repo/vendor --skip-dirs /repo/.git"
|
||||
if [ -f /repo/.trivyignore ]; then
|
||||
trivy $common --ignorefile /repo/.trivyignore /repo
|
||||
else
|
||||
trivy $common /repo
|
||||
fi'
|
||||
|
||||
# Kända sårbarheter i låsfilen. osv-scanner 2.x hittar inte alltid
|
||||
# osv-scanner.toml själv, så den skickas explicit när den finns.
|
||||
|
||||
Reference in New Issue
Block a user