diff --git a/script/image-scan.sh b/script/image-scan.sh index 6e2ad2a..c039d39 100644 --- a/script/image-scan.sh +++ b/script/image-scan.sh @@ -18,7 +18,12 @@ ORG="$1" # Check if trivy is installed if ! command -v trivy &> /dev/null; then - echo "Trivy is not installed. Please install it from https://aquasecurity.github.io/trivy/v0.18.3/installation/ and run this script again." + echo "Trivy is not installed." + #Install Trivy + sudo apt-get install wget apt-transport-https gnupg lsb-release + wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add - + echo deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list.d/tr… + sudo apt-get install trivy exit 1 else echo "Found trivy, using trivy v$(trivy -v | cut -d ' ' -f 2)"