Add Content-Security-Policy (CSP) health check#16830
Add Content-Security-Policy (CSP) health check#16830lauraneto merged 3 commits intoumbraco:contribfrom
Conversation
|
Hi there @erikjanwestendorp, thank you for this contribution! 👍 While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
|
Hi @erikjanwestendorp , |
| [Obsolete("This link is not used anymore in the XSS protected check.")] | ||
| public const string XssProtectionCheck = "https://umbra.co/healthchecks-xss-protection"; | ||
| public const string ExcessiveHeadersCheck = "https://umbra.co/healthchecks-excessive-headers"; | ||
| public const string CspHeaderCheck = "https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP"; |
There was a problem hiding this comment.
Would be nice if you (or someone else) could also add a page to the umbraco docs (like the others, e.g. https://docs.umbraco.com/umbraco-cms/extending/health-check/guides/clickjackingprotection). 🙂
There was a problem hiding this comment.
@lauraneto Totally agree, I just created an issue and I will add a page to the docs.
Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>
Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>
|
This is now merged! |
Added a health check to see if a CSP header is present.
When present:

If not:

This can be tested by adding a CSP header and running the health checks: