feat(Container-Scan) set Severity to High and Critical at the same time
This commit is contained in:
parent
c058a1fb1b
commit
ffc89b4dd7
@ -3,16 +3,14 @@
|
|||||||
stage: test
|
stage: test
|
||||||
variables:
|
variables:
|
||||||
TRIVY_VERSION: 0.18.3
|
TRIVY_VERSION: 0.18.3
|
||||||
EXITCODE_ON_HIGH: 1
|
EXITCODE: 1
|
||||||
EXITCODE_ON_CRITICAL: 1
|
|
||||||
before_script:
|
before_script:
|
||||||
- curl -L "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz" --output trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz
|
- curl -L "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz" --output trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz
|
||||||
- tar zxvf trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz
|
- tar zxvf trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz
|
||||||
script:
|
script:
|
||||||
- mvn $MAVEN_CLI_OPTS compile jib:buildTar -DskipTests
|
- mvn $MAVEN_CLI_OPTS compile jib:buildTar -DskipTests
|
||||||
- ./trivy --cache-dir .trivycache/ --exit-code 0 --cache-dir .trivycache/ --no-progress --format template --template "@contrib/junit.tpl" -o junit-report.xml --input target/jib-image.tar
|
- ./trivy --cache-dir .trivycache/ --exit-code 0 --cache-dir .trivycache/ --severity HIGH,CRITICAL --no-progress --format template --template "@contrib/junit.tpl" -o junit-report.xml --input target/jib-image.tar
|
||||||
- ./trivy --cache-dir .trivycache/ --exit-code $EXITCODE_ON_HIGH --severity HIGH --no-progress --auto-refresh --input target/jib-image.tar
|
- ./trivy --cache-dir .trivycache/ --exit-code $EXITCODE_ON_HIGH --severity HIGH,CRITICAL --no-progress --auto-refresh --input target/jib-image.tar
|
||||||
- ./trivy --cache-dir .trivycache/ --exit-code $EXITCODE_ON_CRITICAL --severity CRITICAL --no-progress --auto-refresh --input target/jib-image.tar
|
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
- .trivycache/
|
- .trivycache/
|
||||||
@ -30,16 +28,15 @@
|
|||||||
PROJECT_DIR: $CI_PROJECT_DIR
|
PROJECT_DIR: $CI_PROJECT_DIR
|
||||||
DOCKERFILE_LOCATION: $CI_PROJECT_DIR/Dockerfile
|
DOCKERFILE_LOCATION: $CI_PROJECT_DIR/Dockerfile
|
||||||
CONTEXT_LOCATION: $CI_PROJECT_DIR
|
CONTEXT_LOCATION: $CI_PROJECT_DIR
|
||||||
EXITCODE_ON_HIGH: 1
|
EXITCODE: 1
|
||||||
EXITCODE_ON_CRITICAL: 1
|
|
||||||
before_script:
|
before_script:
|
||||||
- wget "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz"
|
- wget "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz"
|
||||||
- tar zxvf trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz
|
- tar zxvf trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz
|
||||||
script:
|
script:
|
||||||
- /kaniko/executor --context $CONTEXT_LOCATION --dockerfile $DOCKERFILE_LOCATION --cache-dir cache/image --tarPath image.tar --no-push --destination image
|
- /kaniko/executor --context $CONTEXT_LOCATION --dockerfile $DOCKERFILE_LOCATION --cache-dir cache/image --tarPath image.tar --no-push --destination image
|
||||||
- ./trivy --cache-dir .trivycache/ --exit-code 0 --cache-dir .trivycache/ --no-progress --format template --template "@contrib/junit.tpl" -o junit-report.xml --input image.tar
|
- ./trivy --cache-dir .trivycache/ --exit-code 0 --cache-dir .trivycache/ --severity HIGH,CRITICAL --no-progress --format template --template "@contrib/junit.tpl" -o junit-report.xml --input image.tar
|
||||||
- ./trivy --cache-dir .trivycache/ --exit-code $EXITCODE_ON_HIGH --severity HIGH --no-progress --auto-refresh --input image.tar
|
- ./trivy --cache-dir .trivycache/ --exit-code $EXITCODE --severity HIGH,CRITICAL --no-progress --auto-refresh --input image.tar
|
||||||
- ./trivy --cache-dir .trivycache/ --exit-code $EXITCODE_ON_CRITICAL --severity CRITICAL --no-progress --auto-refresh --input image.tar
|
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
- .trivycache/
|
- .trivycache/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user