diff --git a/.github/workflows/docker-scan.yml b/.github/workflows/docker-scan.yml new file mode 100644 index 0000000000..3bacac6bd7 --- /dev/null +++ b/.github/workflows/docker-scan.yml @@ -0,0 +1,28 @@ +name: Verify image vulnerabilities + +on: + schedule: + - cron: "0 0 */1 * *" + workflow_dispatch: +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + verify_ee_image_vulnerabilities: + runs-on: ubicloud + permissions: write-all + + steps: + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + with: + image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee:main + format: "sarif" + output: "trivy-results.sarif" + + - name: Upload Trivy scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: "trivy-results.sarif" diff --git a/.github/workflows/docker-snyk.yml b/.github/workflows/docker-snyk.yml deleted file mode 100644 index e5bcf364b8..0000000000 --- a/.github/workflows/docker-snyk.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Verify image with Snyk - -on: - schedule: - - cron: "0 0 */1 * *" - workflow_dispatch: -env: - # Use docker.io for Docker Hub if empty - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - -jobs: - verify_ee_image_vulnerabilities: - runs-on: ubicloud - permissions: write-all - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Scan Docker image - uses: snyk/actions/docker@master - continue-on-error: true - with: - image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee:main - args: --severity-threshold=high --file=Dockerfile - env: - SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} - - name: Upload result to GitHub Code Scanning - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: snyk.sarif