Skip to content
secondsky avatar

Security Headers Configuration

Configures HTTP security headers for XSS, clickjacking, and MIME sniffing defense with Express and Nginx examples.

CCM score
52 of 100
skills.sh installs
466
GitHub stars
257
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers four essential headers: HSTS, CSP, X-Frame-Options, and X-Content-Type-Options, with recommended values for each
  • Includes a Helmet-based Express setup with a custom Content Security Policy and a matching Nginx block with Referrer-Policy and Permissions-Policy
  • Provides a checklist and common mistakes, such as leaving CSP in report-only mode permanently and overly permissive policies
  • Designed for hardening web applications, passing security audits, and rolling out Content Security Policy

Install

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

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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

Details

Repository
github.com/secondsky/claude-skills
Categories
Security, Frontend & UI Code, Backend & APIs
First seen
Jun 3, 2026

Questions

What does the security-headers-configuration skill do?

The security-headers-configuration skill sets HTTP security headers to guard web applications against XSS, clickjacking and MIME sniffing attacks. It covers HSTS, Content Security Policy, X-Frame-Options, X-Content-Type-Options, Referrer-Policy and Permissions-Policy, with Express and Nginx examples.

How do I install the security-headers-configuration skill?

Run npx -y skills add secondsky/claude-skills --skill security-headers-configuration -y in your project. Once installed, security-headers-configuration lets your agent add the essential headers to your app's server or middleware.

When should I use the security-headers-configuration skill?

Use security-headers-configuration when hardening a web application, preparing for a security audit, or implementing a Content Security Policy. It walks through a checklist of headers and common mistakes such as leaving CSP in report-only mode.

Which tools or frameworks does security-headers-configuration support?

The security-headers-configuration skill shows Express with the helmet package and Nginx config, and links to Python Flask and Apache .htaccess examples in its reference file. It also points to Security Headers, Mozilla Observatory and CSP Evaluator for verifying your results.

More from secondsky/claude-skills

All 116

Similar to Security Headers Configuration

More Security