This repository has been archived by the owner on Jun 26, 2024. It is now read-only.
.github/workflows/periodic-security-check.yaml #465
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
security-scan: | |
name: Security vulnerability scan | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Extract operator image ref | |
id: operator-image-ref | |
run: | | |
export OIR=$(make operator-image-ref) | |
echo "operator-image-ref=${OIR}" >> $GITHUB_OUTPUT | |
- name: Run Trivy vulnerability scanner in IaC mode | |
uses: aquasecurity/trivy-action@master | |
with: | |
image-ref: ${{ steps.operator-image-ref.outputs.operator-image-ref }} | |
format: 'sarif' | |
severity: 'CRITICAL,HIGH' | |
ignore-unfixed: true | |
output: 'trivy-results.sarif' | |
- name: Upload Trivy scan results to GitHub Security tab | |
if: always() | |
uses: github/codeql-action/upload-sarif@v2 | |
with: | |
sarif_file: 'trivy-results.sarif' | |
source-scan: | |
name: Gosec code scanning | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Run gosec | |
uses: securego/[email protected] | |
with: | |
args: '-no-fail -fmt sarif -out gosec.sarif ./...' | |
- name: Upload gosec scan results to GitHub Security tab | |
uses: github/codeql-action/upload-sarif@v2 | |
with: | |
sarif_file: 'gosec.sarif' |