Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing Server and X-Powered-By HTTP Headers on Azure Web Site Preview

Tags:

azure

For security I want to remove any HTTP headers that reveals details about the OS, Web Server or Framework that my application is running. I was able to remove all from displaying locally with IIS Express using the articles found on SO and elsewhere. Unfortunately when I published to my Azure Web Site preview, three headers remained:

  1. Server: Microsoft-IIS/7.5
  2. X-Powered-By: ARR/2.5
  3. X-Powered-By: ASP.NET

The articles I'm finding are for Azure Web Roles instead of Web Site Preview, such as this one.

Does anyone know how to remove from Web Site Preview?

like image 322
Josh Avatar asked Jan 14 '23 09:01

Josh


1 Answers

Windows Azure Websites are shared infrastructure and you do not have access to configure IIS as you do in a Web Role. As you have correctly pointed out you could remove these headers:

  • X-AspNet-Version
  • X-AspNetMvc-Version

but are left with the following:

  • Server: Microsoft-IIS/7.5
  • X-Powered-By: ARR/2.5
  • X-Powered-By: ASP.NET

Even if you implement all the necessary steps to suppress these headers you will see from my blog post that illegal requests will be handled by HTTP.SYS at the kernel level which will return the Microsoft-HTTPAPI/2.0 header. You need to edit the registry to remove this header.

The conclusion is that if you want ultimate control of IIS and HTTP.SYS you will need to host your website in a non-shared infrastructure. So your option is a Web Role in a Windows Azure Cloud Service.

like image 123
Paul Bouwer Avatar answered May 12 '23 18:05

Paul Bouwer