Security Headers

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);

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.


comments powered by Disqus