-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (44 loc) · 1.43 KB
/
trivy-code-scanning.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
41
42
43
44
45
46
47
48
49
#
# SPDX-FileCopyrightText: 2023 Lifely
# SPDX-License-Identifier: EUPL-1.2+
#
name: Trivy code scanner
on:
push:
branches: [main]
pull_request:
branches: [main]
# ignore CodeQL analysis when only Markdown files have changed
paths-ignore:
- '**/*.md'
schedule:
- cron: "21 11 * * 0"
permissions:
# Required for uploading SARIF reports
security-events: write
jobs:
build:
name: Run Trivy code scanner
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner in repo mode
# Note that Trivy for Java requires a Gradle lock file.
# We do not use Gradle dependency locking yet because we use Dependabot
# to update our Gradle dependencies and Dependabot does not support Gradle lock
# files yet. See: https://github.com/dependabot/dependabot-core/issues/2222
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
ignore-unfixed: true
format: 'sarif'
output: 'trivy-results.sarif'
# limit the severities even when using Sarif
# or else all vulnerabilities will be reported
limit-severities-for-sarif: true
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'