Security Headers Configuration
Skill files7 files

references/

scripts/

SKILL.md96 lines
1
---
2
name: security-headers-configuration
3
description: >
4
Configure HTTP security headers including CSP, HSTS, X-Frame-Options, and XSS
5
protection. Use when hardening web applications against common attacks.
6
---
7
8
# Security Headers Configuration
9
10
## Table of Contents
11
12
- [Overview](#overview)
13
- [When to Use](#when-to-use)
14
- [Quick Start](#quick-start)
15
- [Reference Guides](#reference-guides)
16
- [Best Practices](#best-practices)
17
18
## Overview
19
20
Implement comprehensive HTTP security headers to protect web applications from XSS, clickjacking, MIME sniffing, and other browser-based attacks.
21
22
## When to Use
23
24
- New web application deployment
25
- Security audit remediation
26
- Compliance requirements
27
- Browser security hardening
28
- API security
29
- Static site protection
30
31
## Quick Start
32
33
Minimal working example:
34
35
```javascript
36
// security-headers.js
37
const helmet = require("helmet");
38
39
function configureSecurityHeaders(app) {
40
// Comprehensive Helmet configuration
41
app.use(
42
helmet({
43
// Content Security Policy
44
contentSecurityPolicy: {
45
directives: {
46
defaultSrc: ["'self'"],
47
scriptSrc: [
48
"'self'",
49
"'unsafe-inline'", // Remove in production
50
"https://cdn.example.com",
51
"https://www.google-analytics.com",
52
],
53
styleSrc: [
54
"'self'",
55
"'unsafe-inline'",
56
"https://fonts.googleapis.com",
57
],
58
fontSrc: ["'self'", "https://fonts.gstatic.com"],
59
imgSrc: ["'self'", "data:", "https:", "blob:"],
60
connectSrc: ["'self'", "https://api.example.com"],
61
// ... (see reference guides for full implementation)
62
```
63
64
## Reference Guides
65
66
Detailed implementations in the `references/` directory:
67
68
| Guide | Contents |
69
|---|---|
70
| [Node.js/Express Security Headers](references/nodejsexpress-security-headers.md) | Node.js/Express Security Headers |
71
| [Nginx Security Headers Configuration](references/nginx-security-headers-configuration.md) | Nginx Security Headers Configuration |
72
| [Python Flask Security Headers](references/python-flask-security-headers.md) | Python Flask Security Headers |
73
| [Apache .htaccess Configuration](references/apache-htaccess-configuration.md) | Apache .htaccess Configuration |
74
| [Security Headers Testing Script](references/security-headers-testing-script.md) | Security Headers Testing Script |
75
76
## Best Practices
77
78
### ✅ DO
79
80
- Use HTTPS everywhere
81
- Implement strict CSP
82
- Enable HSTS with preload
83
- Block framing with X-Frame-Options
84
- Prevent MIME sniffing
85
- Report CSP violations
86
- Test headers regularly
87
- Use security scanners
88
89
### ❌ DON'T
90
91
- Allow unsafe-inline in CSP
92
- Skip HSTS on subdomains
93
- Ignore CSP violations
94
- Use overly permissive policies
95
- Forget to test changes
96

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 11,672 prompts

More by @OpenSourceBuffGuy

See all
AAA Game Loading Screen Portrait prompt image

AAA Game Loading Screen Portrait

Makes a fake AAA game loading screen with the uploaded person as the protagonist, a character profile panel, a title and a loading bar, in cinematic photoreal style.

image-prompt, reference-image, face-reference, gpt-image, photorealistic, cinematic, video-games, unreal-engine, portrait, character-design, ui-mockup, text-rendering, widescreen, golden-hour, neon, rain, cityscape, forest, dramatic-lighting, bokeh, concept-art, fashion, avatar, for-gamers, long-form

Smart Debug prompt image

Smart Debug

Turns an error message or stack trace into ranked root-cause hypotheses, gathers observability data, and produces a verified fix with monitoring steps.

slash-command, debugging, root-cause-analysis, troubleshooting, observability, log-analysis, incident-response, tool-use, orchestrator, for-developers, structured-output, step-by-step-guide, plan-then-execute, confidence-scoring, best-practices, advanced, long-form, devops, code, report

Oxblood Halftone Manifesto prompt image

Oxblood Halftone Manifesto

Defines a JSON style for oxblood and gray-white manifesto posters with coarse halftone photography, ultra-tall narrow type and worn paper folds.

image-prompt, json-prompt, template, placeholders, editorial, poster, printmaking, limited-palette, film-grain, flowers, typography, text-rendering, multi-panel, structured-output, style-reference, for-designers, for-artists, long-form, vertical-format, widescreen, advanced

Reviews

Loading reviews…

Discussion

Loading comments…