Search code examples
jboss

Prevent external access to one server group in jboss?


I am running jboss in domain mode.

I have a collect of services hosted in a server group in jboss. (I have to use jboss for the time being even though it is not the correct thing to use.) 2 of the services should be accessible from different hosts (not localhost) but the rest of the services should only be accessible from localhost. Is there anyway to give access from any machine to the 2 services but not the rest of the services?

Maybe I could split the services into two server groups and some how have different access rules for the two server groups?


Solution

  • So found out that if you put a file called undertow-handlers.conf in the WEB-INF folder of your webapp you can restrict access to your application in this file. So you can add the following line

    ip-access-control(default-allow=false, acl={'127.0.0.1 allow'})

    this means only requests coming from 127.0.0.1 will be accepted.