First, determine which HTTP Methods your installation is responding too. I use browser plug-ins that enable me to submit HTTP requests, specifying the URL and HTTP method. There are various plugins available for Chrome and Firefox and I do not make any recommendations here.
Second, according to your test results, configure your Tomcat installtion to not respond for certain HTTP Methods. This can be configured at the instance level by inserting a <security-constraint> element directly under the <web-app> element, in the installations web.xml file located at.
[tomcatinstallation]/conf/web.xml
Below is the added configuration.
<security-constraint>
<web-resource-collection>
<web-resource-name>restricted methods</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>TRACE</http-method>
<http-method>PUT</http-method>
<http-method>OPTIONS</http-method>
<http-method>DELETE</http-method>
</web-resource-collection>
<auth-constraint />
</security-constraint>
The configuration above will disable the HTTP Methods TRACE, PUT, OPTIONS or DELETE.
Any questions, comment and I'll be sure to answer them.
How unused HTTP methods pose security risk ?
ReplyDeleteThe TRACE method simply echoes back to the client whatever string has been sent to the server, and it is used mainly for debugging purposes. The TRACE method, seemingly harmless, can be used to mount an attack known as Cross Site Tracing (XST). More info about XST can be found here:
ReplyDeletehttp://www.cgisecurity.com/whitehat-mirror/WH-WhitePaper_XST_ebook.pdf