|
29 | 29 | env:
|
30 | 30 | IMAGE_NAMESPACE: 'tractusx'
|
31 | 31 | ICHUB_BACKEND_IMAGE_NAME: "ichub-backend"
|
32 |
| - DATASPACE_SDK_IMAGE_NAME: "dataspace-sdk" |
33 |
| - INDUSTRY_SDK_IMAGE_NAME: "industry-sdk" |
| 32 | + ICHUB_FRONTEND_IMAGE_NAME: "ichub-frontend" |
34 | 33 |
|
35 | 34 | jobs:
|
36 | 35 | analyze-ichub-backend:
|
|
67 | 66 | if: always()
|
68 | 67 | with:
|
69 | 68 | sarif_file: "trivy-results-ichub-backend.sarif"
|
| 69 | + |
| 70 | + analyze-ichub-frontend: |
| 71 | + name: Analyze ICHub Frontend |
| 72 | + runs-on: ubuntu-latest |
| 73 | + permissions: |
| 74 | + actions: read |
| 75 | + contents: read |
| 76 | + security-events: write |
| 77 | + |
| 78 | + steps: |
| 79 | + - name: Checkout repository |
| 80 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 81 | + |
| 82 | + - name: Build ichub-frontend Docker image |
| 83 | + id: build-docker-ichub-frontend |
| 84 | + run: | |
| 85 | + cd ichub-frontend |
| 86 | + docker build -t ${{ env.IMAGE_NAMESPACE }}/${{ env.ICHUB_FRONTEND_IMAGE_NAME }}:latest . |
| 87 | +
|
| 88 | + - name: Run Trivy vulnerability scanner |
| 89 | + uses: aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0 # 0.29.0 |
| 90 | + with: |
| 91 | + image-ref: "${{ env.IMAGE_NAMESPACE }}/${{ env.ICHUB_FRONTEND_IMAGE_NAME }}:latest" # Pull image from Docker Hub and run Trivy vulnerability scanner |
| 92 | + format: "sarif" |
| 93 | + output: "trivy-results-ichub-frontend.sarif" |
| 94 | + severity: "CRITICAL,HIGH" # While vulnerabilities of all severities are reported in the SARIF output, the exit code and workflow failure are triggered only by these specified severities (CRITICAL or HIGH). |
| 95 | + hide-progress: false |
| 96 | + exit-code: "1" # Trivy exits with code 1 if vulnerabilities are found, causing the workflow step to fail. |
| 97 | + limit-severities-for-sarif: true |
| 98 | + |
| 99 | + - name: Upload Trivy scan results to GitHub Security tab |
| 100 | + uses: github/codeql-action/upload-sarif@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9 |
| 101 | + if: always() |
| 102 | + with: |
| 103 | + sarif_file: "trivy-results-ichub-frontend.sarif" |
0 commit comments