chore verify image vulns

This commit is contained in:
Ruben Fiszel
2024-04-04 01:48:31 +02:00
parent 00d7c4943e
commit 66f0dff64a
2 changed files with 28 additions and 32 deletions

28
.github/workflows/docker-scan.yml vendored Normal file
View File

@@ -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"

View File

@@ -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