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

add trivy.yml #31

Merged
merged 8 commits into from
Nov 5, 2024
Merged
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
32 changes: 32 additions & 0 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Run Trivy vulnerability scanner

on: [ push ]

permissions:
contents: read
packages: write
issues: write
pull-requests: write

jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build wis2downloader
run: |
docker build -t wis2downloader:test -f ./docker/Dockerfile .
- name: Run Trivy vulnerability scanner on wis2downloader
uses: aquasecurity/trivy-action@0.20.0
env:
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db:1
with:
image-ref: 'wis2downloader:test'
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
ignorefile: '.trivyignore'
3 changes: 2 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ ENV WIS2DOWNLOADER_CONFIG "/home/wis2downloader/app/config/config.json"


# Update, upgrade packages and install / clean up
# hadolint ignore=DL3008
RUN apt-get update && \
apt-get upgrade && \
apt-get install -y gettext-base=0.21-12 curl=7.88.1-10+deb12u6 cron=3.0pl1-162 git=1:2.39.2-1.1 && \
apt-get install -y gettext-base curl cron git && \
rm -rf /var/lib/apt/lists/*

# Now setup python env and default user
Expand Down
Loading