ci: pin Trivy checks to scanner release
This commit is contained in:
parent
33bdf694f0
commit
569a366cbb
9
Jenkinsfile
vendored
9
Jenkinsfile
vendored
@ -238,9 +238,16 @@ PY
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
set +e
|
set +e
|
||||||
trivy fs --cache-dir "${TRIVY_CACHE_DIR}" --skip-db-update --skip-files clusters/atlas/flux-system/gotk-components.yaml --timeout 5m --no-progress --format json --output build/trivy-fs.json --scanners vuln,secret,misconfig --severity HIGH,CRITICAL .
|
trivy fs --cache-dir "${TRIVY_CACHE_DIR}" --skip-db-update --skip-check-update --skip-files clusters/atlas/flux-system/gotk-components.yaml --timeout 5m --no-progress --format json --output build/trivy-fs.json --scanners vuln,secret,misconfig --severity HIGH,CRITICAL .
|
||||||
trivy_rc=$?
|
trivy_rc=$?
|
||||||
set -e
|
set -e
|
||||||
|
if [ "${trivy_rc}" -ne 0 ]; then
|
||||||
|
rm -f build/trivy-fs.json
|
||||||
|
cat > build/ironbank-compliance.json <<EOF
|
||||||
|
{"status":"failed","compliant":false,"scanner":"trivy","scan_type":"filesystem","error":"trivy scan failed","trivy_rc":${trivy_rc}}
|
||||||
|
EOF
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
if [ ! -s build/trivy-fs.json ]; then
|
if [ ! -s build/trivy-fs.json ]; then
|
||||||
cat > build/ironbank-compliance.json <<EOF
|
cat > build/ironbank-compliance.json <<EOF
|
||||||
{"status":"failed","compliant":false,"scanner":"trivy","scan_type":"filesystem","error":"trivy did not produce JSON output","trivy_rc":${trivy_rc}}
|
{"status":"failed","compliant":false,"scanner":"trivy","scan_type":"filesystem","error":"trivy did not produce JSON output","trivy_rc":${trivy_rc}}
|
||||||
|
|||||||
@ -237,9 +237,16 @@ PY
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
set +e
|
set +e
|
||||||
trivy fs --cache-dir "${TRIVY_CACHE_DIR}" --skip-db-update --skip-files clusters/atlas/flux-system/gotk-components.yaml --timeout 5m --no-progress --format json --output build/trivy-fs.json --scanners vuln,secret,misconfig --severity HIGH,CRITICAL .
|
trivy fs --cache-dir "${TRIVY_CACHE_DIR}" --skip-db-update --skip-check-update --skip-files clusters/atlas/flux-system/gotk-components.yaml --timeout 5m --no-progress --format json --output build/trivy-fs.json --scanners vuln,secret,misconfig --severity HIGH,CRITICAL .
|
||||||
trivy_rc=$?
|
trivy_rc=$?
|
||||||
set -e
|
set -e
|
||||||
|
if [ "${trivy_rc}" -ne 0 ]; then
|
||||||
|
rm -f build/trivy-fs.json
|
||||||
|
cat > build/ironbank-compliance.json <<EOF
|
||||||
|
{"status":"failed","compliant":false,"scanner":"trivy","scan_type":"filesystem","error":"trivy scan failed","trivy_rc":${trivy_rc}}
|
||||||
|
EOF
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
if [ ! -s build/trivy-fs.json ]; then
|
if [ ! -s build/trivy-fs.json ]; then
|
||||||
cat > build/ironbank-compliance.json <<EOF
|
cat > build/ironbank-compliance.json <<EOF
|
||||||
{"status":"failed","compliant":false,"scanner":"trivy","scan_type":"filesystem","error":"trivy did not produce JSON output","trivy_rc":${trivy_rc}}
|
{"status":"failed","compliant":false,"scanner":"trivy","scan_type":"filesystem","error":"trivy did not produce JSON output","trivy_rc":${trivy_rc}}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user