diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/serialization/filter/LocatorLauncherWithJmxManager.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/serialization/filter/LocatorLauncherWithJmxManager.java index 8bd96f5545c1..b07683e27be8 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/internal/serialization/filter/LocatorLauncherWithJmxManager.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/serialization/filter/LocatorLauncherWithJmxManager.java @@ -67,7 +67,9 @@ public void setUpPorts() { @Before public void setUpFilterPattern() { - openMBeanFilterPattern = new OpenMBeanFilterPattern().pattern(); + openMBeanFilterPattern = new SanctionedSerializablesFilterPattern() + .append("javax.security.auth.Subject") + .pattern(); } SystemManagementService getSystemManagementService() { diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/serialization/filter/ServerLauncherWithJmxManager.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/serialization/filter/ServerLauncherWithJmxManager.java index eba157c609b5..d2a2eeeeb7e7 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/internal/serialization/filter/ServerLauncherWithJmxManager.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/serialization/filter/ServerLauncherWithJmxManager.java @@ -63,7 +63,9 @@ public void setUpPorts() { @Before public void setUpFilterPattern() { - openMBeanFilterPattern = new OpenMBeanFilterPattern().pattern(); + openMBeanFilterPattern = new SanctionedSerializablesFilterPattern() + .append("javax.security.auth.Subject") + .pattern(); } SystemManagementService getSystemManagementService() { diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java b/geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java index 82f908459f6a..77c931bf2904 100755 --- a/geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java @@ -444,6 +444,14 @@ private void configureAndStart() throws IOException { String[].class.getName(), String.class.getName()}); + // Carry the connector options that are configured as system properties into the + // environment of this manually constructed connector server, so that they take + // effect here as they would for a connector server created by the platform. + String configuredPattern = System.getProperty(RMIConnectorServer.SERIAL_FILTER_PATTERN); + if (configuredPattern != null) { + env.put(RMIConnectorServer.SERIAL_FILTER_PATTERN, configuredPattern); + } + // Manually creates and binds a JMX RMI Connector Server stub with the // registry created above: the port we pass here is the port that can // be specified in "service:jmx:rmi://"+hostname+":"+port - where the diff --git a/geode-serialization/src/main/java/org/apache/geode/internal/serialization/filter/SystemPropertyJmxSerialFilterConfigurationFactory.java b/geode-serialization/src/main/java/org/apache/geode/internal/serialization/filter/SystemPropertyJmxSerialFilterConfigurationFactory.java index 6f9fbd77462e..0da41b433bfc 100644 --- a/geode-serialization/src/main/java/org/apache/geode/internal/serialization/filter/SystemPropertyJmxSerialFilterConfigurationFactory.java +++ b/geode-serialization/src/main/java/org/apache/geode/internal/serialization/filter/SystemPropertyJmxSerialFilterConfigurationFactory.java @@ -36,7 +36,11 @@ public class SystemPropertyJmxSerialFilterConfigurationFactory public SystemPropertyJmxSerialFilterConfigurationFactory() { // JmxSerialFilter requires Java 9 or greater this(isJavaVersionAtLeast(JAVA_9) && isBlank(System.getProperty(PROPERTY_NAME)), - new OpenMBeanFilterPattern().pattern()); + // The RMI connector protocol conveys a delegation subject with every operation, so the + // connector's pattern must accept it in addition to the shared dependencies. + new SanctionedSerializablesFilterPattern() + .append("javax.security.auth.Subject") + .pattern()); } @VisibleForTesting