Disable ASP.NET Web Service Test Pages
I’ve spend a lot of time writing web services on the many projects I’ve worked on. Over the years of working on these I’ve developed my own set of best practices for developing them. One of the important aspects I always cover is security. This article covers a simple step you can take in your web.config to disable the web service test page (the ASMX page).
Web.config Tweak to Remove Web Service Protocols
Open up your web.config and add the following snippet in:
<webServices>
<protocols>
<remove name="HttpGet" />
<remove name="HttpPost" />
<remove name="HttpPostLocalhost" />
</protocols>
</webServices>
You may still access the web services by consuming them via an application, but navigating to the ASMX test pages will no longer show a form that you can fill out to send test data. This is a simple step you can take to prevent unauthorized execution from the test page but it’s no where near as secure as it should be. Stay tuned as I’ll follow up on this topic with more things you can do to secure web services. The next topic will be on implementing SOAP headers for authorization to web services. Think of these SOAP headers as additional metadata sent to the web service to authorize a client by username and password.
1 Comment + Add Comment
Got anything to say? Go ahead and leave a comment!
Recent Comments
- Performance tuning your Sitecore installation | Agile and ALM: Software development today on A Going Live Checklist for Sitecore Websites
- Imran Saleem on Sitecore Avanced Database Crawler Occasionally Provides Null Results
- Ty Cahill on Sitecore Front-End Development Best Practices
- Sitecore Managed Sites as Virtual Folders | Fire Breaks Ice on Sitecore Item and Field Names
- Krimos on Using the DataSource Field with Sitecore Sublayouts
Sitecore Links
- .Sitecore
- Aboo Bolaky
- Alex Shyba
- Anders Dreyer
- aweber1.0
- Brian Pedersen
- Christopher Wojciech
- Coffee => Coder => Code
- Dev Sitecored²
- Everything Web
- Image0.com blog
- John West
- Learn Sitecore
- Let's do Sitecore
- Mark van Aalst
- Matthew Kenny
- Molten Core
- Project Lifecycle
- Sean Kearney
- Sebastian Patten
- Sitecore Australia
- Sitecore Blog
- Sitecore Climber
- Sitecore Development
- Sitecore Gadgets
- Techphoria414
- The Client View
- The Sitecore Experience
- Web Content Management and Delivery
Archives
- April 2013 (1)
- February 2013 (1)
- January 2013 (1)
- December 2012 (1)
- June 2012 (2)
- May 2012 (2)
- March 2012 (1)
- February 2012 (1)
- January 2012 (5)
- December 2011 (4)
- November 2011 (1)
- July 2011 (1)
- June 2011 (1)
- May 2011 (2)
- March 2011 (6)
- February 2011 (2)
- January 2011 (10)

Posted under:
Thank you for the tip;
What would be the difference between your approach and going with