Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing trivy checksum #740

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ on:
- "requirements-dev.txt"
pull_request:
paths:
- ".github/workflows/*"

- "images/**"
- "!images/*/README.md"
- "tests/**"
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/trivy-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Tests trivy SHA

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: Trivy Sha
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 \
&& sudo mv ./trivy /usr/local/bin/trivy

trivy --version
Loading