Skip to content

Commit

Permalink
chore(ci): add pull token for trivy (#1242)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwrau authored Nov 20, 2024
1 parent b0c97f0 commit bb9f399
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/scripts/generate-sarif-reports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bb9f399

Please sign in to comment.