Security header guides

From a failing header
to a tested fix.

What each security header protects against, how to roll it out without breaking your site, and configuration we ran on real servers before publishing it.

Headers in the grade
6
Heaviest header: CSP
25/100
Guides published
41

01 / The headers grade

Six headers.
One score out of 100.

Each header earns its full weight when it passes, half when WebSec0 flags a weakness, and nothing when it is missing. Start with the heaviest one.

  1. 25ptsContent-Security-PolicyLimits where scripts and other resources load from. Server guides: Apache, Caddy, Nginx, Traefik.Read the guide
  2. 20ptsStrict-Transport-SecurityKeeps browsers on HTTPS for every later visit. Server guides: Apache, Caddy, Nginx, Traefik.Read the guide
  3. 15ptsX-Frame-OptionsStops other sites from framing your pages. Server guides: Apache, Caddy, Nginx, Traefik.Read the guide
  4. 15ptsReferrer-PolicyControls how much of your URLs leaks to other sites. Server guides: Apache, Caddy, Nginx, Traefik.Read the guide
  5. 15ptsPermissions-PolicySwitches off browser features you do not use. Server guides: Apache, Caddy, Nginx, Traefik.Read the guide
  6. 10ptsX-Content-Type-OptionsStops browsers from guessing content types. Server guides: Apache, Caddy, Nginx, Traefik.Read the guide

02 / By server

Every header,
one configuration.

A single tested snippet with all six headers for your web server, and how to keep it on every location, error page and proxied application.

03 / Penalties and bonuses

Beyond the six.
Points won and lost.

Other headers move the score after the six are graded: insecure cookies, an open CORS policy and a version in the Server header cost points, cross-origin isolation earns them.

  1. −5ptsSet-Cookie−5 per cookie without Secure (−10 at most), −3 without SameSite, −3 for a session cookie without HttpOnly.Read the guide
  2. −10ptsAccess-Control-Allow-Origin−10 when any origin may read your responses.Read the guide
  3. −5ptsServer−5 when the header shows a software version.Read the guide
  4. +10ptsCOOP, COEP and CORP+5 for Cross-Origin-Opener-Policy: same-origin, +3 for COEP and +2 for CORP.Read the guide

04 / TLS

The TLS grade.
What caps it.

WebSec0 grades your TLS setup apart from the headers. Old protocol versions, weak cipher suites and a broken certificate chain each cap that grade, whatever the score.

  1. CcapTLS 1.0 and 1.1Caps the TLS grade at C while either version is offered. Server guides: Nginx.Read the guide
  2. CcapCipher suitesCaps the grade at C for 3DES or no forward secrecy, and at F for RC4.Read the guide
  3. BcapCertificate chainCaps the grade at B when an intermediate certificate is missing, and at T when the chain does not validate.Read the guide

05 / How we write them

Fewer opinions.
More evidence.

01

Tested before published

Every server snippet is run in a container on the versions named in the guide, and its result checked with curl or openssl, error pages included.

Written and tested by Joshua Martinelle.

02

Aligned with the scanner

Each guide explains exactly what WebSec0 checks and how it scores, so the fix you apply is the one the report asks for.

03

Sourced and dated

Claims link to specifications, MDN and server documentation. Browser support and server versions are rechecked when we update a guide.

Not sure where to start?

Scan first. Fix what fails.

The report links each failing header to its guide.

Scan your site