Skip to content

Commit

Permalink
update Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
pcaskey committed Nov 3, 2022
1 parent 3416367 commit dcb0c6a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,16 @@ pipeline {
script {
try {
echo "Starting security scan..."
maintainer = maintain()
imagename = imagename()
// Install trivy and HTML template
sh 'curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v0.31.1'
sh 'curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/html.tpl > html.tpl'

// Scan container for all vulnerability levels
echo "Scanning for all vulnerabilities..."
sh 'mkdir -p reports'
sh 'docker pull ${maintainer}/${imagename}:${tag}'
//sh 'docker pull ${maintainer}/${imagename}:${tag}'
sh 'trivy image --ignore-unfixed --vuln-type os,library --severity CRITICAL,HIGH --no-progress --security-checks vuln --format template --template \'@html.tpl\' -o reports/container-scan.html ${maintainer}/${imagename}:${tag}'
publishHTML target : [
allowMissing: true,
Expand Down

0 comments on commit dcb0c6a

Please sign in to comment.