security-headers-configuration · aj-geddes — скилл для Claude Code
Настраивает HTTP-заголовки безопасности вроде CSP, HSTS и X-Frame-Options для веб-приложений. Защищает сервис от XSS, кликджекинга и MIME-сниффинга.
npx skills add aj-geddes/useful-ai-prompts --skill security-headers-configuration -a claude-codeЧто делает security-headers-configuration
Скилл добавляет в проект конфигурации защитных HTTP-заголовков под разные стеки. Внутри лежат руководства и примеры кода для Node.js с фреймворком Express (на базе helmet), Nginx, Python Flask и конфигурационных файлов Apache .htaccess. Для валидации настроек предусмотрен отдельный тестовый скрипт.
Шаблоны закрывают типичные уязвимости браузерного уровня: запрещают встраивание во фреймы, форсируют HTTPS и блокируют исполнение постороннего кода. В продакшене инструкция требует избавляться от 'unsafe-inline' в директивах CSP и включать HSTS с предзагрузкой. Если не прописать сторонние домены CDN и аналитики заранее, строгая политика CSP заблокирует загрузку внешних ресурсов.
Какие задачи решает
- защитить веб-сервис от атак XSS и кликджекинга
- настроить строгие директивы CSP и заголовок HSTS
- добавить защитные заголовки в Nginx, Apache или Express
- протестировать отправку HTTP-заголовков в рабочем окружении
Примеры запросов агенту
- Настрой безопасные HTTP-заголовки для Express через helmet
- Сделай конфиг Nginx со строгой Content Security Policy и HSTS
- Проверь скриптом текущие заголовки безопасности веб-сервера
Как установить security-headers-configuration
1Через Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill security-headers-configuration -a claude-code2Вручную: положить файлы
~/.claude/skills/security-headers-configuration/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/security-headers-configuration/
1Через Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill security-headers-configuration -a codex2Вручную: положить файлы
.agents/skills/security-headers-configuration/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill security-headers-configuration -a cursor2Вручную: положить файлы
.cursor/skills/security-headers-configuration/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install aj-geddes/useful-ai-prompts security-headers-configuration2Вручную: положить файлы
.github/skills/security-headers-configuration/SKILL.md1Через Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill security-headers-configuration -a gemini-cli2Командой платформы
gemini skills install https://github.com/aj-geddes/useful-ai-prompts --path skills/security-headers-configurationВручную: положить файлы
.devin/skills/security-headers-configuration/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill security-headers-configuration -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о security-headers-configuration
Как установить security-headers-configuration в Claude Code?
Выполните команду npx skills add aj-geddes/useful-ai-prompts --skill security-headers-configuration -a claude-code. Конфигурация сохранится по пути ~/.claude/skills/security-headers-configuration/SKILL.md.
Для каких веб-серверов и фреймворков есть примеры?
Скилл содержит инструкции для Node.js с Express, Python Flask, веб-сервера Nginx и файлов .htaccess для Apache.
Что нужно учесть перед включением CSP в продакшене?
Перед релизом необходимо убрать флаг 'unsafe-inline' из директивы scriptSrc и явно указать все доверенные адреса внешних API и шрифтов.
Исходный текст
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
Похожие скиллы
Все скиллы по теме «Безопасность» →Сначала — security-headers-configuration от других авторов.