SAASMENT

Security skill · Find and fix

Web server, TLS, and security headers review.

Review a web server, reverse proxy, CDN, or load balancer configuration for TLS settings, certificate and redirect handling, HSTS, security response headers (Content-Security-Policy, framing, content-type, referrer, permissions), CORS, cookie flags, information disclosure, and exposed admin or debug paths, then fix and verify with header and handshake checks. Use when auditing nginx, Apache, Caddy, a CDN or cloud load balancer, or an application's response headers.

Download .zipInstall via MCPFind and fixMIT
  • Misconfiguration

Facts

Category
Find and fix
License
MIT
Tags
  • Misconfiguration
Version
1.0.0
Last updated
2026-12-02
Folder
web-server-tls-headers-review/
MCP resource
skill://web-server-tls-headers-review/SKILL.md
Files
  • SKILL.md
  • LICENSE
  • references/web-checks.md
Standards

Original Saasment content. Saasment is in early access; this skill does not require joining it.

Install via MCP or as files

Connect your client to https://www.saasment.com/api/mcp (see client setup) and call get_skill:

{
  "name": "get_skill",
  "arguments": {
    "slug": "web-server-tls-headers-review"
  }
}

Or download the .zip and unpack it into your agent's skills directory:

Terminal, from your project root (user-level: ~/.cursor/skills)

mkdir -p .cursor/skills
curl -fsSL https://www.saasment.com/ai-security/skills/web-server-tls-headers-review/download.zip -o /tmp/web-server-tls-headers-review.zip
unzip -o /tmp/web-server-tls-headers-review.zip -d .cursor/skills
# result: .cursor/skills/web-server-tls-headers-review/SKILL.md

Review SKILL.md before enabling a skill. Skills are instructions your agent will follow.

SKILL.md

---
name: web-server-tls-headers-review
description: Review a web server, reverse proxy, CDN, or load balancer configuration for TLS settings, certificate and redirect handling, HSTS, security response headers (Content-Security-Policy, framing, content-type, referrer, permissions), CORS, cookie flags, information disclosure, and exposed admin or debug paths, then fix and verify with header and handshake checks. Use when auditing nginx, Apache, Caddy, a CDN or cloud load balancer, or an application's response headers.
license: MIT
metadata:
  author: Saasment
  version: "1.0.0"
  category: both
  tags: "misconfiguration"
---

# Web server, TLS, and security headers review (find and fix)

License: MIT. Copyright (c) 2026 Saasment. Source: https://www.saasment.com/ai-security/skills/web-server-tls-headers-review

The edge of an application, meaning the web server, proxy, CDN, or load balancer, decides which protocol versions are accepted, whether browsers are told to stay on HTTPS, which scripts a page may run, whether the page can be framed, and how much of the server's inner workings leaks in responses. These are configuration settings, so they are quick to check from outside and from the config files. This skill reviews both and verifies the result with requests and a handshake test.

## When to use

- You audit nginx, Apache, Caddy, HAProxy, a CDN, a cloud load balancer, or framework-level header settings.
- A new site, domain, or environment is about to go live.
- A scanner or customer questionnaire flagged TLS or header findings.

## Safe by default

- Test only hosts you own or are authorized to test. Use ordinary requests and a TLS handshake check; do not run load, fuzzing, or exploit tools against production.
- Keep external scanning light: a few requests per host. Do not scan IP ranges you do not own.
- Roll out stricter settings in stages. A wrong Content-Security-Policy, HSTS, or CORS setting can break the site or lock browsers into HTTPS for a long time, so start with report-only or short lifetimes and test in staging.
- Do not paste private keys or full configs containing secrets into tickets or prompts.

## Procedure

1. **Inventory.** List each public hostname, what serves it (CDN, load balancer, proxy, application), who owns it, and where configuration lives. Record certificates and their expiry. Commands are in `references/web-checks.md`.
2. **Review TLS.** Only current protocol versions are enabled (TLS 1.2 and 1.3), old protocols and weak cipher suites are off, certificates are valid for the hostnames, chain is complete, renewal is automated and monitored, private keys are protected, and HTTP redirects to HTTPS on every hostname including non-www and API hosts. Use your platform's current recommended TLS profile; link to a maintained source and not a copy that goes stale.
3. **Review HSTS.** The `Strict-Transport-Security` header is sent on HTTPS responses with a long `max-age`; `includeSubDomains` and `preload` are used only after every subdomain is confirmed HTTPS-only.
4. **Review response headers** for HTML responses and APIs:
   - `Content-Security-Policy`: restricts script, style, frame, and connect sources; avoids `unsafe-inline` and `unsafe-eval` where feasible; uses nonces or hashes; deployed first as `Content-Security-Policy-Report-Only` if new.
   - Framing: `frame-ancestors` in CSP (and `X-Frame-Options` for older browsers) so only intended sites can embed the page.
   - `X-Content-Type-Options: nosniff` and correct `Content-Type` values.
   - `Referrer-Policy` set to limit referrer leakage; `Permissions-Policy` disables features the site does not use.
   - Cross-origin isolation headers where the application needs them.
5. **Review CORS.** `Access-Control-Allow-Origin` lists specific trusted origins, does not reflect the request's `Origin` header blindly, never pairs a wildcard with credentials, and limits methods and headers.
6. **Review cookies at the edge.** Session cookies set by the application or proxy carry `Secure`, `HttpOnly`, and an explicit `SameSite` (see `auth-session-review`).
7. **Review information disclosure.** Server and framework version banners, `X-Powered-By`, stack traces and debug pages, directory listings, backup and source files (`.git`, `.env`, `.bak`), default pages, and verbose error bodies are removed or blocked.
8. **Review exposed paths.** Admin consoles, status and metrics endpoints, API documentation, and health checks are limited by network, authentication, or both; the origin server is not reachable directly if a CDN or WAF is meant to be in front (restrict origin access to the CDN); unused HTTP methods are rejected.
9. **Review request handling limits.** Request size, header size, and timeouts are bounded; host header values are validated against known hostnames; proxy headers such as `X-Forwarded-For` are trusted only from your own proxies.
10. **Fix** in configuration (and as code where the platform supports it), then add header and TLS checks to CI or a scheduled job against staging and production.

## Verification

- Confirm TLS: run a handshake test (for example with `openssl s_client` or a TLS scanner against your own host) and confirm TLS 1.0 and 1.1 are refused, TLS 1.2 and 1.3 are accepted, and the certificate chain and hostname validate.
- Confirm redirects and HSTS: request `http://` and expect a redirect to `https://`; request the HTTPS page and confirm the `Strict-Transport-Security` header and its `max-age`.
- Confirm headers: `curl -sI https://<your-host>/` shows each expected header on HTML and on an API response; compare against your baseline list.
- Confirm CSP does not break the site: load key pages in a browser with the console open, check for blocked resources and violation reports, and fix before switching from report-only to enforcing.
- Confirm CORS with a request that sends an unexpected `Origin` header and expect no permissive `Access-Control-Allow-Origin` in the response; confirm an allowed origin works.
- Confirm disclosure fixes by requesting `/.git/config`, `/.env`, and a path that triggers an error on your own host and expecting a plain 403 or 404 with no version details.
- Confirm origin lockdown by requesting the origin directly (from outside the CDN's allowed ranges) and expecting a denial.

## Reporting

Table: finding id, hostname, setting, current value, issue, fix, verification. Add certificate expiry dates, TLS profile in use, and the date of testing.

## References

- Mozilla server-side TLS guidance and configuration generator: https://wiki.mozilla.org/Security/Server_Side_TLS
- MDN: Content-Security-Policy: https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy
- MDN: Strict-Transport-Security: https://developer.mozilla.org/docs/Web/HTTP/Headers/Strict-Transport-Security
- MDN: Cross-Origin Resource Sharing: https://developer.mozilla.org/docs/Web/HTTP/CORS
- OWASP HTTP Headers Cheat Sheet: https://cheatsheetseries.owasp.org/cheatsheets/HTTP_Headers_Cheat_Sheet.html
- OWASP Transport Layer Security Cheat Sheet: https://cheatsheetseries.owasp.org/cheatsheets/Transport_Layer_Security_Cheat_Sheet.html
- HSTS preload list requirements: https://hstspreload.org/
- Companion skills: `auth-session-review`, `xss-find-and-fix`, `ssrf-find-and-fix`.

Helper files

LICENSE
MIT License

Copyright (c) 2026 Saasment

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
references/web-checks.md
# Web server, TLS, and header checks

License: MIT. Copyright (c) 2026 Saasment.

Use only against hosts you own or are authorized to test. Replace `www.example.test` with your hostname. Keep requests few.

## Quick external checks

```bash
# Redirect from HTTP to HTTPS
curl -sI http://www.example.test/ | head -n 5

# Response headers on HTML and on an API route
curl -sI https://www.example.test/
curl -sI https://www.example.test/api/health

# Only the security headers, case-insensitive
curl -sI https://www.example.test/ | grep -iE '^(strict-transport-security|content-security-policy|x-frame-options|x-content-type-options|referrer-policy|permissions-policy|server|x-powered-by|set-cookie|access-control-)'

# Certificate subject, issuer, validity, and chain
echo | openssl s_client -connect www.example.test:443 -servername www.example.test 2>/dev/null \
  | openssl x509 -noout -subject -issuer -dates

# Protocol support: expect failure for old versions, success for 1.2 and 1.3
openssl s_client -connect www.example.test:443 -servername www.example.test -tls1_1 </dev/null 2>&1 | head -n 5
openssl s_client -connect www.example.test:443 -servername www.example.test -tls1_2 </dev/null 2>&1 | grep -i 'protocol'
openssl s_client -connect www.example.test:443 -servername www.example.test -tls1_3 </dev/null 2>&1 | grep -i 'protocol'

# CORS behavior with an unexpected origin
curl -sI -H 'Origin: https://untrusted.example.invalid' https://www.example.test/api/health | grep -i '^access-control'

# Files that should not be served
for p in /.git/config /.env /server-status; do
  printf '%s -> ' "$p"; curl -s -o /dev/null -w '%{http_code}\n' "https://www.example.test$p"
done
```

Dedicated TLS scanners (for example `testssl.sh` or `sslyze`) give a fuller report. Run them only on your own hosts.

## Header baseline for an HTML site

```text
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Security-Policy: default-src 'self'; script-src 'self' 'nonce-<per-response-random>'; object-src 'none'; base-uri 'self'; frame-ancestors 'self'
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: camera=(), microphone=(), geolocation=()
```

This is a starting point, not a copy-paste answer. Build the CSP from what your pages actually load, test with `Content-Security-Policy-Report-Only`, and add `preload` to HSTS only after the preload requirements are met on every subdomain.

## Server configuration snippets (illustrative)

```nginx
# nginx: redirect, hide version, set headers on every response
server_tokens off;

server {
  listen 80;
  server_name www.example.test;
  return 301 https://$host$request_uri;
}

server {
  listen 443 ssl;
  server_name www.example.test;
  ssl_protocols TLSv1.2 TLSv1.3;     # take cipher lists from a maintained profile
  add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
  add_header X-Content-Type-Options "nosniff" always;
  add_header Referrer-Policy "strict-origin-when-cross-origin" always;
  client_max_body_size 2m;
  location ~ /\.(?!well-known) { deny all; }
}
```

```apache
# Apache equivalents
ServerTokens Prod
ServerSignature Off
Header always set X-Content-Type-Options "nosniff"
Header always set Referrer-Policy "strict-origin-when-cross-origin"
Options -Indexes
```

Cipher suite lists change as guidance changes. Generate them from a maintained source (see the Mozilla link in the skill) at the time you deploy.

## Findings table

| Finding | Why it matters | Fix |
| --- | --- | --- |
| TLS 1.0 or 1.1 accepted | Known weaknesses, fails modern compliance reviews | Allow TLS 1.2 and 1.3 only |
| No HTTP to HTTPS redirect on some host | Users and bots can use plain HTTP | Redirect every hostname |
| No HSTS | Browsers can be downgraded on first or later visits | Add the header, then extend lifetime |
| Missing or very loose CSP | Weaker XSS defense in depth | Build a policy from real needs, test in report-only |
| Page can be framed by anyone | Clickjacking | `frame-ancestors` |
| CORS reflects any origin with credentials | Other sites can read authenticated responses | Explicit origin allowlist |
| `Server: Apache/2.4.x (Unix)` and framework banners | Eases targeting known issues | Remove or minimize banners |
| `/.git`, `/.env`, backups served | Source and secrets exposure | Block dotfiles and backup extensions, remove files |
| Origin reachable without the CDN | WAF and rate limits bypassed | Restrict origin to CDN addresses or mutual TLS |
| Expired or soon-to-expire certificate | Outage and trust warnings | Automate renewal and alert 30 days ahead |

Related

Companion skills

Questions

How do I install the Web server, TLS, and security headers review skill?

Download https://www.saasment.com/ai-security/skills/web-server-tls-headers-review/download.zip and unzip it into your agent's skills directory (for example .cursor/skills, .claude/skills, .agents/skills, or .github/skills) so that web-server-tls-headers-review/SKILL.md exists. Or connect to https://www.saasment.com/api/mcp and call the get_skill tool with the slug web-server-tls-headers-review.

What license is the Web server, TLS, and security headers review skill under?

It is original Saasment content under the MIT license, stated in the SKILL.md frontmatter and in the LICENSE file in the skill folder.

Is it safe to run this skill?

A skill is a set of instructions your agent follows, so read SKILL.md first. It tells the agent to test only systems you own or are authorized to test, to use test environments and synthetic data, and to avoid destructive probes. Downloading it does not run any code on your machine.

← All security skills

Try the platform.

Open the demo workspace with mock data. No login. Register from the banner when you want early access. No security team. No call.

Try the platform