views:

212

answers:

1

Is there an open source filter that I can use on Tomcat to prevent access to certain path (say /a/b/*) when the request comes from a given interface?

The use case: I have REST services deployed on Tomcat that should only be accessed by the application itself, but which for security reasons should not be accessible from the outside world. I could do this in Apache, if Apache was used as a front-end, but in this case it is not.

+1  A: 

Not sure if there's an open source one that you can use, but writing one that checks where does a request come from is quite easy.

See getPathTranslated(), getRemoteAddr, etc.

yc

yclian