Note that there are some explanatory texts on larger screens.

plurals
  1. POSecuring http headers
    primarykey
    data
    text
    <p>I Have website that is in production server and it supposed to be very secure so i want to secure http header so that no unwanted information is leaked.</p> <p>I have searched on net about securing http headers and so far found that we can remove un anted information like removing</p> <pre><code>'Server Microsoft-IIS/7.5 X-AspNet-Version 4.0.303319 X-Powered-By ASP.NET -' </code></pre> <p>I have found solution for X-Aspnet and X powered by : 1. For X-AspNet i have added below code in system.web section </p> <pre><code>&lt;httpRuntime enableVersionHeader="false"/&gt; </code></pre> <ol> <li><p>For X-Powered i have added below code in system.webserver section</p> <p> </p></li> </ol> <p>But for Server header removal code is not working :(</p> <p>Code i am using for is :</p> <ol> <li><p>I have added a class with name CustomHeaderModule and inside that class code is as below</p> <p>/// /// Summary description for CustomHeaderModule /// public class CustomHeaderModule : IHttpModule {</p> <pre><code>public void Dispose() { throw new NotImplementedException(); } public void Init(HttpApplication context) { context.PostReleaseRequestState += PostReleaseRequestState; } void PostReleaseRequestState(object sender, EventArgs e) { //HttpContext.Current.Response.Headers.Remove("Server"); // Or you can set something funny HttpContext.Current.Response.Headers.Set("Server", "CERN httpd"); } </code></pre> <p>}</p></li> </ol> <p>and then registered this in web.config under system.webserver section</p> <pre><code>&lt;modules runAllManagedModulesForAllRequests="true"&gt; &lt;add name="CustomHeaderModule" type="CustomHeaderModule" /&gt; &lt;/modules&gt; </code></pre> <p>Now this code is not working ..i am still seeing server in header in chrome browser..</p> <p>how can i fix this and apart from these 3 setting is there any other to secure more ?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload