From cff3be638f080c29065aa9e86390c2db889c5618 Mon Sep 17 00:00:00 2001 From: Ramkumar Chinchani Date: Fri, 11 Mar 2022 04:07:49 +0000 Subject: [PATCH] ci/cd: scan released images with trivy scanner Signed-off-by: Ramkumar Chinchani --- .github/workflows/ci-cd.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 389f4580..1614dcb4 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -145,3 +145,19 @@ jobs: tags: | ghcr.io/${{ github.repository }}-zb-${{ matrix.os }}-${{ matrix.arch }}:${{ github.event.release.tag_name }} ghcr.io/${{ github.repository }}-zb-${{ matrix.os }}-${{ matrix.arch }}:latest + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + with: + image-ref: 'ghcr.io/${{ github.repository }}-${{ matrix.os }}-${{ matrix.arch }}:${{ github.event.release.tag_name }}' + format: 'sarif' + output: 'trivy-results.sarif' + - name: Run Trivy vulnerability scanner (minimal) + uses: aquasecurity/trivy-action@master + with: + image-ref: 'ghcr.io/${{ github.repository }}-minimal-${{ matrix.os }}-${{ matrix.arch }}:${{ github.event.release.tag_name }}' + format: 'sarif' + output: 'trivy-results.sarif' + - name: Upload Trivy scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@v1 + with: + sarif_file: 'trivy-results.sarif'