Pcornel
Security · Web Security

HSTS

Cheat sheet · https://pcornel.dk/topic.php?topic=4763

Back to the Topic

Answer

HSTS (HTTP Strict Transport Security) tells browsers to always use HTTPS for a domain for a set time, such as max-age=31536000; includeSubDomains, preventing SSL stripping attacks.

Remember

  • Use max-age of at least a year.
  • Add includeSubDomains when all subdomains use HTTPS.
  • Preload is hard to undo.

First checks

  • curl -sI https://<site> | grep -i strict-transport-security — header
  • max-age, includeSubDomains, preload — values
  • HTTP → HTTPS redirect — first visit

Verify in this order

HTTPS response → HSTS → future requests HTTPS only

Where it usually breaks

First mismatch in asset/subject identity → trust/authentication → authorization/policy → enforcement/control → telemetry/detection → protected outcome/response; preserve identity/policy/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=4763

Confirmation

Confirm action

Continue?