| 1 | name: Trivy License Scan |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | |
| 6 | jobs: |
| 7 | license_scan1: |
| 8 | name: License scan (rootfs) |
| 9 | runs-on: ubuntu-latest |
| 10 | timeout-minutes: 30 |
| 11 | steps: |
| 12 | - name: Checkout code |
| 13 | uses: actions/checkout@v3 |
| 14 | |
| 15 | - name: Run license scanner |
| 16 | uses: aquasecurity/trivy-action@0.26.0 |
| 17 | env: |
| 18 | #try default GitHub DBs, if failing, use AWS mirror instead (https://github.com/aquasecurity/trivy-action/issues/389) |
| 19 | TRIVY_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-db,public.ecr.aws/aquasecurity/trivy-db |
| 20 | TRIVY_JAVA_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-java-db,public.ecr.aws/aquasecurity/trivy-java-db |
| 21 | with: |
| 22 | scan-type: "rootfs" |
| 23 | scan-ref: "." |
| 24 | scanners: "license" |
| 25 | severity: "CRITICAL,HIGH" |
| 26 | exit-code: 1 |
| 27 | license_scan2: |
| 28 | name: License scan (repo) |
| 29 | runs-on: ubuntu-latest |
| 30 | timeout-minutes: 30 |
| 31 | steps: |
| 32 | - name: Checkout code |
| 33 | uses: actions/checkout@v3 |
| 34 | - name: npm install (authority-portal-api-client-ts) |
| 35 | run: cd authority-portal-backend/authority-portal-api-client-ts && npm install |
| 36 | - name: npm install (authority-portal-frontend) |
| 37 | run: cd authority-portal-frontend && npm install |
| 38 | - name: Run license scanner |
| 39 | uses: aquasecurity/trivy-action@0.26.0 |
| 40 | env: |
| 41 | #try default GitHub DBs, if failing, use AWS mirror instead (https://github.com/aquasecurity/trivy-action/issues/389) |
| 42 | TRIVY_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-db,public.ecr.aws/aquasecurity/trivy-db |
| 43 | TRIVY_JAVA_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-java-db,public.ecr.aws/aquasecurity/trivy-java-db |
| 44 | with: |
| 45 | scan-type: "repo" |
| 46 | scan-ref: "." |
| 47 | scanners: "license" |
| 48 | severity: "CRITICAL,HIGH" |
| 49 | exit-code: 1 |