diff --git a/.github/scripts/generate-sarif-reports.sh b/.github/scripts/generate-sarif-reports.sh index 41ff3a6d2..4e594b636 100755 --- a/.github/scripts/generate-sarif-reports.sh +++ b/.github/scripts/generate-sarif-reports.sh @@ -6,6 +6,10 @@ set -eu set -o pipefail +declare -A IMAGE_PULL_TOKENS=( + [gitlab.teuto.net]="${TEUTO_PORTAL_WORKER_PULL_TOKEN}" +) + function createSarifReports() { local chart="${1?}" local chartName @@ -45,6 +49,10 @@ export -f generateSarifReport trivy image --download-db-only +for registry in "${!IMAGE_PULL_TOKENS[@]}"; do + TRIVY_PASSWORD="${IMAGE_PULL_TOKENS["$registry"]}" trivy registry login --username github-cve-scanning "$registry" +done + if [[ "$#" == 1 && -d "$1" ]]; then createSarifReports "$1" else