From 36f902128b021f50fd4809a2ecc5b0572c46397a Mon Sep 17 00:00:00 2001 From: Eric Thuaud <58465319+EricThuaud@users.noreply.github.com> Date: Mon, 8 Jul 2024 11:47:00 +0200 Subject: [PATCH] feat - add trivy flow --- .github/workflows/trivy.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 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 00000000..92f121b9 --- /dev/null +++ b/.github/workflows/trivy.yml @@ -0,0 +1,30 @@ +name: Trivy Analysis + +on: + push: + branches: + - main + - develop + pull_request: + types: [opened, synchronize, reopened] +jobs: + build: + name: Build and analyze + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 21 + uses: actions/setup-java@v3 + with: + java-version: 21 + distribution: 'temurin' + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@0.20.0 + with: + format: 'table' + scan-type: 'repo' + exit-code: '1' + vuln-type: 'os,library' + severity: 'CRITICAL,HIGH' \ No newline at end of file