{
    "url": "https://delaparra-services.nl/knowledge-hub/content-security-policy",
    "locale": "en",
    "title": "Content-Security-Policy: Knowledge hub | DeLaParra Services",
    "description": "CSP — controls what resources (scripts, styles, images) the browser is allowed to load. Strongest XSS defence in depth.",
    "alternates": {
        "en": "https://delaparra-services.nl/knowledge-hub/content-security-policy",
        "nl": "https://delaparra-services.nl/nl/kennisbank/content-security-policy"
    },
    "formats": {
        "csv": "https://delaparra-services.nl/knowledge-hub/content-security-policy.csv",
        "md": "https://delaparra-services.nl/knowledge-hub/content-security-policy.md",
        "json": "https://delaparra-services.nl/knowledge-hub/content-security-policy.json",
        "zip": "https://delaparra-services.nl/knowledge-hub/content-security-policy.zip",
        "pdf": "https://delaparra-services.nl/knowledge-hub/content-security-policy.pdf"
    },
    "downloads": [
        {
            "url": "https://delaparra-services.nl/knowledge-hub/content-security-policy.csv",
            "encodingFormat": "text/csv",
            "name": "content-security-policy.csv"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/content-security-policy.json",
            "encodingFormat": "application/json",
            "name": "content-security-policy.json"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/content-security-policy.md",
            "encodingFormat": "text/markdown",
            "name": "content-security-policy.md"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/content-security-policy.pdf",
            "encodingFormat": "application/pdf",
            "name": "content-security-policy.pdf"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/content-security-policy.zip",
            "encodingFormat": "application/zip",
            "name": "content-security-policy.zip"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/content-security-policy/skills.zip",
            "encodingFormat": "application/zip",
            "name": "content-security-policy-skills.zip"
        }
    ],
    "markdown": "1. [Home](<https://delaparra-services.nl/>) \n1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) \n1. [Content-Security-Policy](<https://delaparra-services.nl/knowledge-hub/content-security-policy>)\n\n  \n\nCategory: HTTP headers \n\n# Content-Security-Policy\n\n  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    \n\n## What is Content-Security-Policy?\n\n \n\nContent-Security-Policy: CSP — controls what resources (scripts, styles, images) the browser is allowed to load. Strongest XSS defence in depth. Content Security Policy, or CSP, is a response header that tells the browser which sources of scripts, styles, images and other resources a page may load. Anything not on the list is blocked.\n\n \n\nDefinition source [Coders Lingo](<https://coderslingo.com/resources/open-dataset/>), [CC BY 4.0](<https://creativecommons.org/licenses/by/4.0/>)\n\n \n\n## Frequently asked questions about Content-Security-Policy\n\n  \n\n### How is Content-Security-Policy used in practice?\n\n \n\nIt is a strong second line of defence against cross-site scripting. Even if an attacker manages to inject a ` <script> ` tag into your page, the browser refuses to run it when the policy does not allow it.\n\n    \n\n### What should you keep in mind with Content-Security-Policy?\n\n \n\nStart with a strict base, such as ` default-src 'self' `, and add only what the site needs. Inline scripts are the usual obstacle; nonces or hashes let you allow specific ones safely. Roll a new policy out with ` Content-Security-Policy-Report-Only ` first, so violations are reported without breaking the site. Third-party widgets and analytics tags are often what makes a policy grow.\n\n    \n\n### What does an example of Content-Security-Policy look like?\n\n \n\n```\nContent-Security-Policy: default-src 'self'; script-src 'self' 'nonce-abc123'\n```\n\n \n\n## At a glance\n\n   CategoryHTTP headers Explained by[Reinier de la Parra](<https://delaparra-services.nl/about>) UpdatedNovember 25, 2026\n\n \n\n## More HTTP headers terms\n\n \n\n- [Authorization](<https://delaparra-services.nl/knowledge-hub/authorization>) \n- [Cache-Control](<https://delaparra-services.nl/knowledge-hub/cache-control>) \n- [Content-Length](<https://delaparra-services.nl/knowledge-hub/content-length>) \n- [Content-Type](<https://delaparra-services.nl/knowledge-hub/content-type>) \n- [Cookie](<https://delaparra-services.nl/knowledge-hub/cookie>) \n- [ETag](<https://delaparra-services.nl/knowledge-hub/etag>)\n\n \n\n[All terms starting with C](<https://delaparra-services.nl/knowledge-hub#letter-c>)\n\n \n\n## Skills\n\n \n\n- ### HTTP headers review\n\n \n\nUse when reviewing or setting HTTP response headers for a web app or API - security headers (Content-Security-Policy, Strict-Transport-Security, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy), CORS headers, caching headers (Cache-Control, ETag, Last-Modified, Vary) and cookies (Set-Cookie flags). Also use when a security scan reports missing headers.\n\n [View skill](<https://delaparra-services.nl/skills/http-headers-review>) [Download zip](<https://delaparra-services.nl/skills/http-headers-review/download>) \n- ### Laravel OWASP Security\n\n \n\nOWASP Top 10 security audit and secure coding guidelines for Laravel + React/Inertia.js applications. Use when auditing for vulnerabilities (\"run OWASP audit\", \"security review\", \"check my app security\") or writing secure Laravel code involving auth, payments, file uploads, or API design. Triggers on security-related tasks, payment handling, authentication, or any request to audit a Laravel codeba\n\n [View skill](<https://delaparra-services.nl/skills/laravel-owasp-security>) [Download zip](<https://delaparra-services.nl/skills/laravel-owasp-security/download>) \n- ### SAST Configuration\n\n \n\nConfigure Static Application Security Testing (SAST) tools for automated vulnerability detection in application code. Use when setting up security scanning, implementing DevSecOps practices, or automating code vulnerability detection.\n\n [View skill](<https://delaparra-services.nl/skills/sast-configuration>) [Download zip](<https://delaparra-services.nl/skills/sast-configuration/download>)\n\n [Download all skills (zip)](<https://delaparra-services.nl/knowledge-hub/content-security-policy/skills.zip>)\n\n \n\n## Manuals\n\n \n\n- [HTTP headers: security, caching and CORS](<https://delaparra-services.nl/manuals/http-headers-beveiliging-caching-en-cors>)\n\n \n\n## Related services\n\n \n\n- [AI code review](<https://delaparra-services.nl/services#service-05>)\n\nWhen you push your new change, I will review your code, help your agent avoid the same mistake again, and get your app ready for deployment. \n- [Web design and development](<https://delaparra-services.nl/services#service-01>)\n\nAfter our first meeting, we'll develop a custom solution for a fast, scalable application.\n\n \n\n## Need any help?\n\n \n\nStuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.\n\n  [Get in touch](<https://delaparra-services.nl/availability>)\n\n[HTML version](https://delaparra-services.nl/knowledge-hub/content-security-policy)\n",
    "structured_data": {
        "@context": "https://schema.org",
        "@graph": [
            {
                "@type": "Organization",
                "@id": "https://delaparra-services.nl/#practice",
                "logo": "https://delaparra-services.nl/logo.png",
                "name": "DeLaParra Services",
                "legalName": "DeLaParra Services",
                "url": "https://delaparra-services.nl/",
                "description": "Bespoke software, web applications and mobile apps, developed in Laravel by a single developer in Groningen. Fixed price agreed in advance, full source code provided upon delivery.",
                "email": "info@delaparra-services.nl",
                "address": {
                    "@type": "PostalAddress",
                    "addressLocality": "Groningen",
                    "addressRegion": "Groningen",
                    "addressCountry": "NL"
                },
                "areaServed": "Groningen, the Netherlands",
                "knowsLanguage": [
                    "en",
                    "nl"
                ],
                "knowsAbout": [
                    "Web design and development",
                    "App development",
                    "Custom software and web applications",
                    "OpenSpec",
                    "AI code review",
                    "Your own coding agent"
                ],
                "founder": {
                    "@id": "https://delaparra-services.nl/#person"
                }
            },
            {
                "@type": "FAQPage",
                "@id": "https://delaparra-services.nl/knowledge-hub/content-security-policy#webpage",
                "url": "https://delaparra-services.nl/knowledge-hub/content-security-policy",
                "name": "Content-Security-Policy: Knowledge hub | DeLaParra Services",
                "description": "CSP — controls what resources (scripts, styles, images) the browser is allowed to load. Strongest XSS defence in depth.",
                "isPartOf": {
                    "@id": "https://delaparra-services.nl/#website"
                },
                "about": {
                    "@type": "DefinedTerm",
                    "@id": "https://delaparra-services.nl/knowledge-hub/content-security-policy#term",
                    "name": "Content-Security-Policy",
                    "description": "CSP — controls what resources (scripts, styles, images) the browser is allowed to load. Strongest XSS defence in depth.",
                    "termCode": "content-security-policy",
                    "url": "https://delaparra-services.nl/knowledge-hub/content-security-policy",
                    "inLanguage": "en",
                    "keywords": "HTTP headers",
                    "dateModified": "2026-11-25T17:46:25+00:00",
                    "inDefinedTermSet": {
                        "@id": "https://delaparra-services.nl/knowledge-hub#terms"
                    },
                    "isPartOf": {
                        "@id": "https://delaparra-services.nl/knowledge-hub#dataset"
                    },
                    "subjectOf": [
                        {
                            "@id": "https://delaparra-services.nl/knowledge-hub/content-security-policy#webpage"
                        },
                        {
                            "@id": "https://delaparra-services.nl/knowledge-hub/content-security-policy#dataset"
                        }
                    ]
                },
                "inLanguage": "en",
                "breadcrumb": {
                    "@id": "https://delaparra-services.nl/knowledge-hub/content-security-policy#breadcrumb"
                },
                "mainEntity": [
                    {
                        "@type": "Question",
                        "name": "What is Content-Security-Policy?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "CSP — controls what resources (scripts, styles, images) the browser is allowed to load. Strongest XSS defence in depth. Content Security Policy, or CSP, is a response header that tells the browser which sources of scripts, styles, images and other resources a page may load. Anything not on the list is blocked."
                        }
                    },
                    {
                        "@type": "Question",
                        "name": "How is Content-Security-Policy used in practice?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "It is a strong second line of defence against cross-site scripting. Even if an attacker manages to inject a <script> tag into your page, the browser refuses to run it when the policy does not allow it."
                        }
                    },
                    {
                        "@type": "Question",
                        "name": "What should you keep in mind with Content-Security-Policy?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "Start with a strict base, such as default-src 'self', and add only what the site needs. Inline scripts are the usual obstacle; nonces or hashes let you allow specific ones safely. Roll a new policy out with Content-Security-Policy-Report-Only first, so violations are reported without breaking the site. Third-party widgets and analytics tags are often what makes a policy grow."
                        }
                    },
                    {
                        "@type": "Question",
                        "name": "What does an example of Content-Security-Policy look like?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "Content-Security-Policy: default-src 'self'; script-src 'self' 'nonce-abc123'"
                        }
                    }
                ],
                "author": {
                    "@id": "https://delaparra-services.nl/#person"
                },
                "mentions": [
                    {
                        "@id": "https://delaparra-services.nl/skills/http-headers-review#skill"
                    },
                    {
                        "@id": "https://delaparra-services.nl/skills/laravel-owasp-security#skill"
                    },
                    {
                        "@id": "https://delaparra-services.nl/skills/sast-configuration#skill"
                    },
                    {
                        "@id": "https://delaparra-services.nl/manuals/http-headers-beveiliging-caching-en-cors#article"
                    }
                ]
            },
            {
                "@type": "BreadcrumbList",
                "@id": "https://delaparra-services.nl/knowledge-hub/content-security-policy#breadcrumb",
                "itemListElement": [
                    {
                        "@type": "ListItem",
                        "position": 1,
                        "name": "Home",
                        "item": "https://delaparra-services.nl/"
                    },
                    {
                        "@type": "ListItem",
                        "position": 2,
                        "name": "Knowledge hub",
                        "item": "https://delaparra-services.nl/knowledge-hub"
                    },
                    {
                        "@type": "ListItem",
                        "position": 3,
                        "name": "Content-Security-Policy"
                    }
                ]
            },
            {
                "@type": "Person",
                "@id": "https://delaparra-services.nl/#person",
                "name": "Reinier de la Parra",
                "url": "https://delaparra-services.nl/about"
            },
            {
                "@type": "Dataset",
                "@id": "https://delaparra-services.nl/knowledge-hub/content-security-policy#dataset",
                "name": "Content-Security-Policy",
                "description": "CSP — controls what resources (scripts, styles, images) the browser is allowed to load. Strongest XSS defence in depth.",
                "url": "https://delaparra-services.nl/knowledge-hub/content-security-policy",
                "identifier": "https://delaparra-services.nl/knowledge-hub/content-security-policy#dataset",
                "about": {
                    "@id": "https://delaparra-services.nl/knowledge-hub/content-security-policy#term"
                },
                "creator": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "publisher": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "license": "https://creativecommons.org/licenses/by/4.0/",
                "creditText": "Coders Lingo (https://coderslingo.com/resources/open-dataset/), CC BY 4.0",
                "isAccessibleForFree": true,
                "inLanguage": "en",
                "keywords": "HTTP headers",
                "version": "2026-11-25",
                "dateModified": "2026-11-25T17:46:25+00:00",
                "isPartOf": {
                    "@type": "Dataset",
                    "@id": "https://delaparra-services.nl/knowledge-hub#dataset",
                    "name": "IT terms from A to Z",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "includedInDataCatalog": {
                    "@type": "DataCatalog",
                    "@id": "https://delaparra-services.nl/knowledge-hub#catalog",
                    "name": "Knowledge hub data catalog",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "distribution": [
                    {
                        "@type": "DataDownload",
                        "name": "content-security-policy.csv",
                        "encodingFormat": "text/csv",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/content-security-policy.csv",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:25+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "content-security-policy.json",
                        "encodingFormat": "application/json",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/content-security-policy.json",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:25+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "content-security-policy.md",
                        "encodingFormat": "text/markdown",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/content-security-policy.md",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:25+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "content-security-policy.pdf",
                        "encodingFormat": "application/pdf",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/content-security-policy.pdf",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:25+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "content-security-policy.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/content-security-policy.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:25+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "content-security-policy-skills.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/content-security-policy/skills.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:25+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    }
                ]
            }
        ]
    }
}