From 887b2e2427f3f49bff6a4646dff1b9fca979de38 Mon Sep 17 00:00:00 2001 From: Daniel Holbach Date: Wed, 15 Feb 2023 11:28:20 +0100 Subject: [PATCH] Move to aquasecurity/trivy-action instead Fixes: #701 Signed-off-by: Daniel Holbach --- .github/workflows/on-pr.yaml | 13 ++++++++----- .github/workflows/on-tag.yaml | 13 ++++++++----- .github/workflows/periodics-daily.yaml | 13 ++++++++----- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/.github/workflows/on-pr.yaml b/.github/workflows/on-pr.yaml index 1e01120..ac36580 100644 --- a/.github/workflows/on-pr.yaml +++ b/.github/workflows/on-pr.yaml @@ -87,12 +87,15 @@ jobs: id: tags - name: Build image run: VERSION="${{ steps.tags.outputs.sha_short }}" make image - - uses: Azure/container-scan@v0 - env: - # See https://github.com/goodwithtech/dockle/issues/188 - DOCKLE_HOST: "unix:///var/run/docker.sock" + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@8bd2f9fbda2109502356ff8a6a89da55b1ead252 with: - image-name: ghcr.io/${{ github.repository }}:${{ steps.tags.outputs.sha_short }} + image-ref: 'ghcr.io/${{ github.repository }}:${{ steps.tags.outputs.sha_short }}' + format: 'table' + exit-code: '1' + ignore-unfixed: true + vuln-type: 'os,library' + severity: 'CRITICAL,HIGH' # This ensures the latest code works with the manifests built from tree. # It is useful for two things: diff --git a/.github/workflows/on-tag.yaml b/.github/workflows/on-tag.yaml index ce8f419..5a85c5f 100644 --- a/.github/workflows/on-tag.yaml +++ b/.github/workflows/on-tag.yaml @@ -51,12 +51,15 @@ jobs: tags: | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tags.outputs.version }} - - uses: Azure/container-scan@v0 - env: - # See https://github.com/goodwithtech/dockle/issues/188 - DOCKLE_HOST: "unix:///var/run/docker.sock" + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@8bd2f9fbda2109502356ff8a6a89da55b1ead252 with: - image-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tags.outputs.version }} + image-ref: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tags.outputs.version }}' + format: 'table' + exit-code: '1' + ignore-unfixed: true + vuln-type: 'os,library' + severity: 'CRITICAL,HIGH' - name: Login to ghcr.io uses: docker/login-action@v2 diff --git a/.github/workflows/periodics-daily.yaml b/.github/workflows/periodics-daily.yaml index 4b8f1f9..d889ac4 100644 --- a/.github/workflows/periodics-daily.yaml +++ b/.github/workflows/periodics-daily.yaml @@ -69,9 +69,12 @@ jobs: id: tags - name: Build artifacts run: VERSION="${{ steps.tags.outputs.sha_short }}" make image - - uses: Azure/container-scan@v0 - env: - # See https://github.com/goodwithtech/dockle/issues/188 - DOCKLE_HOST: "unix:///var/run/docker.sock" + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@8bd2f9fbda2109502356ff8a6a89da55b1ead252 with: - image-name: ghcr.io/${{ github.repository }}:${{ steps.tags.outputs.sha_short }} + image-ref: 'ghcr.io/${{ github.repository }}:${{ steps.tags.outputs.sha_short }}' + format: 'table' + exit-code: '1' + ignore-unfixed: true + vuln-type: 'os,library' + severity: 'CRITICAL,HIGH'