HTTP Security Header Tools and Commands: Ready to Reuse

Checking security response headers doesn't require complex platforms. With just four commands, two online tools, and one reporting endpoint, you can cover most …

Insights:HTTP Security Header Tools and Commands: Ready to Reuse

Command 1: Check Response Headers

curl -I https://example.com

Key things to look for:

  • strict-transport-security
  • x-content-type-options
  • referrer-policy
  • content-security-policy
  • x-frame-options
  • cache-control

Command 2: Check Full Handshake and Certificate

curl -vI https://example.com

Verify the TLS version, certificate chain, and redirects. If certificate errors appear, fix those first before moving on to response headers.

Command 3: Follow Redirects

curl -IL https://example.com

Check the status code and Location at each hop. Confirm there is no HTTP/HTTPS loop and no back-and-forth jumping between www and non-www.

Command 4: Check Resource Protocols

In the browser developer tools:

  1. Open Network.
  2. Refresh the page.
  3. Filter http:// resources.
  4. Check the Console for mixed content and CSP blocking.

Online Tools

Tool What to Look For When to Use
Security Headers Header completeness and rating Pre-launch baseline
Mozilla Observatory Configuration score and recommendations Regular review
CSP Evaluator Whether the policy is too broad or too strict Before modifying CSP
PageSpeed Insights Whether resource blocking affects user experience Performance regression

CSP Reporting Endpoint

Start with Report-Only, point report-uri or report-to to a collection endpoint. Observe for one to two weeks, address violations item by item by source, then switch to the enforcement policy.

The report has three columns: blocked directives, blocked URLs, and pages where they occurred. Prioritize violations affecting login, payments, and above-the-fold content.

Interpretation Guidelines

  • Missing header: add the four basics.
  • Duplicate headers: consolidate at the entry layer.
  • CSP blocked: allow required sources first, then tighten.
  • HSTS anomaly: confirm site-wide HTTPS before adjusting max-age.
  • Cache not taking effect: check CDN and HTML cache policies.

Pre-Launch Command Checklist

  1. curl -I to inspect headers.
  2. curl -IL to follow redirects.
  3. Check Console in the browser.
  4. Check ratings with online tools.
  5. Walk through login, payment, and embed scenarios.
  6. Have a rollback configuration ready.

Boundaries

Different CDNs and frameworks have different default headers, so command outputs may vary. The tool provides configuration clues, but the final validation should be based on real user paths and business regression testing.

Related reading: