added docker scan mode

This commit is contained in:
filip.mihajlovski 2024-01-15 13:24:05 +01:00
parent 009028b4d9
commit e76e34bd92
1 changed files with 26 additions and 1 deletions
.github/workflows

View File

@ -9,7 +9,7 @@ on:
- cron: '28 3 * * 5'
jobs:
build:
repo_scan:
name: repo_scan
runs-on: ubuntu-20.04
steps:
@ -25,6 +25,31 @@ jobs:
output: 'trivy-results.sarif'
severity: 'CRITICAL'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'
docker_scan:
name: docker_scan
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build an image from Dockerfile
run: |
docker build -t keitaro/ckan/2.10:${{ github.sha }} -f ./images/ckan/2.10/Dockerfile .
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'keitaro/ckan/2.10:${{ github.sha }}'
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with: