-
Notifications
You must be signed in to change notification settings - Fork 8
40 lines (37 loc) · 1.25 KB
/
trivy-scheduled-dev.yml
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
# Trivy: Scan remote image on GHCR on schedule
# Trivy (pronunciation) 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
# ---------------------------------
name: Trivy - ghcr image scan - dev
on:
workflow_dispatch:
branches:
- dev
schedule:
- cron: "0 9,12,15 * * *"
jobs:
scan:
permissions:
contents: read
security-events: write
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Ensure lowercase name
run: echo REPOSITORY_OWNER=$(echo ${{ github.repository_owner }} | tr "[:upper:]" "[:lower:]") >> $GITHUB_ENV
- name: Run Trivy on latest dev image
uses: aquasecurity/[email protected]
with:
image-ref: "ghcr.io/${{ env.REPOSITORY_OWNER }}/dds-backend:dev"
format: "sarif"
output: "trivy-results-dev.sarif"
severity: "CRITICAL,HIGH"
- name: Upload Trivy scan results to dev branch GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: "trivy-results-dev.sarif"
category: trivy-dev