Trivy - Vulnerability Scan #303
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: Trivy | |
run-name: Trivy - Vulnerability Scan | |
on: | |
pull_request: | |
branches: | |
- develop | |
schedule: | |
# At 05:15 UTC on day-of-month 2 | |
- cron: '20 10 14 * *' | |
# - cron: '15 5 2 * *' | |
jobs: | |
scan: | |
name: Vulnerability Scan | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4.1.4 | |
- name: Build -opensource and cloud- Docker images | |
run: | | |
docker build -f docker/Dockerfile --build-arg WORKSPACE=cloud -t docker.io/gisaia/arlas-wui-cloud:${{ github.sha }} . | |
docker build -f docker/Dockerfile --build-arg WORKSPACE=opensource -t docker.io/gisaia/arlas-wui:${{ github.sha }} . | |
- name: Run Trivy vulnerability scanner on opensource image | |
uses: aquasecurity/trivy-action@master | |
env: | |
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2 | |
with: | |
image-ref: "docker.io/gisaia/arlas-wui:${{ github.sha }}" | |
format: "table" | |
exit-code: "1" | |
ignore-unfixed: true | |
vuln-type: "os,library" | |
severity: "CRITICAL,HIGH" | |
trivyignores: .github/workflows/.trivyignore | |
- name: Run Trivy vulnerability scanner on cloud image | |
uses: aquasecurity/trivy-action@master | |
env: | |
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2 | |
with: | |
image-ref: "docker.io/gisaia/arlas-wui-cloud:${{ github.sha }}" | |
format: "table" | |
exit-code: "1" | |
ignore-unfixed: true | |
vuln-type: "os,library" | |
severity: "CRITICAL,HIGH" | |
trivyignores: .github/workflows/.trivyignore | |
- name: Notify Google Chat | |
if: ${{ always() }} # Use always to ensure that the notification is also send on failure of former steps | |
uses: SimonScholz/google-chat-action@main | |
with: | |
webhookUrl: '${{ secrets.GOOGLE_CHAT_SCAN_CHANEL }}' | |
jobStatus: '${{ job.status }}' | |
title: 'Trivy Scan on ARLAS-wui' |