Skip to content

Matthew-Wise/Umbraco-CSP-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Umbraco CSP (Content security policy) manager

Platform GitHub .NET

Enables you to manage Content Security Policy (CSP) for both the front and back end, via CMS section.

Installation

dotnet add package Umbraco.Community.CSPManager

CSP Management

CSP Management section

Configuration

Configuration section

Evaluation

CSP Evaluation section

You will also need to give access via the users section to the CSP Manager section.

Nonce Tag Helper

To use CSP nonce you can make use of the Tag Helper.

First you will need to include the namespace in the ViewImports.cshtml

@addTagHelper *, Umbraco.Community.CSPManager

To use the nonce add the following to your <script> or <style> tags:

csp-manager-add-nonce="true"

When this is added it will include the nonce in the CSP header and output in the page.

If you need to access the nonce within a data attribute you can use the following:

csp-manager-add-nonce-data-attribute="true"