Skip to content

Commit 99ea62e

Browse files
authored
DPSTAT-1397 updating build for trivy (#47)
* DPSTAT-1397 updating build for trivy * DPSTAT-1397 updating build for trivy with master configuration * DPSTAT-1397 remove skip set up failing the build * DPSTAT-1397 changes after PR * DPSTAT-1397 udpated from ssb bip to gar * DPSTAT-1397 upgrading 2 high vulnerability libraries * DPSTAT-1397 reverting the change of profile * DPSTAT-1397 change of profile to ssb-gar * DPSTAT-1397 moving google authentication sequence for failed build * DPSTAT-1397 changing profile to ssb-gar
1 parent 0db0b82 commit 99ea62e

File tree

2 files changed

+41
-6
lines changed

2 files changed

+41
-6
lines changed

.github/workflows/build.yml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
permissions:
1515
contents: read
1616
id-token: write
17-
17+
security-events: write
1818
steps:
1919
- uses: actions/checkout@v3
2020

@@ -33,10 +33,38 @@ jobs:
3333
service_account: "gh-actions-dapla-pseudo@artifact-registry-5n.iam.gserviceaccount.com"
3434
token_format: access_token
3535

36+
- name: Build with Maven
37+
run: mvn --batch-mode -P ssb-gar package
38+
39+
- name: Fail build on High/Critical Vulnerabilities
40+
uses: aquasecurity/trivy-action@master
41+
with:
42+
scan-type: 'fs'
43+
format: 'table'
44+
scan-ref: '.'
45+
severity: 'HIGH,CRITICAL'
46+
ignore-unfixed: true
47+
exit-code: 1
48+
49+
- name: Run Trivy vulnerability scanner (SARIF for reporting)
50+
uses: aquasecurity/trivy-action@master
51+
with:
52+
scan-type: 'fs'
53+
ignore-unfixed: true
54+
format: 'sarif'
55+
output: 'trivy-results.sarif'
56+
severity: 'CRITICAL,HIGH'
57+
skip-setup-trivy: true
58+
59+
- name: Upload Trivy scan results to GitHub Security tab
60+
uses: github/codeql-action/upload-sarif@v4
61+
with:
62+
sarif_file: 'trivy-results.sarif'
63+
3664
- name: Build and test with Maven
3765
if: github.event_name == 'pull_request'
38-
run: mvn --batch-mode -P ssb-bip clean test
66+
run: mvn --batch-mode -P ssb-gar clean test
3967

4068
- name: Build with Maven and deploy to Artifact Registry
41-
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
42-
run: mvn --batch-mode -P ssb-bip deploy -Dmaven.javadoc.skip=true
69+
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && success()
70+
run: mvn --batch-mode -P ssb-gar deploy -Dmaven.javadoc.skip=true

pom.xml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<dapla-dlp-pseudo-func.version>1.3.3</dapla-dlp-pseudo-func.version>
1818
<guava.version>32.0.0-jre</guava.version>
1919
<jsonassert.version>1.5.1</jsonassert.version>
20-
<logback.version>1.4.6</logback.version>
20+
<logback.version>1.4.12</logback.version>
2121
<lombok.version>1.18.30</lombok.version>
2222
<micronaut.version>4.3.7</micronaut.version>
2323
<micronaut.validation.version>4.4.0</micronaut.validation.version>
@@ -27,6 +27,7 @@
2727
<univocity-parsers.version>2.9.1</univocity-parsers.version>
2828
<zip4j.version>2.11.5</zip4j.version>
2929
<caffeine.version>3.2.2</caffeine.version>
30+
<protobuf.version>3.25.5</protobuf.version>
3031

3132
<!-- Plugin/extension versions -->
3233
<artifactregistry-maven-wagon.version>2.1.4</artifactregistry-maven-wagon.version>
@@ -134,6 +135,12 @@
134135
<artifactId>tika-core</artifactId>
135136
<version>${tika.version}</version>
136137
</dependency>
138+
<dependency>
139+
<groupId>com.google.protobuf</groupId>
140+
<artifactId>protobuf-java</artifactId>
141+
<version>${protobuf.version}</version>
142+
</dependency>
143+
137144
<dependency>
138145
<groupId>net.lingala.zip4j</groupId>
139146
<artifactId>zip4j</artifactId>
@@ -381,7 +388,7 @@
381388
</build>
382389
</profile>
383390
<profile>
384-
<id>ssb-bip</id>
391+
<id>ssb-gar</id>
385392
<distributionManagement>
386393
<repository>
387394
<id>artifact-registry</id>

0 commit comments

Comments
 (0)