From fd8cb274b3d8ad5286fe9c8b93f47337b7819b51 Mon Sep 17 00:00:00 2001 From: gjofili <55558404+gjofili@users.noreply.github.com> Date: Mon, 16 Sep 2024 12:31:33 -0300 Subject: [PATCH] Create trivy.yml --- .github/workflows/trivy.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/trivy.yml diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml new file mode 100644 index 0000000000..6b36b820f5 --- /dev/null +++ b/.github/workflows/trivy.yml @@ -0,0 +1,25 @@ +name: trivy +on: + push: + branches: + - main + pull_request: +jobs: + build: + name: trivy + runs-on: ubuntu-20.04 + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Build an image from Dockerfile + run: | + docker build -t docker.io/my-organization/my-app:${{ github.sha }} . + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@0.20.0 + with: + image-ref: 'docker.io/my-organization/my-app:${{ github.sha }}' + format: 'table' + exit-code: '1' + ignore-unfixed: true + vuln-type: 'os,library' + severity: 'CRITICAL,HIGH'