Skip to content

Commit 08b7439

Browse files
refactor: update vulns, add dep check (#46)
1 parent 2136f89 commit 08b7439

File tree

13 files changed

+39
-94
lines changed

13 files changed

+39
-94
lines changed

.github/CODEOWNERS

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Each line is a file pattern followed by one or more owners.
22

33
# global
4-
* @buchi-busireddy @tim-mwangi @surajpuvvada @avinashkolluru
4+
* @hypertrace/platform-util-owners
55

66
# GH action
7-
.github/ @aaron-steinfeld @jbahire @kotharironak @buchi-busireddy
7+
.github/ @hypertrace/ci-owners

.github/workflows/codeql-analysis.yml

-15
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,6 @@ jobs:
2828
- name: Checkout repository
2929
uses: actions/checkout@v3
3030

31-
- name: create checksum file
32-
uses: hypertrace/github-actions/checksum@main
33-
34-
- name: create checksum file
35-
uses: hypertrace/github-actions/checksum@main
36-
37-
- name: Cache packages
38-
uses: actions/cache@v2
39-
with:
40-
path: ~/.gradle
41-
key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }}
42-
restore-keys: |
43-
gradle-packages-${{ runner.os }}-${{ github.job }}
44-
gradle-packages-${{ runner.os }}
45-
4631
# Initializes the CodeQL tools for scanning.
4732
- name: Initialize CodeQL
4833
uses: github/codeql-action/init@v2

.github/workflows/pr-build.yml

+2-32
Original file line numberDiff line numberDiff line change
@@ -9,47 +9,17 @@ on:
99

1010
jobs:
1111
build:
12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-22.04
1313
steps:
1414
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
1515
- name: Check out code
16-
uses: actions/checkout@v2.3.4
16+
uses: actions/checkout@v3
1717
with:
1818
ref: ${{github.event.pull_request.head.ref}}
1919
repository: ${{github.event.pull_request.head.repo.full_name}}
2020
fetch-depth: 0
21-
22-
- name: create checksum file
23-
uses: hypertrace/github-actions/checksum@main
24-
25-
- name: Cache packages
26-
id: cache-packages
27-
uses: actions/cache@v2
28-
with:
29-
path: ~/.gradle
30-
key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }}
31-
restore-keys: |
32-
gradle-packages-${{ runner.os }}-${{ github.job }}
33-
gradle-packages-${{ runner.os }}
3421

3522
- name: Build with Gradle
3623
uses: hypertrace/github-actions/gradle@main
3724
with:
3825
args: build
39-
40-
snyk-scan:
41-
runs-on: ubuntu-20.04
42-
steps:
43-
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
44-
- name: Check out code
45-
uses: actions/[email protected]
46-
with:
47-
ref: ${{github.event.pull_request.head.ref}}
48-
repository: ${{github.event.pull_request.head.repo.full_name}}
49-
fetch-depth: 0
50-
- name: Setup snyk
51-
uses: snyk/actions/[email protected]
52-
- name: Snyk test
53-
run: snyk test --all-sub-projects --org=hypertrace --severity-threshold=low --policy-path=.snyk --configuration-matching='^runtimeClasspath$' --remote-repo-url='https://github.com/hypertrace/java-grpc-utils.git'
54-
env:
55-
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

.github/workflows/pr-test.yml

+12-18
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,21 @@ on:
77

88
jobs:
99
test:
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
1111
steps:
1212
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
1313
- name: Check out code
14-
uses: actions/checkout@v2.3.4
14+
uses: actions/checkout@v3
1515
with:
1616
fetch-depth: 0
17-
18-
- name: create checksum file
19-
uses: hypertrace/github-actions/checksum@main
20-
21-
- name: Cache packages
22-
id: cache-packages
23-
uses: actions/cache@v2
24-
with:
25-
path: ~/.gradle
26-
key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }}
27-
restore-keys: |
28-
gradle-packages-${{ runner.os }}-${{ github.job }}
29-
gradle-packages-${{ runner.os }}
3017

3118
- name: Unit test
3219
uses: hypertrace/github-actions/gradle@main
3320
with:
3421
args: build jacocoTestReport
3522

3623
- name: Upload coverage to Codecov
37-
uses: codecov/codecov-action@v2
24+
uses: codecov/codecov-action@v3
3825
with:
3926
name: unit test reports
4027
fail_ci_if_error: true
@@ -46,15 +33,22 @@ jobs:
4633
args: copyAllReports --output-dir=/tmp/test-reports
4734

4835
- name: Archive test reports
49-
uses: actions/upload-artifact@v1
36+
uses: actions/upload-artifact@v3
5037
with:
5138
name: test-reports
5239
path: /tmp/test-reports
5340
if: always()
5441

5542
- name: Publish Unit Test Results
56-
uses: docker://ghcr.io/enricomi/publish-unit-test-result-action:v1.6
43+
uses: EnricoMi/publish-unit-test-result-action@v2
5744
if: always()
5845
with:
5946
github_token: ${{ secrets.GITHUB_TOKEN }}
6047
files: ./**/build/test-results/**/*.xml
48+
49+
dependency-check:
50+
runs-on: ubuntu-22.04
51+
steps:
52+
- name: Dependency Check
53+
uses: hypertrace/github-actions/dependency-check@main
54+

.github/workflows/publish.yml

+2-14
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,14 @@ on:
88

99
jobs:
1010
publish-artifacts:
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-22.04
1212
steps:
1313
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
1414
- name: Check out code
15-
uses: actions/checkout@v2.3.4
15+
uses: actions/checkout@v3
1616
with:
1717
fetch-depth: 0
1818

19-
- name: create checksum file
20-
uses: hypertrace/github-actions/checksum@main
21-
22-
- name: Cache packages
23-
uses: actions/cache@v2
24-
with:
25-
path: ~/.gradle
26-
key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }}
27-
restore-keys: |
28-
gradle-packages-${{ runner.os }}-${{ github.job }}
29-
gradle-packages-${{ runner.os }}
30-
3119
- name: publish java artifacts
3220
uses: hypertrace/github-actions/gradle@main
3321
with:

.snyk

-3
This file was deleted.

build.gradle.kts

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ plugins {
77
id("org.hypertrace.publish-plugin") version "1.0.2" apply false
88
id("org.hypertrace.jacoco-report-plugin") version "0.2.0" apply false
99
id("org.hypertrace.code-style-plugin") version "1.1.2" apply false
10+
id("org.owasp.dependencycheck") version "8.2.1"
1011
}
1112

1213
subprojects {
@@ -26,3 +27,10 @@ subprojects {
2627

2728
apply(plugin = "org.hypertrace.code-style-plugin")
2829
}
30+
31+
dependencyCheck {
32+
format = org.owasp.dependencycheck.reporting.ReportGenerator.Format.ALL.toString()
33+
suppressionFile = "owasp-suppressions.xml"
34+
scanConfigurations.add("runtimeClasspath")
35+
failBuildOnCVSS = 3.0F
36+
}

grpc-client-rx-utils/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
}
77

88
dependencies {
9-
api(platform("io.grpc:grpc-bom:1.50.0"))
9+
api(platform("io.grpc:grpc-bom:1.56.0"))
1010
api("io.reactivex.rxjava3:rxjava:3.1.4")
1111
api("io.grpc:grpc-stub")
1212
api(project(":grpc-context-utils"))

grpc-client-utils/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77

88
dependencies {
99

10-
api(platform("io.grpc:grpc-bom:1.50.0"))
10+
api(platform("io.grpc:grpc-bom:1.56.0"))
1111
api("io.grpc:grpc-context")
1212
api("io.grpc:grpc-api")
1313
api(platform("io.netty:netty-bom:4.1.86.Final")) {

grpc-context-utils/build.gradle.kts

+3-6
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,18 @@ tasks.test {
1010
}
1111

1212
dependencies {
13-
api(platform("io.grpc:grpc-bom:1.50.0"))
13+
api(platform("io.grpc:grpc-bom:1.56.0"))
1414
implementation("io.grpc:grpc-core")
1515

1616
implementation("com.auth0:java-jwt:4.4.0")
1717
implementation("com.auth0:jwks-rsa:0.22.0")
18-
implementation("com.google.guava:guava:31.1-jre")
18+
implementation("com.google.guava:guava:32.0.1-jre")
1919
implementation("org.slf4j:slf4j-api:1.7.36")
2020

2121
annotationProcessor("org.projectlombok:lombok:1.18.24")
2222
compileOnly("org.projectlombok:lombok:1.18.24")
2323

2424
constraints {
25-
implementation("com.fasterxml.jackson.core:jackson-databind:2.13.4.2") {
26-
because("https://nvd.nist.gov/vuln/detail/CVE-2022-42003")
27-
}
2825
implementation("com.google.protobuf:protobuf-java:3.21.7") {
2926
// Not used directly, but typically used together for since we always use proto and grpc together
3027
because("CVE-2022-3171")
@@ -33,7 +30,7 @@ dependencies {
3330

3431
testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
3532
testImplementation("org.mockito:mockito-core:4.4.0")
36-
testImplementation("com.fasterxml.jackson.core:jackson-annotations:2.13.4")
33+
testImplementation("com.fasterxml.jackson.core:jackson-annotations:2.15.2")
3734
testAnnotationProcessor("org.projectlombok:lombok:1.18.24")
3835
testCompileOnly("org.projectlombok:lombok:1.18.24")
3936
}

grpc-server-rx-utils/build.gradle.kts

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ plugins {
66
}
77

88
dependencies {
9-
api(platform("io.grpc:grpc-bom:1.50.0"))
9+
api(platform("io.grpc:grpc-bom:1.56.0"))
1010
api("io.reactivex.rxjava3:rxjava:3.1.4")
1111
api("io.grpc:grpc-stub")
1212

1313
annotationProcessor("org.projectlombok:lombok:1.18.24")
1414
compileOnly("org.projectlombok:lombok:1.18.24")
1515

1616
implementation("org.slf4j:slf4j-api:1.7.36")
17+
constraints {
18+
implementation("com.google.guava:guava:32.0.1-jre")
19+
}
1720

1821
testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
1922
testImplementation("org.mockito:mockito-core:4.4.0")

grpc-server-utils/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ tasks.test {
1010
}
1111

1212
dependencies {
13-
api(platform("io.grpc:grpc-bom:1.50.0"))
13+
api(platform("io.grpc:grpc-bom:1.56.0"))
1414
api("io.grpc:grpc-context")
1515
api("io.grpc:grpc-api")
1616

owasp-suppressions.xml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
3+
</suppressions>

0 commit comments

Comments
 (0)