-
Notifications
You must be signed in to change notification settings - Fork 27
42 lines (36 loc) · 1.29 KB
/
trivy-scheduled.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Trivy: Scan of current branch
# Trivy is a comprehensive and versatile security scanner.
# Trivy has scanners that look for security issues, and targets where it can find those issues.
# https://github.com/aquasecurity/trivy
#
# This runs on scheduled to run on every Monday and Thursday at 12:12
# --------------------------------------------------------------------
name: Trivy - scheduled scan
on:
workflow_dispatch:
schedule:
- cron: '12 12 * * MON,THU'
jobs:
scan:
permissions:
contents: read
security-events: write
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Ensure lowercase name
run: echo REPOSITORY_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.9.2
with:
image-ref: 'ghcr.io/${{ env.REPOSITORY_OWNER }}/pathogens-portal:develop'
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
category: trivy-cron