Skip to content

Commit

Permalink
remove -pkg-types because it creates empty file if no vulnerability i…
Browse files Browse the repository at this point in the history
…n the jar
  • Loading branch information
valenad1 committed Aug 7, 2024
1 parent 2577fe2 commit 2a480bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 1 addition & 3 deletions docker/prisma/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM alpine:latest
RUN apk update && apk upgrade && apk add openjdk8 nodejs npm git curl
RUN apk update && apk upgrade && apk add openjdk8 nodejs npm git

ENV DIRECTORIES=".config .npm .cache .local"

Expand All @@ -8,6 +8,4 @@ RUN for dir in $DIRECTORIES; do \
chown -R 2117:2117 /$dir; \
done

RUN curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin

CMD ["/bin/bash"]
7 changes: 4 additions & 3 deletions scripts/jenkins/jenkinsfiles/Jenkinsfile-PrismaScan
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@Library('test-shared-library') _

def dockerImage
def trivyVersion = "0.54.1"

def setPrismaScanningStages(assemblyType, stageIndex) {
branchName = "${env.BRANCH_NAME}".replace('/', '-')
Expand All @@ -15,7 +16,7 @@ def setPrismaScanningStages(assemblyType, stageIndex) {
}
stage ("${stageIndex}.B. Scan ${assemblyType} jar using Trivy") {
script {
sh "./trivy image --pkg-types library ${assemblyImage} --output ${assemblyImage}-trivy.out"
sh "./trivy image ${assemblyImage} --output ${assemblyImage}-trivy.out"
}
archiveArtifacts artifacts: "${assemblyImage}-trivy.out"
}
Expand Down Expand Up @@ -60,8 +61,8 @@ pipeline {
dir("docker/prisma"){
dockerImage = docker.build("node-java","-f Dockerfile .")
}
sh "wget https://github.com/aquasecurity/trivy/releases/download/v0.54.1/trivy_0.54.1_Linux-64bit.tar.gz"
sh "tar -zxvf trivy_0.54.1_Linux-64bit.tar.gz"
sh "wget https://github.com/aquasecurity/trivy/releases/download/v${trivyVersion}/trivy_${trivyVersion}_Linux-64bit.tar.gz"
sh "tar -zxvf trivy_${trivyVersion}_Linux-64bit.tar.gz"
sh "chmod +x ./trivy"
}

Expand Down

0 comments on commit 2a480bc

Please sign in to comment.