Security baseline

Establish a security baseline for a website or web app.

Security baseline — Creative Direction skill highlight diagram. Navy header card reads 'Impactful Creative Direction' with the subtitle… (from the rampstackco/claude-skills README)

From the rampstackco/claude-skills README — shows the whole collection, not only this skill. · view on GitHub

How to use it

Claude Code
  1. Run the line below. It pulls the whole folder into ~/.claude/skills/security-baseline, including the files SKILL.md points to.
  2. Describe your job in plain words. Claude Code follows the skill from there.
Claude Code — installs the whole folder, not just SKILL.md
npx degit rampstackco/claude-skills/skills/security-baseline#main ~/.claude/skills/security-baseline

For one project only, change the path to .claude/skills/security-baseline. This skill also uses security.txt — copying SKILL.md alone won't be enough. See the folder on GitHub.

Claude (web or desktop app)
  1. On this page open ⋯ → Download .md.
  2. Save it as SKILL.md in a folder, zip the folder, then Customize → Skills → + → Create skill → Upload a skill.
  3. Pick the file and Save. Claude shows the name and description and runs a security scan.
  4. Check the skill is switched on.
  5. Start a new chat and describe your job in plain words. The AI follows the skill from there.
ChatGPT or another app
  1. ChatGPT: make a Project and paste it into Instructions.
  2. Neither? Paste it at the top of a new chat — it works for that chat.
Not working?
  • Check which app you pasted it into — the steps above name the right one.
  • Some skills need the paid tier of Claude or ChatGPT.
Step-by-step guide with screenshots · Ask in the forum

Paste into Claude, ChatGPT or Cursor.

Source of Security baseline

Show the full text303 lines
namedescriptioncategorycatalog_summarydisplay_order
security-baselineEstablish a security baseline for a website or web app. Use this skill when configuring HTTPS and TLS, setting security headers, planning secrets management, evaluating CSP policies, doing a basic security audit, or hardening a site before launch. Triggers on security headers, HTTPS, TLS, CSP, content security policy, HSTS, secrets management, vulnerability scan, security audit, harden, OWASP, security baseline. Also triggers when a security review is required for compliance or before going live.operationsHTTPS, security headers, CSP, secrets management, vulnerability scans7

Security Baseline

Establish the security floor for any production website or web app. Stack-agnostic. Covers the things that should be in place before public launch and verified periodically after.


When to use

  • Pre-launch security review
  • Setting up a new site or environment
  • Periodic security audit (quarterly recommended)
  • Onboarding a new vendor or third-party integration
  • Responding to a security finding or report
  • Hardening after an incident

When NOT to use

  • Active incident response (use incident-response)
  • Code-level security review (use code-review-web)
  • Email-specific authentication (SPF/DKIM/DMARC) (use email-deliverability)
  • DNS-level security (CAA, DNSSEC) (use domain-strategy)
  • Performance-related security (DDoS protection sizing) (use performance-optimization)

Required inputs

  • The site or app in scope (URLs, environments)
  • The hosting platform and CDN
  • Authentication method (if any)
  • Third-party scripts and integrations
  • Compliance context (PCI, SOC2, GDPR, etc., if applicable)
  • Existing security tooling

The framework: 6 layers

Security is layered. Each layer addresses a different attack surface.

Layer 1: Transport security

How data moves from server to client.

  • HTTPS everywhere. No HTTP variants serving content.
  • TLS 1.2 minimum, TLS 1.3 preferred. Disable TLS 1.0 and 1.1.
  • HSTS (Strict-Transport-Security) header set, with includeSubDomains and preload for high-confidence sites.
  • Strong cipher suites only. Modern browsers handle this if you pick a modern config from your provider.
  • Certificates from a trusted CA, monitored for expiration.
Layer 2: Response headers

What the browser is told about your site.

Header Purpose Default value
Strict-Transport-Security Force HTTPS max-age=31536000; includeSubDomains
Content-Security-Policy Restrict resource loading Site-specific
X-Content-Type-Options Prevent MIME sniffing nosniff
X-Frame-Options Clickjacking protection DENY or SAMEORIGIN
Referrer-Policy Control referrer info strict-origin-when-cross-origin
Permissions-Policy Control browser features Site-specific (camera, mic, etc.)
Cross-Origin-Opener-Policy Process isolation same-origin (where compatible)
Cross-Origin-Embedder-Policy Cross-origin restrictions require-corp (where applicable)

CSP deserves its own attention. See the framework section below.

Layer 3: Authentication and authorization

How users prove who they are and what they can do.

  • Strong password requirements (length over complexity rules; allow long passphrases)
  • Account lockout or rate limiting on login
  • 2FA available, required for admin accounts
  • Session tokens: short-lived, secure, HttpOnly cookies
  • Logout invalidates tokens server-side, not just client-side
  • Password reset flows that don't reveal account existence
  • Authorization checked on every request (don't rely on UI hiding)
Layer 4: Input handling

How untrusted input is processed.

  • Validate on the server (client validation is UX, not security)
  • Parameterized queries for any database access (no string concatenation into SQL)
  • Output encoding by context (HTML, JS, URL, CSS)
  • File upload restrictions (type, size, location, scanning)
  • Rate limiting on endpoints that could be abused
  • CSRF tokens on state-changing requests
Layer 5: Secrets management

Where credentials and keys live.

  • No secrets in code, config files in repos, or environment variables baked into images
  • Secrets in a dedicated secrets manager
  • Different secrets per environment (no shared dev/prod secrets)
  • Rotation schedule documented and followed
  • Audit log of secret access
  • Limited blast radius (each service has its own credentials, scoped narrowly)
Layer 6: Operational security

How the team operates.

  • Access controls reviewed quarterly (offboard immediately on departure)
  • 2FA enforced on every admin account (hosting, DNS, registrar, code host, deploy tools)
  • Audit logs enabled and reviewed
  • Vulnerability scanning (dependencies, containers, infrastructure)
  • Patch cadence defined
  • Incident response runbook exists (see incident-response)
  • Backups exist and are tested (see backup-and-disaster-recovery)
  • Security contact published (security.txt at /.well-known/security.txt)

Content Security Policy

CSP is the most powerful response header and the most often misconfigured. Worth its own treatment.

What CSP does

CSP tells the browser which sources are allowed for various resource types: scripts, styles, images, frames, connections, etc. A strict CSP prevents most XSS attacks even when input handling has bugs.

Two flavors

Strict CSP (recommended): uses nonce- or hash- based source allowlists. Inline scripts must be explicitly allowed via nonce.

Content-Security-Policy: script-src 'self' 'nonce-{random}' 'strict-dynamic'; object-src 'none'; base-uri 'self';

Allowlist CSP (legacy): lists allowed domains. Easier to set up, much weaker.

Content-Security-Policy: script-src 'self' https://trusted.com; ...

Strict CSP requires application changes (every inline script needs a nonce). The investment pays off.

Roll out CSP gradually
  1. Start with Content-Security-Policy-Report-Only to log violations without blocking.
  2. Set up a violation report endpoint.
  3. Watch for legitimate violations (third-party scripts, inline handlers).
  4. Tune the policy.
  5. Switch to enforcing mode once violations are mostly false positives.
  6. Continue monitoring violation reports for new issues.
Common CSP mistakes
  • unsafe-inline in script-src. Defeats most of CSP's value.
  • unsafe-eval in script-src. Often required by older libraries; refactor or replace.
  • Wildcard sources (*). Defeats the policy.
  • Allowing CDNs that host arbitrary user content. Attackers can upload scripts to the CDN.
  • Not restricting frame-ancestors. Use this for clickjacking defense (more flexible than X-Frame-Options).

Workflow

Step 1: Run a baseline scan

Use a free scanner: securityheaders.com, or the MDN HTTP Observatory at developer.mozilla.org/en-US/observatory. Get a current grade. This is the floor. If no scan result can be obtained, state the gap per the data-availability rule.

Step 2: Inventory the surface
  • Domains and subdomains in scope
  • Public endpoints (forms, APIs)
  • Authentication entry points
  • Admin interfaces
  • Third-party integrations and their permissions
Step 3: Audit each layer

Walk the 6 layers. For each, document:

  • What's in place
  • What's missing
  • Risk level (high, medium, low)
Step 4: Prioritize

High risk, easy fixes go first:

  • HSTS not set
  • Default headers missing
  • Admin without 2FA
  • Old TLS versions enabled

Medium risk, medium fixes next:

  • CSP rollout
  • Input validation gaps
  • Secret management improvements

Low risk, nice-to-haves last:

  • Permissions-Policy refinements
  • Optional headers (Cross-Origin-* family)
Step 5: Implement and verify

For each fix:

  • Make the change
  • Test in a non-production environment
  • Verify with a scanner
  • Roll out
  • Re-verify in production
Step 6: Set up monitoring
  • Certificate expiration alerts
  • CSP violation reporting
  • Failed login monitoring
  • Unusual admin activity alerts
  • Dependency vulnerability alerts (Dependabot, Snyk, or equivalent)
Step 7: Document the baseline

Write a security baseline document. It says what's expected on every site:

  • Required headers
  • Required configurations
  • Required practices

New sites get audited against this. Existing sites get re-audited periodically.

Step 8: Schedule review

Quarterly is the floor. Add reviews after major changes or incidents.


Common compliance touchpoints

Not legal advice. Surfaces where security baseline meets compliance requirements:

  • PCI DSS (if handling payment cards): much more involved than baseline. The baseline is a starting point, not sufficient.
  • SOC 2: baseline aligns with most CC controls (CC6 series). Documented baseline plus evidence of execution is the audit ask.
  • GDPR / privacy regs: baseline supports security obligations (Article 32). Privacy is broader than security.
  • HIPAA, HITRUST, FedRAMP: baseline is necessary, far from sufficient. Get specialized help.

When compliance applies, the baseline is necessary but not the full answer.


Failure patterns

HSTS without includeSubDomains. Attacker tricks browser into HTTP on a subdomain you haven't HTTPS'd yet.

HSTS preload without commitment. Once preloaded, removing it takes months to reach users through a Chrome update, with no guarantee for other browsers. Don't preload until HTTPS is solid across all subdomains forever.

CSP with unsafe-inline. Defeats most of CSP. Either go strict (nonce-based) or accept that CSP is providing limited protection.

Default headers missing. X-Content-Type-Options, X-Frame-Options, Referrer-Policy are easy and free. Set them.

Admin without 2FA. The single most common high-impact vulnerability across small teams. Fix today.

Secrets in environment variables baked into images. Anyone with image access has the secrets. Use a runtime secret manager.

No security.txt. Researchers find issues; they need somewhere to report. Publish a security.txt at /.well-known/security.txt.

Old TLS versions enabled. Disable TLS 1.0 and 1.1. Most providers offer this as a checkbox.

CDN allowing arbitrary inline scripts via misconfigured CSP. The CDN proxies user content; attackers leverage that. Audit the CSP against actual loaded resources.

No incident response plan. When (not if) something happens, no runbook = chaos. See incident-response.

Vulnerability scanning without remediation. Reports pile up. The scan is theater unless someone fixes findings.

Penetration test ignored. Pen test report sits on a shelf. Test results without remediation are worse than no test.


Output format

A security baseline document includes:

  • Inventory: what's in scope
  • Layer-by-layer status: what's in place, what's missing
  • Required headers: with values, applied per environment
  • Required configurations: TLS, secrets, auth
  • Required operational practices: access reviews, patch cadence, audit logging
  • Findings: prioritized list of gaps
  • Remediation plan: owners, dates
  • Re-audit cadence: when this is reviewed next

If required data is unavailable

This skill's output depends on data, measurements, or tool results it cannot generate on its own. When a required input, tool, or data source is unavailable or unverifiable, the sanctioned output is the deliverable with the gap stated: what was needed, what was actually obtained or verified, and which parts of the output are affected. Fabricating, estimating, or interpolating a required number to complete the deliverable is never sanctioned. A stated gap is a complete answer.


Reference files

1---
2name: security-baseline
3description: "Establish a security baseline for a website or web app. Use this skill when configuring HTTPS and TLS, setting security headers, planning secrets management, evaluating CSP policies, doing a basic security audit, or hardening a site before launch. Triggers on security headers, HTTPS, TLS, CSP, content security policy, HSTS, secrets management, vulnerability scan, security audit, harden, OWASP, security baseline. Also triggers when a security review is required for compliance or before going live."
4category: operations
5catalog_summary: "HTTPS, security headers, CSP, secrets management, vulnerability scans"
6display_order: 7
7---
8 
9# Security Baseline
10 
11Establish the security floor for any production website or web app. Stack-agnostic. Covers the things that should be in place before public launch and verified periodically after.
12 
13---
14 
15## When to use
16 
17- Pre-launch security review
18- Setting up a new site or environment
19- Periodic security audit (quarterly recommended)
20- Onboarding a new vendor or third-party integration
21- Responding to a security finding or report
22- Hardening after an incident
23 
24## When NOT to use
25 
26- Active incident response (use `incident-response`)
27- Code-level security review (use `code-review-web`)
28- Email-specific authentication (SPF/DKIM/DMARC) (use `email-deliverability`)
29- DNS-level security (CAA, DNSSEC) (use `domain-strategy`)
30- Performance-related security (DDoS protection sizing) (use `performance-optimization`)
31 
32---
33 
34## Required inputs
35 
36- The site or app in scope (URLs, environments)
37- The hosting platform and CDN
38- Authentication method (if any)
39- Third-party scripts and integrations
40- Compliance context (PCI, SOC2, GDPR, etc., if applicable)
41- Existing security tooling
42 
43---
44 
45## The framework: 6 layers
46 
47Security is layered. Each layer addresses a different attack surface.
48 
49### Layer 1: Transport security
50 
51How data moves from server to client.
52 
53- HTTPS everywhere. No HTTP variants serving content.
54- TLS 1.2 minimum, TLS 1.3 preferred. Disable TLS 1.0 and 1.1.
55- HSTS (Strict-Transport-Security) header set, with `includeSubDomains` and `preload` for high-confidence sites.
56- Strong cipher suites only. Modern browsers handle this if you pick a modern config from your provider.
57- Certificates from a trusted CA, monitored for expiration.
58 
59### Layer 2: Response headers
60 
61What the browser is told about your site.
62 
63| Header | Purpose | Default value |
64|---|---|---|
65| `Strict-Transport-Security` | Force HTTPS | `max-age=31536000; includeSubDomains` |
66| `Content-Security-Policy` | Restrict resource loading | Site-specific |
67| `X-Content-Type-Options` | Prevent MIME sniffing | `nosniff` |
68| `X-Frame-Options` | Clickjacking protection | `DENY` or `SAMEORIGIN` |
69| `Referrer-Policy` | Control referrer info | `strict-origin-when-cross-origin` |
70| `Permissions-Policy` | Control browser features | Site-specific (camera, mic, etc.) |
71| `Cross-Origin-Opener-Policy` | Process isolation | `same-origin` (where compatible) |
72| `Cross-Origin-Embedder-Policy` | Cross-origin restrictions | `require-corp` (where applicable) |
73 
74CSP deserves its own attention. See the framework section below.
75 
76### Layer 3: Authentication and authorization
77 
78How users prove who they are and what they can do.
79 
80- Strong password requirements (length over complexity rules; allow long passphrases)
81- Account lockout or rate limiting on login
82- 2FA available, required for admin accounts
83- Session tokens: short-lived, secure, HttpOnly cookies
84- Logout invalidates tokens server-side, not just client-side
85- Password reset flows that don't reveal account existence
86- Authorization checked on every request (don't rely on UI hiding)
87 
88### Layer 4: Input handling
89 
90How untrusted input is processed.
91 
92- Validate on the server (client validation is UX, not security)
93- Parameterized queries for any database access (no string concatenation into SQL)
94- Output encoding by context (HTML, JS, URL, CSS)
95- File upload restrictions (type, size, location, scanning)
96- Rate limiting on endpoints that could be abused
97- CSRF tokens on state-changing requests
98 
99### Layer 5: Secrets management
100 
101Where credentials and keys live.
102 
103- No secrets in code, config files in repos, or environment variables baked into images
104- Secrets in a dedicated secrets manager
105- Different secrets per environment (no shared dev/prod secrets)
106- Rotation schedule documented and followed
107- Audit log of secret access
108- Limited blast radius (each service has its own credentials, scoped narrowly)
109 
110### Layer 6: Operational security
111 
112How the team operates.
113 
114- Access controls reviewed quarterly (offboard immediately on departure)
115- 2FA enforced on every admin account (hosting, DNS, registrar, code host, deploy tools)
116- Audit logs enabled and reviewed
117- Vulnerability scanning (dependencies, containers, infrastructure)
118- Patch cadence defined
119- Incident response runbook exists (see `incident-response`)
120- Backups exist and are tested (see `backup-and-disaster-recovery`)
121- Security contact published (security.txt at /.well-known/security.txt)
122 
123---
124 
125## Content Security Policy
126 
127CSP is the most powerful response header and the most often misconfigured. Worth its own treatment.
128 
129### What CSP does
130 
131CSP tells the browser which sources are allowed for various resource types: scripts, styles, images, frames, connections, etc. A strict CSP prevents most XSS attacks even when input handling has bugs.
132 
133### Two flavors
134 
135**Strict CSP (recommended):** uses `nonce-` or `hash-` based source allowlists. Inline scripts must be explicitly allowed via nonce.
136 
137```
138Content-Security-Policy: script-src 'self' 'nonce-{random}' 'strict-dynamic'; object-src 'none'; base-uri 'self';
139```
140 
141**Allowlist CSP (legacy):** lists allowed domains. Easier to set up, much weaker.
142 
143```
144Content-Security-Policy: script-src 'self' https://trusted.com; ...
145```
146 
147Strict CSP requires application changes (every inline script needs a nonce). The investment pays off.
148 
149### Roll out CSP gradually
150 
1511. Start with `Content-Security-Policy-Report-Only` to log violations without blocking.
1522. Set up a violation report endpoint.
1533. Watch for legitimate violations (third-party scripts, inline handlers).
1544. Tune the policy.
1555. Switch to enforcing mode once violations are mostly false positives.
1566. Continue monitoring violation reports for new issues.
157 
158### Common CSP mistakes
159 
160- `unsafe-inline` in script-src. Defeats most of CSP's value.
161- `unsafe-eval` in script-src. Often required by older libraries; refactor or replace.
162- Wildcard sources (`*`). Defeats the policy.
163- Allowing CDNs that host arbitrary user content. Attackers can upload scripts to the CDN.
164- Not restricting `frame-ancestors`. Use this for clickjacking defense (more flexible than `X-Frame-Options`).
165 
166---
167 
168## Workflow
169 
170### Step 1: Run a baseline scan
171 
172Use a free scanner: securityheaders.com, or the MDN HTTP Observatory at developer.mozilla.org/en-US/observatory. Get a current grade. This is the floor. If no scan result can be obtained, state the gap per the data-availability rule.
173 
174### Step 2: Inventory the surface
175 
176- Domains and subdomains in scope
177- Public endpoints (forms, APIs)
178- Authentication entry points
179- Admin interfaces
180- Third-party integrations and their permissions
181 
182### Step 3: Audit each layer
183 
184Walk the 6 layers. For each, document:
185- What's in place
186- What's missing
187- Risk level (high, medium, low)
188 
189### Step 4: Prioritize
190 
191High risk, easy fixes go first:
192- HSTS not set
193- Default headers missing
194- Admin without 2FA
195- Old TLS versions enabled
196 
197Medium risk, medium fixes next:
198- CSP rollout
199- Input validation gaps
200- Secret management improvements
201 
202Low risk, nice-to-haves last:
203- Permissions-Policy refinements
204- Optional headers (Cross-Origin-* family)
205 
206### Step 5: Implement and verify
207 
208For each fix:
209- Make the change
210- Test in a non-production environment
211- Verify with a scanner
212- Roll out
213- Re-verify in production
214 
215### Step 6: Set up monitoring
216 
217- Certificate expiration alerts
218- CSP violation reporting
219- Failed login monitoring
220- Unusual admin activity alerts
221- Dependency vulnerability alerts (Dependabot, Snyk, or equivalent)
222 
223### Step 7: Document the baseline
224 
225Write a security baseline document. It says what's expected on every site:
226- Required headers
227- Required configurations
228- Required practices
229 
230New sites get audited against this. Existing sites get re-audited periodically.
231 
232### Step 8: Schedule review
233 
234Quarterly is the floor. Add reviews after major changes or incidents.
235 
236---
237 
238## Common compliance touchpoints
239 
240Not legal advice. Surfaces where security baseline meets compliance requirements:
241 
242- **PCI DSS** (if handling payment cards): much more involved than baseline. The baseline is a starting point, not sufficient.
243- **SOC 2:** baseline aligns with most CC controls (CC6 series). Documented baseline plus evidence of execution is the audit ask.
244- **GDPR / privacy regs:** baseline supports security obligations (Article 32). Privacy is broader than security.
245- **HIPAA, HITRUST, FedRAMP:** baseline is necessary, far from sufficient. Get specialized help.
246 
247When compliance applies, the baseline is necessary but not the full answer.
248 
249---
250 
251## Failure patterns
252 
253**HSTS without `includeSubDomains`.** Attacker tricks browser into HTTP on a subdomain you haven't HTTPS'd yet.
254 
255**HSTS preload without commitment.** Once preloaded, removing it takes months to reach users through a Chrome update, with no guarantee for other browsers. Don't preload until HTTPS is solid across all subdomains forever.
256 
257**CSP with `unsafe-inline`.** Defeats most of CSP. Either go strict (nonce-based) or accept that CSP is providing limited protection.
258 
259**Default headers missing.** `X-Content-Type-Options`, `X-Frame-Options`, `Referrer-Policy` are easy and free. Set them.
260 
261**Admin without 2FA.** The single most common high-impact vulnerability across small teams. Fix today.
262 
263**Secrets in environment variables baked into images.** Anyone with image access has the secrets. Use a runtime secret manager.
264 
265**No security.txt.** Researchers find issues; they need somewhere to report. Publish a security.txt at /.well-known/security.txt.
266 
267**Old TLS versions enabled.** Disable TLS 1.0 and 1.1. Most providers offer this as a checkbox.
268 
269**CDN allowing arbitrary inline scripts via misconfigured CSP.** The CDN proxies user content; attackers leverage that. Audit the CSP against actual loaded resources.
270 
271**No incident response plan.** When (not if) something happens, no runbook = chaos. See `incident-response`.
272 
273**Vulnerability scanning without remediation.** Reports pile up. The scan is theater unless someone fixes findings.
274 
275**Penetration test ignored.** Pen test report sits on a shelf. Test results without remediation are worse than no test.
276 
277---
278 
279## Output format
280 
281A security baseline document includes:
282 
283- **Inventory:** what's in scope
284- **Layer-by-layer status:** what's in place, what's missing
285- **Required headers:** with values, applied per environment
286- **Required configurations:** TLS, secrets, auth
287- **Required operational practices:** access reviews, patch cadence, audit logging
288- **Findings:** prioritized list of gaps
289- **Remediation plan:** owners, dates
290- **Re-audit cadence:** when this is reviewed next
291 
292---
293 
294## If required data is unavailable
295 
296This skill's output depends on data, measurements, or tool results it cannot generate on its own. When a required input, tool, or data source is unavailable or unverifiable, the sanctioned output is the deliverable with the gap stated: what was needed, what was actually obtained or verified, and which parts of the output are affected. Fabricating, estimating, or interpolating a required number to complete the deliverable is never sanctioned. A stated gap is a complete answer.
297 
298---
299 
300## Reference files
301 
302- [`references/headers-checklist.md`](references/headers-checklist.md): A copy-paste checklist of recommended security headers with example values, organized by tier of importance.
303 

Discussion

Alternatives

Also in SecuritySee all 533 in Development →