Hawtio fails to connect to remote jolokia

974 Views Asked by At

I have a core java application which starts an embedded jolokia (version 1.6.0) agent thusly:

JolokiaServer server = new JolokiaSerser( new JvmAgentConfig(configMap), false);
server.start();

When I run it locally, I am able to connect to it via hawtio (version 2.13.2) and browse mbeans under the jmx tab.

However, if I deploy it to a remote box and try to connect, hawtio says "Host not whitelisted". I've tried to add the two flags I found via googling:

java -Dhawtio.proxyWhitelist='*' -Dhawtio.proxyAllowlist='*' hawtio-app-2.13.2.jar --port 9090

I still get the same error when connecting. Any ideas as to what I am doing wrong?

Thanks

1

There are 1 best solutions below

0
On

I think you have the right idea but researching this yielded a result that seems to imply you can't use wildcard the way you are using.

See page: https://medium.com/@tadayoshi.sato/securing-hawtio-f5fbfd5afcf0

If this guidance is complete then you should try entering an exact/full IP to test for starters. Assuming that works the way you like it then follow the regex guidance to get a broader match.

Or if you want to just jump right in it looks like you can just do the same wildcard you're doing but use their regex style.. so set the whitelist params to

r:.+

Or possibly

r:.*

Instead of writing just *