Testing trivy checksum #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests the image built or copied from the previous step | |
env: | |
HADOLINT_VERSION: "2.12.0" | |
on: | |
pull_request: | |
paths: | |
- ".github/workflows/*" | |
jobs: | |
pull-test: | |
runs-on: ubuntu-latest | |
services: | |
registry: | |
image: registry:2 | |
ports: | |
- 5000:5000 | |
env: | |
TRIVY_VERSION: "0.58.2" | |
TRIVY_DATABASES: '"ghcr.io/aquasecurity/trivy-db:2","public.ecr.aws/aquasecurity/trivy-db"' | |
TRIVY_JAVA_DATABASES: '"ghcr.io/aquasecurity/trivy-java-db:1","public.ecr.aws/aquasecurity/trivy-java-db"' | |
TRIVY_MAX_RETRIES: 5 | |
TRIVY_RETRY_DELAY: 20 | |
steps: | |
# Scan image for vulnerabilities | |
- name: Aqua Security Trivy image scan | |
run: | | |
curl -sLO https://github.com/aquasecurity/trivy/releases/download/v${{ env.TRIVY_VERSION }}/trivy_${{ env.TRIVY_VERSION }}_Linux-64bit.tar.gz \ | |
&& curl -LO https://github.com/aquasecurity/trivy/releases/download/v${{ env.TRIVY_VERSION }}/trivy_${{ env.TRIVY_VERSION }}_checksums.txt \ | |
&& grep "trivy_${{ env.TRIVY_VERSION }}_Linux-64bit.tar.gz" trivy-${{ env.TRIVY_VERSION }}_checksums.txt | sha256sum -c - \ | |
&& tar -xf trivy_${{ env.TRIVY_VERSION }}_Linux-64bit.tar.gz \ | |
&& chmod +x trivy_${{ env.TRIVY_VERSION }} \ | |
&& sudo mv ./trivy_${{ env.TRIVY_VERSION }} /usr/local/bin/trivy | |
set +e |