From 80b44d2cd98e439467697dea97c78eb907fd7423 Mon Sep 17 00:00:00 2001 From: Saku K <6057704+saku-koodari@users.noreply.github.com> Date: Wed, 8 Jan 2025 15:35:57 +0200 Subject: [PATCH] chore(scripts): create a script to check trivy --- scripts/run_trivy.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 scripts/run_trivy.sh diff --git a/scripts/run_trivy.sh b/scripts/run_trivy.sh new file mode 100755 index 00000000..a4c8d526 --- /dev/null +++ b/scripts/run_trivy.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +set -euo pipefail + +source "$( dirname "${BASH_SOURCE[0]}" )/common-functions.sh" + +repo="https://github.com/Opetushallitus/koto-rekisteri" +reportDir="temp" +repoName="koto-rekisteri" +trivyImage=aquasec/trivy:latest + +docker pull ${trivyImage} + +docker run --rm \ + --volume trivy-cache:/trivy-cache \ + --volume ${reportDir}:/reports \ + ${trivyImage} \ + repo ${repo} \ + --cache-dir /trivy-cache \ + --scanners vuln \ + --format json \ + --output /reports/${repoName}_trivy.json