cloudflare / cloudflare-docs

Cloudflare’s documentation
https://developers.cloudflare.com
Creative Commons Attribution 4.0 International
3.12k stars 4.91k forks source link

Content-Security-Policy for Cloudflare Turnstile #6069

Closed Haocen closed 2 years ago

Haocen commented 2 years ago

Which Cloudflare product(s) does this pertain to?

Bots

Subject Matter

Need CSP configuration manual for Cloudflare Turnstile

Content Location

https://github.com/cloudflare/cloudflare-docs/blob/production/content/turnstile/get-started/client-side-rendering.md

Additional information

Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate certain types of attacks, including Cross-Site Scripting (XSS) and data injection attacks.

As of now I noticed Turnstile will load a script from challenges.cloudflare.com and embed an iframe pointing to the same domain, I wonder what other CSP rules I need to touch to ensure Turnstile operate properly.

punkeel commented 2 years ago

Hi @Haocen, thanks for the report! The recommended CSP is documented in the FAQ. Let us know if that answers your needs