Skip to content

Commit 34d1189

Browse files
committed
CI(Dependency): add Dependency Check and Submission
1 parent 5975fff commit 34d1189

6 files changed

Lines changed: 117 additions & 12 deletions

File tree

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: "Dependency Check"
2+
3+
on:
4+
push:
5+
branches: [ 'develop', 'master', 'release_**', 'feat/JDK17' ]
6+
pull_request:
7+
branches: [ 'develop', "release_**" , 'feat/JDK17' ]
8+
schedule:
9+
- cron: '25 6 * * *'
10+
workflow_dispatch:
11+
12+
jobs:
13+
dependency-check:
14+
name: Dependency Check
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Cache ODC data
22+
uses: actions/cache@v3
23+
with:
24+
path: ~/.dependency-check/data
25+
key: ${{ runner.os }}-odc-data-${{ hashFiles('**/build.gradle') }}
26+
restore-keys: |
27+
${{ runner.os }}-odc-data-
28+
29+
- name: Set up JDK 8
30+
uses: actions/setup-java@v3
31+
with:
32+
java-version: '8'
33+
distribution: 'temurin'
34+
35+
- name: Gradlew build
36+
run: ./gradlew --no-daemon -S -Dorg.gradle.dependency.verification=off -Dorg.gradle.warning.mode=none build -x test
37+
38+
- name: Dependency Check
39+
uses: dependency-check/Dependency-Check_Action@1.1.0
40+
env:
41+
# actions/setup-java@v1 changes JAVA_HOME, so it needs to be reset to match the depcheck image
42+
JAVA_HOME: /opt/jdk
43+
with:
44+
project: 'java-tron'
45+
path: '.'
46+
format: 'HTML'
47+
out: 'reports'
48+
args: >
49+
--failOnCVSS 7
50+
--enableRetired
51+
--suppression ${{github.workspace}}/suppression.xml
52+
- name: Generate timestamp
53+
run: echo "BUILD_TIMESTAMP=$(date -u +"%Y%m%d-%H%M%S")" >> $GITHUB_ENV
54+
- name: Get Repository Name
55+
run: echo "REPO_NAME=$(echo '${{ github.repository }}' | cut -d'/' -f2)" >> $GITHUB_ENV
56+
- name: Upload report
57+
if: always()
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: dependency-check-${{ env.REPO_NAME }}-${{ env.BUILD_TIMESTAMP }}
61+
path: ${{github.workspace}}/reports
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Dependency Submission
2+
3+
on:
4+
push:
5+
branches: [ 'develop', 'master', 'release_**', 'feat/JDK17' ]
6+
pull_request:
7+
branches: [ 'develop', "release_**" , 'feat/JDK17' ]
8+
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
dependency-submission:
16+
runs-on: ubuntu-24.04-arm
17+
18+
steps:
19+
- name: Checkout sources
20+
uses: actions/checkout@v4
21+
- name: Setup Java
22+
uses: actions/setup-java@v4
23+
with:
24+
distribution: 'temurin'
25+
java-version: 17
26+
- name: Setup Gradle
27+
uses: gradle/actions/setup-gradle@v4
28+
- name: Generate and submit dependency graph
29+
uses: gradle/actions/dependency-submission@v4

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ println "Building for architecture: ${archInfo.name}, Java version: ${archInfo.j
5555

5656

5757
subprojects {
58+
apply plugin: "java"
5859
apply plugin: "jacoco"
5960
apply plugin: "maven-publish"
6061

common/build.gradle

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
plugins {
2-
id 'java'
3-
}
4-
51
version '1.0.0'
62

7-
sourceCompatibility = 1.8
8-
93

104
dependencies {
115
api group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.18.6' // https://github.com/FasterXML/jackson-databind/issues/3627
@@ -45,8 +39,8 @@ dependencies {
4539

4640
jacocoTestReport {
4741
reports {
48-
xml.enabled = true
49-
html.enabled = true
42+
xml.required.set(true)
43+
html.required.set(true)
5044
}
5145
getExecutionData().setFrom(fileTree('../framework/build/jacoco').include("**.exec"))
5246
afterEvaluate {

crypto/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
plugins {
2-
id 'java'
3-
}
4-
51
version '1.0.0'
62

73
sourceCompatibility = 1.8

suppression.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
4+
5+
<suppress>
6+
<notes><![CDATA[grpc-netty CVEs: these are false positives or already mitigated in grpc-netty >= 1.60.0.
7+
CVE-2019-20444, CVE-2019-20445, CVE-2015-2156, CVE-2019-16869: Netty HTTP/2 header smuggling/request smuggling - not applicable to gRPC transport usage.
8+
CVE-2025-55163: reported against Netty, not grpc-netty itself.
9+
CVE-2021-37136, CVE-2021-37137: Netty decompression OOM - gRPC does not use Netty's HTTP chunk decompressor.
10+
CVE-2022-41881: Netty HAProxyMessage OOM - not used by gRPC.
11+
CVE-2023-44487: HTTP/2 Rapid Reset - mitigated in grpc-java >= 1.58.0.]]></notes>
12+
<packageUrl regex="true">^pkg:maven/io\.grpc/grpc\-netty@.*$</packageUrl>
13+
<cve>CVE-2019-20444</cve>
14+
<cve>CVE-2019-20445</cve>
15+
<cve>CVE-2025-55163</cve>
16+
<cve>CVE-2015-2156</cve>
17+
<cve>CVE-2019-16869</cve>
18+
<cve>CVE-2021-37136</cve>
19+
<cve>CVE-2021-37137</cve>
20+
<cve>CVE-2022-41881</cve>
21+
<cve>CVE-2023-44487</cve>
22+
</suppress>
23+
24+
</suppressions>

0 commit comments

Comments
 (0)