forked from grafana/alloy
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (32 loc) · 1.44 KB
/
Copy pathtrivy.yml
File metadata and controls
37 lines (32 loc) · 1.44 KB
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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: trivy scan
on:
schedule:
# triggers the workflow every day at 8:00 and 20:00 UTC:
# * is a special character in YAML so you have to quote this string
- cron: '15 8,20 * * *'
workflow_dispatch:
permissions:
contents: read
jobs:
build:
permissions:
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: Build
runs-on: "ubuntu-latest"
steps:
# Override the DB source: GHCR rate-limits trivy-db pulls in CI.
- name: Run Trivy vulnerability scanner
uses: docker://public.ecr.aws/aquasecurity/trivy:0.70.0@sha256:be1190afcb28352bfddc4ddeb71470835d16462af68d310f9f4bca710961a41e
env:
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:latest
with:
args: image --format sarif --severity CRITICAL,HIGH,MEDIUM,LOW --output /github/workspace/trivy-results.sarif grafana/alloy-dev:latest
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
with:
sarif_file: trivy-results.sarif