| 1 | name: Trivy Security Scan |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | workflow_dispatch: |
| 6 | |
| 7 | jobs: |
| 8 | security_scan: |
| 9 | name: security_scan |
| 10 | runs-on: ubuntu-latest |
| 11 | steps: |
| 12 | - name: Checkout code |
| 13 | uses: actions/checkout@v4 |
| 14 | - name: Run static analysis (rootfs) |
| 15 | uses: aquasecurity/trivy-action@0.26.0 |
| 16 | env: |
| 17 | #try default GitHub DBs, if failing, use AWS mirror instead (https://github.com/aquasecurity/trivy-action/issues/389) |
| 18 | TRIVY_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-db,public.ecr.aws/aquasecurity/trivy-db |
| 19 | TRIVY_JAVA_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-java-db,public.ecr.aws/aquasecurity/trivy-java-db |
| 20 | with: |
| 21 | scan-type: "rootfs" |
| 22 | scanners: "vuln,misconfig" |
| 23 | ignore-unfixed: true |
| 24 | format: 'table' |
| 25 | severity: "CRITICAL,HIGH" |
| 26 | - name: Run static analysis (repo) |
| 27 | uses: aquasecurity/trivy-action@0.26.0 |
| 28 | env: |
| 29 | #try default GitHub DBs, if failing, use AWS mirror instead (https://github.com/aquasecurity/trivy-action/issues/389) |
| 30 | TRIVY_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-db,public.ecr.aws/aquasecurity/trivy-db |
| 31 | TRIVY_JAVA_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-java-db,public.ecr.aws/aquasecurity/trivy-java-db |
| 32 | with: |
| 33 | scan-type: "repo" |
| 34 | scanners: "vuln,misconfig" |
| 35 | ignore-unfixed: true |
| 36 | format: 'table' |
| 37 | severity: "CRITICAL,HIGH" |