Funky Si's Tech Talk by Simon Foster

Security Headers

26 September 2020
security dotnet 

Have you wondered what info you are leaking via your response headers?, do you want some kind of guide about what headers to set or remove altogether?

Head on over to This is a site created by security expert Scott Helme that rates a URL based on what response headers it can see.

I am pleased to say is now getting an A.Alt Text

So how do you add/remove headers in dotnet core?

In my configure method in Startup.cs I have the following code block.

    next =>
        return async context =>
                () =>
                    context.Response.Headers.Add("Permissions-Policy", "microphone=()");     
                    return Task.CompletedTask;

             await next(context);
Enter fullscreen mode Exit fullscreen mode

I have only included a few of the headers I am adding as the excellent can tell you which headers you should add and what options you might want.

Simon Foster
Views: 107   Reactions: 8  
An error has occurred. This application may no longer respond until reloaded. Reload 🗙