I don't want to bother with SSL and passwords each time, but still don't want my program's JMX functionality reachable by others on the LAN.
I populated my ~/.java.policy
thus:
grant principal javax.management.remote.JMXPrincipal "*" {
permission java.net.SocketPermission "127.0.0.1", "accept";
permission java.net.SocketPermission "my.lan.ip.addr", "accept";
permission java.net.SocketPermission "another.lan.ip.addr", "accept";
permission java.net.SocketPermission "*", "resolve";
}
Unfortunately, this does not seem to have an effect -- when the program is started with:
-Djava.security.manager
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=1234
its JMX functionality remains accessible from anywhere, not just from the few IPs listed.
How to do it correctly? Thank you!