Skip to content

Commit d6508f6

Browse files
chore: update grpc, jackson (#82)
* chore: update grpc, jackson * chore: apply a max rst window * upgrade grpc utils * upgrade grpc utils --------- Co-authored-by: SJ <48863181+skjindal93@users.noreply.github.com>
1 parent 2b98d27 commit d6508f6

File tree

7 files changed

+40
-16
lines changed

7 files changed

+40
-16
lines changed

docstore-metrics/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ dependencies {
1111

1212
api(libs.hypertrace.documentStore)
1313
api(project(":service-framework-spi"))
14+
api(platform("com.fasterxml.jackson:jackson-bom:2.16.0"))
1415
implementation(project(":platform-metrics"))
1516
}

owasp-suppressions.xml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,7 @@
88
<cpe>cpe:/a:grpc:grpc</cpe>
99
<cpe>cpe:/a:utils_project:utils</cpe>
1010
</suppress>
11-
<suppress>
12-
<notes><![CDATA[
13-
Not a real CVE.
14-
]]></notes>
15-
<packageUrl regex="true">^pkg:maven/com\.fasterxml\.jackson\.core/jackson\-databind@.*$</packageUrl>
16-
<cve>CVE-2023-35116</cve>
17-
</suppress>
18-
<suppress until="2023-11-30Z">
11+
<suppress until="2023-12-31Z">
1912
<notes><![CDATA[
2013
This CVE is declared fixed from 9.4.52, but the vuln db is not reflecting that. Suppress that specific version until
2114
db is updated.
@@ -25,4 +18,25 @@
2518
<packageUrl regex="true">^pkg:maven/org\.eclipse\.jetty/jetty\-servlets@9.4.53\..*$</packageUrl>
2619
<vulnerabilityName>CVE-2023-36479</vulnerabilityName>
2720
</suppress>
21+
<suppress until="2023-12-31Z">
22+
<notes><![CDATA[
23+
This CVE (rapid RST) is already mitigated as our servers aren't directly exposed, but it's also
24+
addressed in 1.59.1, which the CVE doesn't reflect (not all grpc impls versions are exactly aligned).
25+
Ref: https://github.com/grpc/grpc-java/pull/10675
26+
]]></notes>
27+
<packageUrl regex="true">^pkg:maven/io\.grpc/grpc\-.*@.*$</packageUrl>
28+
<cve>CVE-2023-44487</cve>
29+
</suppress>
30+
<suppress until="2023-12-31Z">
31+
<notes><![CDATA[
32+
This vulnerability is disputed, with the argument that SSL configuration is the responsibility of the client rather
33+
than the transport. The change in default is under consideration for the next major Netty release, revisit then.
34+
Regardless, our client (which is what brings in this dependency) enables the concerned feature, hostname verification
35+
Ref:
36+
https://github.com/grpc/grpc-java/issues/10033
37+
https://github.com/netty/netty/issues/8537#issuecomment-1527896917
38+
]]></notes>
39+
<packageUrl regex="true">^pkg:maven/io\.netty/netty.*@.*$</packageUrl>
40+
<vulnerabilityName>CVE-2023-4586</vulnerabilityName>
41+
</suppress>
2842
</suppressions>

platform-grpc-service-framework/build.gradle.kts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,19 @@ plugins {
77

88
dependencies {
99
api(project(":platform-service-framework"))
10-
api(platform("io.grpc:grpc-bom:1.57.2"))
10+
api(platform("io.grpc:grpc-bom:1.59.1"))
1111
api("io.grpc:grpc-api")
1212
api("io.grpc:grpc-services")
13-
api("org.hypertrace.core.grpcutils:grpc-client-utils:0.12.6")
13+
api("org.hypertrace.core.grpcutils:grpc-client-utils:0.12.7")
1414
api("com.typesafe:config:1.4.2")
1515
api(project(":service-framework-spi"))
1616

1717
annotationProcessor("org.projectlombok:lombok:1.18.24")
1818
compileOnly("org.projectlombok:lombok:1.18.24")
1919

2020
implementation(project(":platform-metrics"))
21+
implementation("io.grpc:grpc-inprocess")
22+
implementation("io.grpc:grpc-netty")
2123
implementation("org.slf4j:slf4j-api:1.7.36")
22-
implementation("org.hypertrace.core.grpcutils:grpc-server-utils:0.12.6")
24+
implementation("org.hypertrace.core.grpcutils:grpc-server-utils:0.12.7")
2325
}

platform-grpc-service-framework/src/main/java/org/hypertrace/core/serviceframework/grpc/GrpcPlatformServerDefinition.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,20 @@
33
import io.grpc.ServerInterceptor;
44
import java.util.Collection;
55
import java.util.List;
6+
import lombok.AccessLevel;
7+
import lombok.AllArgsConstructor;
68
import lombok.Builder;
79
import lombok.Singular;
810
import lombok.Value;
911

1012
@Value
13+
@AllArgsConstructor(access = AccessLevel.PRIVATE)
1114
@Builder
1215
public class GrpcPlatformServerDefinition {
1316
String name;
1417
int port;
1518
int maxInboundMessageSize;
19+
@Builder.Default int maxRstPerMinute = 500;
1620
@Singular Collection<GrpcPlatformServiceFactory> serviceFactories;
1721
@Singular List<ServerInterceptor> serverInterceptors;
1822
}

platform-grpc-service-framework/src/main/java/org/hypertrace/core/serviceframework/grpc/GrpcPlatformServiceContainer.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import io.grpc.health.v1.HealthGrpc;
1212
import io.grpc.health.v1.HealthGrpc.HealthBlockingStub;
1313
import io.grpc.inprocess.InProcessServerBuilder;
14+
import io.grpc.netty.NettyServerBuilder;
1415
import io.grpc.protobuf.services.HealthStatusManager;
1516
import io.micrometer.core.instrument.binder.grpc.MetricCollectingClientInterceptor;
1617
import io.micrometer.core.instrument.binder.grpc.MetricCollectingServerInterceptor;
@@ -233,11 +234,14 @@ protected abstract GrpcServiceContainerEnvironment buildContainerEnvironment(
233234
InProcessGrpcChannelRegistry channelRegistry, HealthStatusManager healthStatusManager);
234235

235236
private ServerBuilder<?> initializeBuilder(GrpcPlatformServerDefinition serverDefinition) {
236-
ServerBuilder<?> builder = ServerBuilder.forPort(serverDefinition.getPort());
237+
NettyServerBuilder builder = NettyServerBuilder.forPort(serverDefinition.getPort());
237238

238239
if (serverDefinition.getMaxInboundMessageSize() > 0) {
239240
builder.maxInboundMessageSize(serverDefinition.getMaxInboundMessageSize());
240241
}
242+
if (serverDefinition.getMaxRstPerMinute() > 0) {
243+
builder.maxRstFramesPerWindow(serverDefinition.getMaxRstPerMinute(), 60);
244+
}
241245
// add micrometer-grpc interceptor to collect server metrics.
242246
builder.intercept(
243247
new MetricCollectingServerInterceptor(PlatformMetricsRegistry.getMeterRegistry()));
@@ -248,6 +252,7 @@ private ServerBuilder<?> initializeBuilder(GrpcPlatformServerDefinition serverDe
248252

249253
@Value
250254
private static class ConstructedServer {
255+
251256
String name;
252257
Server server;
253258
}

platform-http-service-framework/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55

66
dependencies {
77
api(project(":platform-service-framework"))
8-
api("org.hypertrace.core.grpcutils:grpc-client-utils:0.12.6")
8+
api("org.hypertrace.core.grpcutils:grpc-client-utils:0.12.7")
99
api("com.typesafe:config:1.4.2")
1010
api("javax.servlet:javax.servlet-api:4.0.1")
1111
api("com.google.inject:guice:5.1.0")

platform-service-framework/build.gradle.kts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@ tasks.test {
1111

1212
dependencies {
1313
api(project(":service-framework-spi"))
14+
api(platform("com.fasterxml.jackson:jackson-bom:2.16.0"))
1415
implementation(project(":platform-metrics"))
1516

1617
api("org.slf4j:slf4j-api:1.7.36")
1718
api("com.typesafe:config:1.4.2")
1819

1920
// Use for thread dump servlet
2021
implementation("io.dropwizard.metrics:metrics-servlets:4.2.16")
21-
constraints {
22-
implementation("com.fasterxml.jackson.core:jackson-databind:2.15.2")
23-
}
2422
implementation("org.eclipse.jetty:jetty-servlet:9.4.53.v20231009")
2523

2624
// Use for metrics servlet

0 commit comments

Comments
 (0)