ci: pin Trivy checks to scanner release

This commit is contained in:
jenkins 2026-08-13 12:48:31 -03:00
parent 33bdf694f0
commit 569a366cbb
2 changed files with 16 additions and 2 deletions

9
Jenkinsfile vendored
View File

@ -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}}

View File

@ -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}}