security-headers-configuration · aj-geddes — Claude Code skill: setup
Configures HTTP security headers like CSP, HSTS, and X-Frame-Options for web apps. Hardens servers and APIs against XSS, clickjacking, and MIME sniffing.
npx skills add aj-geddes/useful-ai-prompts --skill security-headers-configuration -a claude-codeWhat security-headers-configuration does
This skill adds verified HTTP security header configurations directly into your workflow. It includes setup guides for Node.js Express using helmet, Nginx, Python Flask, and Apache .htaccess, alongside a standalone script to test active response headers.
The configurations protect servers and web applications from browser-based attack vectors. For production environments, the guide requires removing 'unsafe-inline' from Content Security Policy directives and enabling HSTS with preload. Whitelist all external CDNs and analytics domains early, or strict CSP directives will immediately break frontend assets.
What it helps with
- protect web applications from XSS and clickjacking
- configure strict Content Security Policy directives
- add security headers to Nginx, Apache, or Express
- verify and test HTTP response headers on running servers
Example prompts for the agent
- Configure security headers for Express using helmet
- Generate an Nginx configuration with strict CSP and HSTS
- Run the testing script to check my server security headers
How to install security-headers-configuration
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill security-headers-configuration -a claude-code2Manually: put the files in place
~/.claude/skills/security-headers-configuration/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/security-headers-configuration/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill security-headers-configuration -a codex2Manually: put the files in place
.agents/skills/security-headers-configuration/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill security-headers-configuration -a cursor2Manually: put the files in place
.cursor/skills/security-headers-configuration/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install aj-geddes/useful-ai-prompts security-headers-configuration2Manually: put the files in place
.github/skills/security-headers-configuration/SKILL.md1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill security-headers-configuration -a gemini-cli2Platform CLI
gemini skills install https://github.com/aj-geddes/useful-ai-prompts --path skills/security-headers-configurationManually: put the files in place
.devin/skills/security-headers-configuration/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill security-headers-configuration -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about security-headers-configuration
How do I install security-headers-configuration in Claude Code?
Run npx skills add aj-geddes/useful-ai-prompts --skill security-headers-configuration -a claude-code. The skill file installs to ~/.claude/skills/security-headers-configuration/SKILL.md.
Which web servers and frameworks are covered?
The skill provides implementation files for Node.js Express, Python Flask, Nginx, and Apache .htaccess setups.
What is required before deploying CSP rules to production?
Remove 'unsafe-inline' rules from scriptSrc and explicitly whitelist external API and CDN domains used by your app.
Source text
SKILL.md · MIT
---
name: security-headers-configuration
description: >
Configure HTTP security headers including CSP, HSTS, X-Frame-Options, and XSS
protection. Use when hardening web applications against common attacks.
---
# Security Headers Configuration
## Table of Contents
- [Overview](#overview)
- [When to Use](#when-to-use)
- [Quick Start](#quick-start)
- [Reference Guides](#reference-guides)
- [Best Practices](#best-practices)
## Overview
Implement comprehensive HTTP security headers to protect web applications from XSS, clickjacking, MIME sniffing, and other browser-based attacks.
## When to Use
- New web application deployment
- Security audit remediation
- Compliance requirements
- Browser security hardening
- API security
- Static site protection
## Quick Start
Minimal working example:
```javascript
// security-headers.js
const helmet = require("helmet");
function configureSecurityHeaders(app) {
// Comprehensive Helmet configuration
app.use(
helmet({
// Content Security Policy
contentSecurityPolicy: {
directives: {
defaultSrc: ["'self'"],
scriptSrc: [
"'self'",
"'unsafe-inline'", // Remove in production
"https://cdn.example.com",
"https://www.google-analytics.com",
],
styleSrc: [
"'self'",
"'unsafe-inline'",
"https://fonts.googleapis.com",
],
fontSrc: ["'self'", "https://fonts.gstatic.com"],
imgSrc: ["'self'", "data:", "https:", "blob:"],
connectSrc: ["'self'", "https://api.example.com"],
// ... (see reference guides for full implementation)
```
## Reference Guides
Detailed implementations in the `references/` directory:
| Guide | Contents |
|---|---|
| [Node.js/Express Security Headers](references/nodejsexpress-security-headers.md) | Node.js/Express Security Headers |
| [Nginx Security Headers Configuration](references/nginx-security-headers-configuration.md) | Nginx Security Headers Configuration |
| [Python Flask Security Headers](references/python-flask-security-headers.md) | Python Flask Security Headers |
| [Apache .htaccess Configuration](references/apache-htaccess-configuration.md) | Apache .htaccess Configuration |
| [Security Headers Testing Script](references/security-headers-testing-script.md) | Security Headers Testing Script |
## Best Practices
### ✅ DO
- Use HTTPS everywhere
- Implement strict CSP
- Enable HSTS with preload
- Block framing with X-Frame-Options
- Prevent MIME sniffing
- Report CSP violations
- Test headers regularly
- Use security scanners
### ❌ DON'T
- Allow unsafe-inline in CSP
- Skip HSTS on subdomains
- Ignore CSP violations
- Use overly permissive policies
- Forget to test changes
© aj-geddes · MIT · aj-geddes/useful-ai-prompts
Similar skills
All skills for Security →security-headers-configuration by other authors comes first.