---
name: security-headers-check
description: Check that a website is served over HTTPS and sends the security headers that protect its visitors, and say which gaps matter.
---

# Checklist: HTTPS and security headers: what to set and why

Work through the steps in order on the site you are given. Each step says what to do and how to verify it from outside, with plain HTTP requests and no JavaScript unless the step says so. Report each step as pass, fail or not checked, with the URL and what you saw.

The reasoning behind every step: https://witnessqa.com/learn/https-and-security-headers/ (Markdown: https://witnessqa.com/learn/https-and-security-headers/index.md). To run the checks marked "WitnessQA checks" automatically, start a free audit at https://witnessqa.com/.

## Steps

1. **Serve everything over HTTPS.** Every page answers on https:// with a valid certificate. Plain http:// redirects there with one permanent redirect.
   Verify: Request the http:// URL of the home page. It answers 301 or 308 to the https:// URL, and that URL answers 200 without a certificate error.
   WitnessQA checks: [seo_https_redirect](https://witnessqa.com/docs/checks/#seo_https_redirect), [seo_host_redirect](https://witnessqa.com/docs/checks/#seo_host_redirect)
2. **Load nothing over plain HTTP.** Every script, stylesheet, image and frame on an HTTPS page is loaded over HTTPS too.
   Verify: Read the HTML of each key page. No `src` or `href` of a loaded resource starts with `http://`.
3. **Tell browsers to stay on HTTPS.** Send `Strict-Transport-Security` with a max-age of at least six months. Add `includeSubDomains` only when every subdomain works over HTTPS.
   Verify: Read the response headers of the home page over HTTPS. `strict-transport-security` is present with `max-age` of 15552000 or more.
4. **Stop the browser guessing file types.** Send `X-Content-Type-Options: nosniff` on every response.
   Verify: Read the response headers. `x-content-type-options` is `nosniff`.
5. **Decide who may frame your pages.** Pages with logins, payments or account actions send `Content-Security-Policy: frame-ancestors 'self'` (or `X-Frame-Options: SAMEORIGIN`). Pages meant to be embedded do not need it.
   Verify: Read the response headers of the login and checkout pages. One of the two headers is present.
6. **Limit what you tell other sites.** Send `Referrer-Policy: strict-origin-when-cross-origin` or stricter, and keep tokens and personal data out of URLs.
   Verify: Read the response headers. `referrer-policy` is present and is not `unsafe-url` or `no-referrer-when-downgrade`.
7. **Switch off browser features you do not use.** Send `Permissions-Policy` that turns off camera, microphone and location unless a page needs them.
   Verify: Read the response headers. `permissions-policy` is present.
8. **Add a Content Security Policy, in report-only mode first.** Start with `Content-Security-Policy-Report-Only`, fix what it reports, then enforce it. Avoid `unsafe-inline` for scripts where you can.
   Verify: Read the response headers for `content-security-policy`. Load each key page in a browser and confirm the console shows no resource refused by the policy.
   WitnessQA checks: [csp](https://witnessqa.com/docs/checks/#csp)
9. **Protect the session cookie.** Cookies that keep a visitor signed in are set with `Secure`, `HttpOnly` and `SameSite=Lax` or `Strict`.
   Verify: Sign in with a test account and read the `set-cookie` headers. The session cookie carries all three attributes.