Unfortunately, our Spring Boot 2 Application exposes the RMI Registry default port 1099 and our security team complains about that. We expect that JMX should exclusively be used via port 8999 in a safe manner. Currently, you can connect in both ways - insecure via port 1099 and secure by port 8999. We do not understand this so far because we actually have set the proper System Properties to prevent this:
-Dcom.sun.management.jmxremote=true
-Dcom.sun.management.jmxremote.port=8999
-Dcom.sun.management.jmxremote.rmi.port=8999
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=true
-Dcom.sun.management.jmxremote.password.file=/opt/our_app/jmxremote.password
-Dcom.sun.management.jmxremote.access.file=/opt/our_app/jmxremote.access
Why is port 1099 still open? I have to mention that Spring Actuator is in use too but I cannot find any configuration there to control the port, so it seems not to be the issue.
Thanks to Ravi Sharam who has given the solution in the comment above.
We had the following dependency in our project:
By starting the application additionally with System Property
the open default port 1099 was removed. Let's check it with netstat:
No open port 1099 is there anymore and only the expected one 8999. Yippiiii!