@@ -26,26 +26,11 @@ The filter should (ideally) only allow java.lang.String and disallow all other c
26
26
27
27
<p >The key-value pair can be set as following:</p >
28
28
29
- <code >
30
- String stringsOnlyFilter = "java.lang.String;!*"; // Deny everything but java.lang.String
31
-
32
- Map< String, Object> env = new HashMap< String, Object> ;
33
- env.put(RMIConnectorServer.CREDENTIALS_FILTER_PATTERN, stringsOnlyFilter);
34
- </code >
29
+ <sample src =" example_filter_java_10.java" />
35
30
36
31
<p >For applications using Java 6u113 to 9:</p >
37
32
38
- <code >
39
- // This is deprecated in Java 10+ !
40
- Map< String, Object> env = new HashMap< String, Object> ;
41
- env.put (
42
- "jmx.remote.rmi.server.credential.types",
43
- new String[]{
44
- String[].class.getName(),
45
- String.class.getName()
46
- }
47
- );
48
- </code >
33
+ <sample src =" example_filter_java_9.java" />
49
34
50
35
<p >Please note that the JMX-RMI service is vulnerable in the default configuration.
51
36
For this reason an initialization with a <code >null</code > environment is also vulnerable.</p >
@@ -56,11 +41,11 @@ For this reason an initialization with a <code>null</code> environment is also v
56
41
57
42
<p >The first example shows how an JMX server is initialized securely with the <code >JMXConnectorServerFactory.newJMXConnectorServer()</code > call.</p >
58
43
59
- <sample src =" CorrectJmxInitialisation .java" />
44
+ <sample src =" CorrectJMXConnectorServerFactoryEnvironmentInitialisation .java" />
60
45
61
46
<p >The second example shows how a JMX Server is initialized securely if the <code >RMIConnectorServer</code > class is used.</p >
62
47
63
- <sample src =" CorrectRmiInitialisation .java" />
48
+ <sample src =" CorrectRMIConnectorServerEnvironmentInitalisation .java" />
64
49
65
50
</example >
66
51
0 commit comments