generated from thriving-dev/java-library-template
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (37 loc) · 1.1 KB
/
callable.code-analysis.trivy.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
name: Trivy Security Scan
on:
workflow_call:
jobs:
analyze:
name: Trivy scan (JVM)
runs-on: ubuntu-latest
timeout-minutes: 360
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '21'
- uses: gradle/wrapper-validation-action@v2
- name: Setup Gradle
uses: gradle/[email protected]
with:
cache-read-only: true
- name: Generate gradle.lockfile for trivy scan
run: gradle dependencies --write-locks
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
severity: 'CRITICAL,HIGH'
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'