-
Notifications
You must be signed in to change notification settings - Fork 7
107 lines (92 loc) · 3.13 KB
/
security.yaml
File metadata and controls
107 lines (92 loc) · 3.13 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Security Scan
on:
pull_request:
branches: ["**"]
push:
branches: [main, develop]
schedule:
- cron: "0 8 * * 1" # weekly Monday 08:00 UTC
permissions:
contents: read
security-events: write
jobs:
codeql:
name: CodeQL (Java SAST)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up JDK 21
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: temurin
java-version: "21"
- name: Initialize CodeQL
uses: github/codeql-action/init@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
with:
languages: java
queries: +security-extended
- name: Build with Maven
run: ./mvnw -B compile -DskipTests -pl ice,ice-rest-catalog
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
with:
category: "/language:java"
trivy:
name: Trivy Filesystem Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run Trivy (table output for logs)
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
with:
scan-type: fs
scan-ref: .
scanners: vuln
severity: CRITICAL,HIGH
exit-code: "1"
format: table
trivy-config: trivy.yaml
- name: Run Trivy (SARIF for GitHub Security tab)
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
if: always()
with:
scan-type: fs
scan-ref: .
scanners: vuln
severity: CRITICAL,HIGH
exit-code: "0"
format: sarif
output: trivy-results.sarif
trivy-config: trivy.yaml
- name: Upload Trivy SARIF to GitHub Security
uses: github/codeql-action/upload-sarif@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
if: always()
with:
sarif_file: trivy-results.sarif
grype:
name: Grype Dependency Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run Grype (table output for logs)
uses: anchore/scan-action@e1165082ffb1fe366ebaf02d8526e7c4989ea9d2 # v7.4.0
with:
path: .
fail-build: "true"
severity-cutoff: high
output-format: table
- name: Run Grype (SARIF for GitHub Security tab)
uses: anchore/scan-action@e1165082ffb1fe366ebaf02d8526e7c4989ea9d2 # v7.4.0
if: always()
id: grype-sarif
with:
path: .
fail-build: "false"
severity-cutoff: high
output-format: sarif
- name: Upload Grype SARIF to GitHub Security
uses: github/codeql-action/upload-sarif@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
if: always()
with:
sarif_file: ${{ steps.grype-sarif.outputs.sarif }}
category: grype