--- title: "Content security policy" slug: "content-security-policy-1" description: "Enhance your Knowledge Base security with Content Security Policy (CSP) in Document360, protecting against XSS and data injection attacks." updated: 2026-06-28T10:08:09Z published: 2026-06-28T10:08:09Z canonical: "docs.document360.com/content-security-policy-1" stale: true --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.document360.com/llms.txt > Use this file to discover all available pages before exploring further. # Content security policy **Content Security Policy (CSP)** is a browser-enforced security mechanism that controls which external resources — scripts, styles, images, fonts, and frames — are allowed to load on your **Knowledge base site**. When enabled in Document360, a CSP directive is embedded in your site's page source, restricting resource loading to only the domains you explicitly configure. This protects your Knowledge Base from common web vulnerabilities such as Cross-Site Scripting (XSS), clickjacking, and data injection attacks. --- ## When to use Content Security Policy Enable CSP when any of the following apply to your Knowledge Base: - Your site embeds third-party content such as videos, chat widgets, or analytics tools. - Your articles or theme include custom HTML sections with inline scripts. --- ## How CSP works in Document360 Document360 implements CSP via a `<meta http-equiv="Content-Security-Policy">` tag embedded in your site's page source, rather than via an HTTP response header. This means: - All CSP rules are applied at the page level through the meta tag. - If you inspect the HTTP response header, CSP will appear absent — this is expected behavior. - To confirm CSP is active, right-click your Knowledge Base site, select **View page source**, and search for `Content-Security-Policy`. NOTE HTTP response headers require server-side configuration. Document360 uses a meta element so you can configure CSP entirely from the Settings UI without any infrastructure changes. The security protection is equivalent for the vast majority of directives, with the exception of `frame-ancestors`, which is only supported via HTTP headers in some browsers. Document360 handles this automatically. --- ## Before you begin Only **project owners**, **admins**, or users with access to **Security** settings can configure Content Security Policy. --- ## How to enable Content Security Policy 1. Navigate to **Settings** () > ****Knowledge base site**** > ****Security****. 2. Toggle on **Enable content security policy**. 3. Configure the required directive groups: - **Code policy** - **Resource control** - **Embedding & Security** - **Reporting** 4. Click **Save**. ![Settings page for configuring Content Security Policy in a Document360 Knowledge Base.](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/content%20security%20policy.png) NOTE When CSP is enabled, ensure that the nonce attribute placeholder is added to all custom HTML script sections. Example: ``` ``` The `{{Document360-Nonce}}` placeholder is replaced at render time with a unique per-request value that matches the nonce listed in the CSP. This allows the trusted inline script to run without needing to weaken your policy with `'unsafe-inline'`. **Compliance and security-hardened environments** Teams operating under frameworks such as SOC 2, ISO 27001, or HIPAA often require a documented resource-loading policy. CSP provides a machine-enforced version of that policy. The Reporting directives additionally give you an audit trail of any attempted policy violations. --- ## FAQ **Why does my CSP validation tool say CSP is missing from the response header?** Document360 implements CSP via a meta element in the page source, not via an HTTP response header. Tools that only check response headers will therefore report CSP as missing. To confirm CSP is enabled, right-click your Knowledge Base site, select **View page source**, and search for "Content-Security-Policy". If the term appears, CSP is active. **Can I allow specific domains to embed my Knowledge Base?** Yes. Use the **Frame ancestors** directive under the Embedding & Security group to specify which external domains are permitted to embed your Knowledge Base pages in their own frames. **What happens if I disable CSP after previously configuring it?** Disabling the **Content security policy** toggle removes CSP enforcement from your Knowledge Base site. However, your saved directive configurations are retained and will be reapplied if you re-enable CSP. No configuration data is lost when toggling the feature off.