Skip to content

Commit

Permalink
Feat: Redact remote endpoint IP addresses in log messages. (#2188)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanLennox authored Jul 10, 2024
1 parent d98c8b5 commit 877b6a2
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
16 changes: 14 additions & 2 deletions jvb/src/main/java/org/jitsi/videobridge/Conference.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,14 @@ public Conference(Videobridge videobridge,
{
try
{
logger.info("RECV colibri2 request: " + XmlStringBuilderUtil.toStringOpt(request.getRequest()));
logger.info( () -> {
String reqStr = XmlStringBuilderUtil.toStringOpt(request.getRequest());
if (VideobridgeConfig.getRedactRemoteAddresses())
{
reqStr = RedactColibriIp.Companion.redact(reqStr);
}
return "RECV colibri2 request: " + reqStr;
});
long start = System.currentTimeMillis();
Pair<IQ, Boolean> p = colibri2Handler.handleConferenceModifyIQ(request.getRequest());
IQ response = p.getFirst();
Expand All @@ -236,8 +243,13 @@ public Conference(Videobridge videobridge,
request.getTotalDelayStats().addDelay(totalDelay);
if (processingDelay > 100)
{
String reqStr = XmlStringBuilderUtil.toStringOpt(request.getRequest());
if (VideobridgeConfig.getRedactRemoteAddresses())
{
reqStr = RedactColibriIp.Companion.redact(reqStr);
}
logger.warn("Took " + processingDelay + " ms to process an IQ (total delay "
+ totalDelay + " ms): " + XmlStringBuilderUtil.toStringOpt(request.getRequest()));
+ totalDelay + " ms): " + reqStr);
}
logger.info("SENT colibri2 response: " + XmlStringBuilderUtil.toStringOpt(response));
request.getCallback().invoke(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,10 @@ class VideobridgeConfig private constructor() {
val initialDrainMode: Boolean by config {
"videobridge.initial-drain-mode".from(JitsiConfig.newConfig)
}

@JvmStatic
val redactRemoteAddresses: Boolean by config {
"videobridge.redact-remote-addresses".from(JitsiConfig.newConfig)
}
}
}
1 change: 1 addition & 0 deletions jvb/src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ ice4j {
use-dynamic-ports = false
}
}
redact-remote-addresses = ${videobridge.redact-remote-addresses}
}
3 changes: 3 additions & 0 deletions jvb/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,9 @@ videobridge {
# size for which the filter is enabled.
stats-filter-threshold = 20

# Whether to redact remote endpoint IP addresses from logs
redact-remote-addresses = true

ssrc-limit {
# maximum number of SSRCs to send to an endpoint for video
video = 50
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>ice4j</artifactId>
<version>3.0-69-ga53b402</version>
<version>3.0-72-g824cd4b</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jitsi-xmpp-extensions</artifactId>
<version>1.0-80-g0ce9883</version>
<version>1.0-81-g3816e5a</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down

0 comments on commit 877b6a2

Please sign in to comment.