Content Security Policy
Last updated
Was this helpful?
Last updated
Was this helpful?
Content Security Policy () is an added layer of security that helps to detect and mitigate certain types of attacks, including Cross-Site Scripting () and data injection attacks. (Source: )
If you are using source allowlisting, use the following for Content Security Policy:
And, if you need to inject the script separately instead of including it in one of your scripts, you'll need to use nonce
. (i.e. script-src 'nonce-rAnd0m'
and <script nonce="rAnd0m">
...)
If you cannot use the nonce
method, you can only use the hash
method.
1. Go to Dashboard, click the top right corner and click Install, then copy the installation script.
2. Paste into the place where you want to put the script. Then copy exactly what is between <script>
and </script>
, and put it into to generate the hash.
3. Add the generated hash
to script-src
.
Also checkout how to .