added report creation for trivy image scan
Some checks failed
Tests / Declarative: Post Actions passed: 1
csharp-secdevops-pipeline-pod/pipeline/head There was a failure building this commit

This commit is contained in:
2026-05-07 11:43:48 +02:00
parent 4106136782
commit 83ff4e89e9

16
Jenkinsfile vendored
View File

@@ -122,15 +122,23 @@ pipeline {
when {
branch 'master'
}
steps {
container('trivy') {
// Scannt das frisch gepushte Image direkt aus deiner Gitea Registry
// Das Flag '--insecure' erlaubt Trivy den Zugriff über die unverschlüsselte IP
// 1. Scan ausführen und als HTML-Report speichern (Achte auf den neuen Dateinamen)
sh '''
trivy image --insecure \
--severity HIGH,CRITICAL \
--format template \
--template "@/contrib/html.tpl" \
-o reports/trivy-image-report.html \
130.61.26.230:30080/dev-master/secdevops-csharp-app:latest
'''
// 2. Den Scan ein zweites Mal kurz ohne Report ausführen, damit die Pipeline bei Lücken blockiert
sh 'trivy image --insecure --exit-code 1 --severity HIGH,CRITICAL 130.61.26.230:30080/dev-master/secdevops-csharp-app:latest'
}
}
}
}
}
post {