security-headers-csp

Implement HSTS, CSP, and CORS headers across web servers and frameworks.

2|1|Updated Jan 20, 2026
One-click install
npx skills add https://github.com/sraloff/gravityboots --skill security-headers-csp-sraloff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: security-headers-csp
Source: https://github.com/sraloff/gravityboots/tree/main/.agent/skills/security-headers-csp
Command: npx skills add https://github.com/sraloff/gravityboots --skill security-headers-csp-sraloff

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guides developers to securely configure HTTP headers to protect web applications against common vulnerabilities by implementing HSTS, CSP, and proper CORS policies.

Core Features & Use Cases

  • Essential Headers: HSTS, X-Content-Type-Options, and X-Frame-Options.
  • Content Security Policy: Default-src 'self', nonces/hashes for inline scripts, and reporting mechanisms.
  • CORS Best Practices: Restrict origins and avoid wildcard with credentials; suitable for API backends and SPAs.

Quick Start

Configure your web server to enable HSTS, implement a strict CSP, and restrict CORS to trusted origins.

Frequently Asked Questions about security-headers-csp

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

FAQPage Schema
How do I configure HTTP security headers like HSTS and CSP for a modern web app?

To configure HTTP security headers, you set strict policies for HSTS, Content Security Policy, and CORS. This protects web applications by enforcing secure defaults, utilizing nonces or hashes for inline scripts, and restricting cross-origin controls across server configurations and middleware stacks.

What is the best way to implement Content Security Policy with nonces in Express or FastAPI?

The best way to implement Content Security Policy with nonces in Express or FastAPI is to apply strict CSP defaults using 'self' for default-src and generate unique nonces or hashes for inline scripts. This approach supports reporting endpoints and ensures secure auditability for API backends.

How do I avoid wildcard origins with CORS credentials in API backends?

To avoid wildcard origins with CORS credentials in API backends, you must restrict cross-origin access to explicitly trusted domains. This Skill guides you in configuring strict CORS policies that prevent unauthorized requests while maintaining secure defaults for SPAs and APIs.

Can I configure HSTS and X-Frame-Options headers for Nginx or Apache?

Yes, you can configure HSTS and X-Frame-Options headers for Nginx or Apache. This Skill applies secure HTTP header implementations directly to server configurations, including Caddy, ensuring strict transport security and clickjacking protection across modern web stacks.

Does this approach support CSP reporting endpoints for Laravel and Django middleware?

Yes, this approach supports CSP reporting endpoints for Laravel and Django middleware. It implements reporting mechanisms alongside strict Content Security Policy defaults, allowing you to monitor policy violations and maintain auditability across your web application stack.

When do I need to implement strict HTTP security headers for my web application?

You need to implement strict HTTP security headers when you want to reduce exposure to common web vulnerabilities like cross-site scripting and clickjacking. This is essential for modern web apps requiring secure defaults, cross-origin controls, and auditability across server configurations and API backends.