Files
deploy/hack/snyk-container-tests.sh
Michael CrenshawandGitHub 4717ddf0bd chore: add Snyk scans to docs (#9856)
* chore: generate Snyk reports

Signed-off-by: Michael Crenshaw <[email protected]>

sarif

Signed-off-by: Michael Crenshaw <[email protected]>

dashboard

Signed-off-by: Michael Crenshaw <[email protected]>

cron job

Signed-off-by: Michael Crenshaw <[email protected]>

more consistent formatting

Signed-off-by: Michael Crenshaw <[email protected]>

clarification

Signed-off-by: Michael Crenshaw <[email protected]>

sarif files

Signed-off-by: Michael Crenshaw <[email protected]>

fix naming, fix doc get text

Signed-off-by: Michael Crenshaw <[email protected]>

apply suggestions

Signed-off-by: Michael Crenshaw <[email protected]>

apply suggestions

Signed-off-by: Michael Crenshaw <[email protected]>

blarn

Signed-off-by: CI <[email protected]>

ignore errors due to vulns

Signed-off-by: CI <[email protected]>

specify target branch in script

Signed-off-by: CI <[email protected]>

don't checkout before running script

Signed-off-by: CI <[email protected]>

make sure dest dir exists

Signed-off-by: CI <[email protected]>

fix workflow

Signed-off-by: CI <[email protected]>

* update scans

Signed-off-by: CI <[email protected]>

* update reports

Signed-off-by: CI <[email protected]>

* use latest ignore rules

Signed-off-by: CI <[email protected]>

* update reports

Signed-off-by: CI <[email protected]>

* update reports

Signed-off-by: CI <[email protected]>

* update reports, add link to latest, push to master instead of stable

Signed-off-by: CI <[email protected]>

* fix for double-digit patch versions

Signed-off-by: CI <[email protected]>

* clean up testing changes

Signed-off-by: CI <[email protected]>
2022-07-27 21:15:00 +00:00

27 lines
676 B
Bash
Executable File

#!/usr/bin/env bash
set -e
set -o pipefail
images=$(grep 'image: ' manifests/install.yaml manifests/namespace-install.yaml manifests/ha/install.yaml | sed 's/.*image: //' | sort | uniq)
failed=false
while IFS= read -r image; do
extra_args=""
if echo "$image" | grep "argocd"; then
# Pass the file arg only for the Argo CD image. The file arg also gives us access to sarif output.
extra_args="--file=Dockerfile --sarif-file-output=/tmp/argocd-image.sarif"
fi
set -x
if ! snyk container test "$image" --org=argoproj --severity-threshold=high $extra_args; then
failed=true
fi
set +x
done <<< "$images"
if [ "$failed" == "true" ]; then
exit 1
fi