Add support for sensitive data in dumps (#1149)

* Add sensitive dumps

* Add better arg handling and offline dumps

* Add sensitive parameters for plugin IPs

* Add sensitive property to the Bedrock remote address

Co-authored-by: Camotoy <20743703+DoctorMacc@users.noreply.github.com>
This commit is contained in:
rtm516 2020-08-15 21:06:50 +01:00 committed by GitHub
parent 4bcf44638e
commit 4af17df46f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 98 additions and 28 deletions

View file

@ -28,6 +28,7 @@ package org.geysermc.platform.bungeecord;
import lombok.Getter;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.plugin.Plugin;
import org.geysermc.connector.common.serializer.AsteriskSerializer;
import org.geysermc.connector.dump.BootstrapDumpInfo;
import java.util.ArrayList;
@ -52,7 +53,13 @@ public class GeyserBungeeDumpInfo extends BootstrapDumpInfo {
this.plugins = new ArrayList<>();
for (net.md_5.bungee.api.config.ListenerInfo listener : proxy.getConfig().getListeners()) {
this.listeners.add(new ListenerInfo(listener.getHost().getHostString(), listener.getHost().getPort()));
String hostname;
if (AsteriskSerializer.showSensitive || (listener.getHost().getHostString().equals("") || listener.getHost().getHostString().equals("0.0.0.0"))) {
hostname = listener.getHost().getHostString();
} else {
hostname = "***";
}
this.listeners.add(new ListenerInfo(hostname, listener.getHost().getPort()));
}
for (Plugin plugin : proxy.getPluginManager().getPlugins()) {