Content Content Security Policy (CSP)
Implement a Content Security Policy (CSP) to protect your Umbraco site from XSS and data injection.
This check verifies if your site has a Content Security Policy (CSP) header to defend against Cross-Site Scripting (XSS) and data injection attacks.
How to fix this health check
This health check can be fixed by adding a header before the response is started.
Preferable you use a security library like NWebSec.
Adding a Content Security Policy (CSP) using NWebSec
If you take a NuGet dependency on NWebsec.AspNetCore.Middleware/, you can use third extension methods on IApplicationBuilder
.
Adding a Content Security Policy (CSP) using manual middleware
Avoid third-party library dependencies by using custom middleware added to the request pipeline as shown below.
Last updated