@@ -62,36 +62,38 @@ image:gpu-operator:
6262 - echo "Skipped in internal CI"
6363
6464# The .scan step forms the base of the image scan operation performed before releasing
65- # images.
65+ # images. pulse-cli pulls from the registry directly, so DinD is not required.
6666.scan :
6767 stage : scan
6868 image : " ${PULSE_IMAGE}"
69+ services : []
6970 variables :
7071 IMAGE : " ${IMAGE_NAME}:${CI_COMMIT_SHORT_SHA}"
71- IMAGE_ARCHIVE : " gpu-operator.tar"
7272 except :
7373 variables :
7474 - $CI_COMMIT_MESSAGE =~ /\[skip[ _-]scans?\]/i
7575 - $SKIP_SCANS && $SKIP_SCANS == "yes"
7676 before_script :
77- - docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
78- - docker pull --platform="${PLATFORM}" "${IMAGE}"
79- - docker save "${IMAGE}" -o "${IMAGE_ARCHIVE}"
77+ - mkdir -p "$HOME/.docker"
78+ - chmod 700 "$HOME/.docker"
79+ - REGISTRY_AUTH="$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')"
80+ - >
81+ jq -n --arg registry "$CI_REGISTRY" --arg auth "$REGISTRY_AUTH"
82+ '{auths: {($registry): {auth: $auth}}}' > "$HOME/.docker/config.json"
83+ - chmod 600 "$HOME/.docker/config.json"
84+ - export REGISTRY_AUTH_FILE="$HOME/.docker/config.json"
8085 - AuthHeader=$(echo -n $SSA_CLIENT_ID:$SSA_CLIENT_SECRET | base64 -w0)
8186 - >
8287 export SSA_TOKEN=$(curl --request POST --header "Authorization: Basic $AuthHeader" --header "Content-Type: application/x-www-form-urlencoded" ${SSA_ISSUER_URL} | jq ".access_token" | tr -d '"')
8388 - if [ -z "$SSA_TOKEN" ]; then exit 1; else echo "SSA_TOKEN set!"; fi
8489 script :
85- - pulse-cli -n $NSPECT_ID --ssa $SSA_TOKEN scan -i $IMAGE_ARCHIVE -p $CONTAINER_POLICY -o
90+ - echo "Scanning image ${IMAGE} for platform ${PLATFORM}"
91+ - pulse-cli -n "${NSPECT_ID}" scan-image -i "${IMAGE}" --platform "${PLATFORM}" -p "${CONTAINER_POLICY}" --output-dir="scan-results" -o
8692 artifacts :
8793 when : always
8894 expire_in : 1 week
8995 paths :
90- - pulse-cli.log
91- - licenses.json
92- - sbom.json
93- - vulns.json
94- - policy_evaluation.json
96+ - scan-results/**/*
9597
9698.scan:gpu-operator :
9799 extends :
0 commit comments