secondsky avatar

Security Headers Configuration

This is your checklist for implementing HTTP security headers across Express, Nginx, Flask, and Apache. It covers the essentials like HSTS, CSP, X-Frame-Options, and X-Content-Type-Options with ready-to-use configurations. The Express section uses Helmet with customizable CSP directives, and the Nginx config includes all the modern headers you need. What I like is the included verification tools and the common mistakes section, because CSP is notorious for breaking things when you deploy without testing. Use this when you're hardening a web app for production, passing a security audit, or just trying to get an A rating on securityheaders.com.

skills.sh installs
454
GitHub stars
248
last updated
Aug 21, 2026

Install

$ npx -y skills add secondsky/claude-skills --skill security-headers-configuration --agent claude-code

Installs into .claude/skills of the current project.

Files

Security Headers Configuration

Implement HTTP security headers to defend against common browser-based attacks.

Essential Headers

HeaderPurposeValue
HSTSForce HTTPSmax-age=31536000; includeSubDomains
CSPRestrict resourcesdefault-src 'self'
X-Frame-OptionsPrevent clickjackingDENY
X-Content-Type-OptionsPrevent MIME sniffingnosniff

Express Implementation

const helmet = require('helmet');

app.use(helmet());

// Custom CSP
app.use(helmet.contentSecurityPolicy({
  directives: {
    defaultSrc: ["'self'"],
    scriptSrc: ["'self'", "'unsafe-inline'"],
    styleSrc: ["'self'", "'unsafe-inline'"],
    imgSrc: ["'self'", "data:", "https:"],
    connectSrc: ["'self'", "https://api.example.com"],
    fontSrc: ["'self'", "https://fonts.gstatic.com"],
    frameAncestors: ["'none'"]
  }
}));

Nginx Configuration

Sponsors

Details

Repository
github.com/secondsky/claude-skills
Category
Security
First seen
Jun 3, 2026

More from secondsky/claude-skills

All 146

Recommended

More Security
1hieutrtr avatarcode-review-securityhieutrtr/ai1-skillsSecurity-focused code review checklist and automated scanning patterns. Use when reviewing pull requests for security issues, auditing authentication/authorizat440skills.sh installs
2secondsky avataroauth-implementationsecondsky/claude-skillsOAuth 2.0 and OpenID Connect authentication with secure flows. Use for third-party integrations, SSO systems, token-based API access, or encountering authorizat422skills.sh installs
3mastepanoski avatarowasp-llm-top10mastepanoski/claude-skillsSecurity audit for LLM and GenAI applications using OWASP Top 10 for LLM Apps 2025. Assess prompt injection, data leakage, supply chain, and 7 more critical vul409skills.sh installs
4davila7 avatarvulnerability-scannerdavila7/claude-code-templatesAdvanced vulnerability analysis principles. OWASP 2025, Supply Chain Security, attack surface mapping, risk prioritization.394skills.sh installs
5secondsky avatarcloudflare-workers-securitysecondsky/claude-skillsCloudflare Workers security with authentication, CORS, rate limiting, input validation. Use for securing APIs, JWT/API keys, or encountering auth failures, CORS369skills.sh installs
6patricio0312rev avatarauth-security-reviewerpatricio0312rev/skillsReviews authentication and authorization implementation for session management, CSRF, cookie security, and auth flow vulnerabilities with findings, severity ass352skills.sh installs