configure-security-headers-csp

Configure HTTP security headers and strict nonce-based Content-Security-Policy directives.

9|3|Updated Jun 13, 2026
One-click install
npx skills add https://github.com/Sir-chawakorn/sanook-cli --skill configure-security-headers-csp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: configure-security-headers-csp
Source: https://github.com/Sir-chawakorn/sanook-cli/tree/main/skills/configure-security-headers-csp
Command: npx skills add https://github.com/Sir-chawakorn/sanook-cli --skill configure-security-headers-csp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the complexity of implementing robust defense-in-depth security headers, preventing common vulnerabilities like XSS, clickjacking, and credentialed CORS leaks that arise from misconfigured HTTP responses.

Core Features & Use Cases

  • Strict CSP Implementation: Configures nonce-based or hash-based Content-Security-Policy with strict-dynamic to eliminate inline-script XSS sinks.
  • Header Hardening: Automates the setup of HSTS, X-Content-Type-Options, Referrer-Policy, and Permissions-Policy to lock down browser behavior.
  • Use Case: Use this when your application needs to move from a permissive or broken CSP to a strict, production-ready policy that prevents unauthorized script execution and protects session cookies.

Quick Start

Use the configure-security-headers-csp skill to generate a strict nonce-based CSP and harden the security headers for my web application.

Frequently Asked Questions about configure-security-headers-csp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure strict Content-Security-Policy headers to prevent XSS?

Configure strict Content-Security-Policy headers by implementing nonce-based or hash-based script execution with strict-dynamic directives. This approach eliminates inline-script XSS sinks and prevents unauthorized script execution in web applications.

How do I migrate from a permissive CSP to a production-ready policy?

Migrate to a production-ready CSP by replacing permissive rules with strict, nonce-based Content-Security-Policy directives. This enforces defense-in-depth policy enforcement and secures session cookies against unauthorized script execution.

What HTTP security headers are needed for web application hardening?

Web application hardening requires HSTS, X-Content-Type-Options, Referrer-Policy, and Permissions-Policy HTTP headers. Configuring these security headers locks down browser behavior and mitigates vulnerabilities like clickjacking and credentialed CORS leaks.

Can I use origin-validated CORS policies with strict-dynamic CSP?

Yes, origin-validated CORS policies work alongside strict-dynamic CSP directives. Combining precise origin validation with nonce-based script execution provides defense-in-depth enforcement against credentialed CORS leaks and unauthorized cross-origin access.

Why does my Content-Security-Policy block inline scripts after migration?

Content-Security-Policy blocks inline scripts during migration when strict directives lack valid nonces or hashes. Implement nonce-based script execution with strict-dynamic to authorize trusted scripts while maintaining a strict, production-ready policy.

What is the best way to set up HSTS and Permissions-Policy for defense-in-depth?

Set up HSTS and Permissions-Policy for defense-in-depth by automating HTTP response header configuration. Applying strict header values locks down browser behavior, enforces HTTPS, and restricts powerful APIs like camera and geolocation.