Tomcat: block requests for specific paths for requests coming from specific interfaces

Is there an open source filter that I can use for Tomcat to prevent access to a specific path (e.g. / a / b / *) when a request comes from a given interface?

Use case. I have REST services deployed to Tomcat that should only be accessed by the application itself, but for security reasons should not be accessible from the outside world. I could have done this in Apache if Apache was used as an interface, but in this case it is not.

0


source to share


1 answer


Not sure if there is open source that you can use, but writing one that checks where the request comes from is pretty straightforward.

See getPathTranslated () , getRemoteAddr , etc.



YC

+1


source







All Articles