Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security headers? How? #35

Open
asadsahi opened this issue Nov 13, 2017 · 9 comments
Open

Security headers? How? #35

asadsahi opened this issue Nov 13, 2017 · 9 comments

Comments

@asadsahi
Copy link

I can see security headers added on live site, but can't find middleware reponsible for it?

@madskristensen
Copy link
Owner

Check out _ViewStart.cshtml

@asadsahi
Copy link
Author

Thanks @madskristensen wonderful.

Can web.config items be handled in same file as well?

 <httpProtocol>
      <customHeaders>
        <add name="X-Content-Type-Options" value="nosniff"/>
        <remove name="X-Powered-By" />
      </customHeaders>
    </httpProtocol>

@madskristensen
Copy link
Owner

That one should be middleware instead of web.config and it cannot be _ViewStart.cshtml because those headers applies to more than just text/html

@asadsahi
Copy link
Author

asadsahi commented Nov 14, 2017

Interesting. In SPA application will the ViewStart headers be applied to all requests? If not, what middleware do you reckon for asp.net core, something like helmet?

@asadsahi
Copy link
Author

asadsahi commented Nov 15, 2017

for now I have used https://github.com/andrewlock/NetEscapades.AspNetCore.SecurityHeaders

But was looking if Microsoft has a builtin way to add such middleware.

Thanks for this wondersful effort of creating blog engine. I have taking some nice concepts from this such as SEO and implementing in my own application.

Great work :)

@madskristensen
Copy link
Owner

madskristensen commented Nov 17, 2017

@asadsahi It looks like @andrewlock might modify his awesome security headers NuGet package so we can use it in Miniblog.Core. That would be great.

@asadsahi
Copy link
Author

asadsahi commented Nov 18, 2017

Nice. I am currently using @andrewlock 's package for security headers and @juunas11 's package for CSP. Asked Andrew if he can combine concepts of both types of security headers into one package to make job easier. Will make life easy rather relying on multiple packages. Also I really like your suggestion of simplifying Andrew's package.

@andrewlock
Copy link

Just FYI, I'm going to try and add CSP and get the simplified method in this week :)

@asadsahi
Copy link
Author

@andrewlock great 👍

MattLavalleeMA pushed a commit to MattLavalleeMA/Miniblog.Core that referenced this issue Jun 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants