——
GuideHARDENING

Web server TLS and security header baseline

Set safe transport and browser policies, but verify application compatibility and avoid treating headers as a substitute for secure code.

For teams operating public websites and reverse proxies.

TLSHTTP headersWeb

Start with the situation, not the slogan

Hardening is the practice of making the safe path ordinary and the dangerous path conspicuous. Web server TLS and security header baseline is not a demand to enable every severe-looking setting. It is a measured baseline: understand the service, reduce unnecessary exposure, protect privileged changes and prove that the business function still works.

Begin with inventory and ownership. A control applied to an unknown dependency is not defence in depth; it is surprise as a service. Record the current state, define the rollback condition and change one coherent control group at a time. The result should be supportable by the people who will receive the telephone call six months later.

TLS protects transport; browser security headers constrain selected client behaviours. Both need current configuration, but neither repairs broken access control, injection, or insecure application logic.

How this usually reaches the desk

Assume a routine review records the following condition: “HTTP remains reachable without a clear redirect or HSTS deployment plan.” The appropriate response is not a mass edit copied from a checklist. Establish which systems share the condition, which legitimate workflow depends on it, and how a safe pilot will demonstrate improvement. A baseline earns trust by surviving both an attack-shaped test and an ordinary Monday.

This scenario combines common operational patterns; it is not presented as a report of one named incident.

What to look for

Begin with preserved, comparable evidence. One signal is rarely proof; use independent observations and a reliable timeline before declaring scope or intent.

01

HTTP remains reachable without a clear redirect or HSTS deployment plan.

Measure the current state and identify the owner before proposing a target. Configuration without ownership quietly returns to folklore after the next upgrade.

02

Obsolete protocol or cipher support, certificate-chain errors, and inconsistent virtual-host configuration.

Separate necessary exceptions from historical accidents. An exception needs a reason, compensating control, approver and review date; otherwise it is merely a setting wearing formal clothes.

03

Content Security Policy, framing, MIME sniffing, referrer, and permissions policies are absent or copied without testing.

Look for enforcement and telemetry together. A blocked action should leave a useful record, while an allowed action should remain understandable to support staff and service owners.

Run it, read it, decide what changes

These examples use documentation addresses, test identities and bounded targets. Replace placeholders only inside systems you own or are explicitly authorised to operate. Read the expected result and next action before running the command; a successful command is evidence, not yet a conclusion.

Example 01

Record HTTP security headers

curlAny shell
Prerequisites
An owned HTTPS endpoint.
shell
curl -sS -D headers.txt -o /dev/null https://www.example.com/
grep -Ei '^(strict-transport-security|content-security-policy|x-content-type-options|referrer-policy|permissions-policy):' headers.txt
Expected result

The live response headers are saved and selected security controls are printed.

How to interpret it

Header presence is not proof of a safe value. CSP report-only does not enforce, and HSTS on HTTP is ignored.

Next action

Compare values with the application design, add one header at a time in staging, and retest affected user flows.

Example 02

Inspect TLS protocol and certificate

OpenSSLLinux, macOS or WSL
Prerequisites
An owned hostname.
shell
host=www.example.com
openssl s_client -connect "$host:443" -servername "$host" -tls1_2 </dev/null
openssl s_client -connect "$host:443" -servername "$host" -tls1_3 </dev/null
Expected result

Each supported handshake prints certificate and negotiated cipher information; unsupported versions fail.

How to interpret it

Handshake failure can be a network or client issue. Supporting TLS 1.2 is not inherently weak; cipher and application context matter.

Next action

Test from a second current client, remove obsolete protocols in staging, and monitor compatibility during rollout.

Example 03

Run a passive web baseline

OWASP ZAP BaselineDocker
Prerequisites
Written authorisation for the target URL.
shell
docker run --rm -t -v "$PWD:/zap/wrk/:rw" ghcr.io/zaproxy/zaproxy:stable   zap-baseline.py -t https://www.example.com -r zap-report.html
Expected result

A local HTML report lists passive alerts from the short spider and response analysis.

How to interpret it

It does not prove absence of application vulnerabilities and may not reach authenticated routes.

Next action

Triage findings, arrange authenticated testing separately, fix confirmed headers or content issues, and repeat the same baseline.

What to do

Read the whole sequence before starting. Several workstreams may run in parallel, but their evidence, authority and expected outcomes still need to be explicit. Every step below points back to a concrete example; use the example as implementation evidence, not as permission to operate outside the stated scope.

  1. 01

    Inventory every hostname, certificate, proxy, CDN, origin, redirect, and non-browser client before changing policy.

    Write the desired outcome, affected population, dependencies and rollback trigger. This converts a generic recommendation into a change that can be reviewed.

    Working example 01: Record HTTP security headers — curl on Any shell.

  2. 02

    Use current platform defaults and supported TLS versions; automate issuance, renewal, and expiry alerting.

    Pilot on representative systems and identities, including at least one awkward legacy workflow. The easiest device is rarely the one that pages the on-call engineer.

    Working example 02: Inspect TLS protocol and certificate — OpenSSL on Linux, macOS or WSL.

  3. 03

    Add headers deliberately, beginning with reporting or narrow policies when compatibility is uncertain.

    Apply the control through the authoritative management path and preserve the resulting policy or configuration as code or controlled documentation where practical.

    Working example 03: Run a passive web baseline — OWASP ZAP Baseline on Docker.

  4. 04

    Build a Content Security Policy from actual resource needs and remove unsafe sources over time.

    Test an expected allowed case and an expected blocked case. Confirm the event appears in logs with enough context for a human to understand it.

    Working example 01: Record HTTP security headers — curl on Any shell.

  5. 05

    Test redirects, subdomains, APIs, downloads, framing, third-party resources, and error pages across browsers.

    Roll out in stages, monitor support and security signals, document exceptions, and assign a review date tied to platform or business change.

    Working example 02: Inspect TLS protocol and certificate — OpenSSL on Linux, macOS or WSL.

Operational judgement

Controls age. Products change defaults, licences move features, teams replace applications and carefully written exceptions outlive the systems that inspired them. Review the baseline for TLS, HTTP headers and Web after material upgrades and incidents, and on a scheduled cadence. The review should remove obsolete rules as readily as it adds new ones.

Measure outcomes rather than configuration volume. Useful evidence includes reduced exposed services, stronger authentication coverage, tested recovery, fewer standing privileges and alerts that an operator can act upon. A longer policy is not automatically a safer policy; sometimes it is merely more difficult to print.

Make the result useful to the next person

Publish the baseline with its purpose, scope, authoritative management path, minimum supported versions, dependencies, allowed exceptions, monitoring, rollback and review date. Show the delta from the previous state rather than distributing a mysterious final configuration. Service owners should know which user-visible behaviour may change and where to report a legitimate failure. Security owners should know what event proves that the control blocked or detected the intended case.

The implementation record should connect “Inventory every hostname, certificate, proxy, CDN, origin, redirect, and non-browser client before changing policy.” to the verification required after “Test redirects, subdomains, APIs, downloads, framing, third-party resources, and error pages across browsers.” Include pilot population, success measures, support findings and every approved exception. If the control cannot be continuously measured, schedule a repeatable audit. A baseline is healthy when operators can explain it, new systems inherit it, exceptions remain scarce and visible, and removal of an obsolete rule is treated as maintenance rather than heresy.

Validate before you close

Use an independent configuration check and application tests to prove transport, renewal, policy enforcement, and required user flows across every hostname.

Capture the test, the expected result and the observed result. Where a person or business owner must accept restored service, name them in the record. A green dashboard can confirm that a component is answering; it cannot confirm that invoices, identities or restored data are trustworthy.

Finish with a compact closure note: the original trigger, confirmed scope, evidence retained, controls changed, tests passed, known gaps, residual risk, and the people responsible for the remaining work. Schedule a review while the timeline is still fresh enough to challenge. The purpose is not to find a person to blame; computers already perform blame with admirable efficiency. The purpose is to make the next response faster, safer and less dependent on one person remembering where the useful log was hidden.

Common mistakes

  • Changing many controls at once without a rollback path.
  • Applying a generic baseline without documenting business exceptions.
  • Assuming a setting is effective without testing both normal use and a blocked case.

These errors usually come from haste, unclear ownership or misplaced confidence. Build the safeguard into the runbook: a required evidence field, a second-person review, a rollback test or a specific exit criterion.

Questions people ask when the clock is running

Should we apply every recommendation at once?

No. Group related controls, pilot them, define rollback and expand only after verification. Large undifferentiated changes make both outages and security improvements difficult to attribute.

What makes an exception acceptable?

A business reason, narrow scope, accountable approver, compensating control, expiry or review date, and evidence that the residual risk is understood. “It broke once in 2019” is useful history, not permanent governance.

How is the baseline verified?

Use an independent configuration check and application tests to prove transport, renewal, policy enforcement, and required user flows across every hostname. Re-test after significant platform changes and keep the result with the control record.

Safety boundary

Use these steps only on systems you own or are explicitly authorised to assess. Preserve evidence, follow your organisation’s legal and regulatory obligations, and prefer reversible actions when the situation is not yet understood.

Primary references

  1. HTTP Headers Cheat SheetOWASP
  2. Cryptographic Storage Cheat SheetOWASP
  3. Authorization Cheat SheetOWASP
  4. ZAP Baseline ScanOWASP ZAP

Editorial status: first edition. Review the linked vendor documentation for product- and version-specific changes before acting.