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-securityx-content-type-optionsreferrer-policycontent-security-policyx-frame-optionscache-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:
- Open Network.
- Refresh the page.
- Filter
http://resources. - 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
curl -Ito inspect headers.curl -ILto follow redirects.- Check Console in the browser.
- Check ratings with online tools.
- Walk through login, payment, and embed scenarios.
- 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: