mcpField
S
security-headers-configuration

security-headers-configuration

github.com/aj-geddesSecurity373516 installsUpdated 34w ago
Repository

About security-headers-configuration

A security configuration skill for web developers implementing HTTP security headers. It includes guidance for several server environments and header testing.

Key features

  1. 01Configure HTTP security headers
  2. 02Cover CSP, HSTS, and related protections
  3. 03Guides for Node.js, Nginx, Flask, and Apache
  4. 04Includes security header testing guidance

Use cases

  1. 01Deploy a new web application
  2. 02Address security audit findings
  3. 03Harden a static site or API
  4. 04Test security headers regularly

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill security-headers-configuration

After installing, type/security-headers-configurationin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
apache-htaccess-configuration.md
nginx-security-headers-configuration.md
nodejsexpress-security-headers.md
python-flask-security-headers.md
security-headers-testing-script.md
scripts/
security-checklist.sh

Details

From the project README

Security Headers Configuration

Table of Contents

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:

// 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:

GuideContents
Node.js/Express Security HeadersNode.js/Express Security Headers
Nginx Security Headers ConfigurationNginx Security Headers Configuration
Python Flask Security HeadersPython Flask Security Headers
Apache .htaccess ConfigurationApache .htaccess Configuration
Security Headers Testing ScriptSecurity 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

Comments

Markdown supported