HTTP Security Headers¶
Modern browsers expect specific security headers to protect your users. Charon automatically adds industry-standard headers including Content-Security-Policy, Strict-Transport-Security, X-Frame-Options, and X-Content-Type-Options.
Overview¶
HTTP security headers instruct browsers how to handle your content securely. Without them, your site remains vulnerable to clickjacking, XSS attacks, protocol downgrades, and MIME-type confusion. Charon provides a visual interface for configuring these headers without memorizing complex syntax.
Supported Headers¶
| Header | Purpose |
|---|---|
| HSTS | Forces HTTPS connections, prevents downgrade attacks |
| Content-Security-Policy | Controls resource loading, mitigates XSS |
| X-Frame-Options | Prevents clickjacking via iframe embedding |
| X-Content-Type-Options | Stops MIME-type sniffing attacks |
| Referrer-Policy | Controls referrer information leakage |
| Permissions-Policy | Restricts browser feature access (camera, mic, geolocation) |
| Cross-Origin-Opener-Policy | Isolates browsing context |
| Cross-Origin-Resource-Policy | Controls cross-origin resource sharing |
X-XSS-Protection is sent as 0. Old browsers used this header for a built-in filter that could itself create holes, so the value 0 turns it off. Use Content-Security-Policy for protection against script injection instead.
Options you switch off stay off. When you create a profile or a proxy host, any header option you turned off is saved as off, instead of switching back on.
Why Use This¶
- Browser Protection: Modern browsers actively check for security headers
- Compliance: Many security audits and standards require specific headers
- Defense in Depth: Headers add protection even if application code has vulnerabilities
- No Code Changes: Protect legacy applications without modifying source code
Security Presets¶
Charon offers three ready-to-use presets based on your security requirements:
Basic (Production Safe)¶
Balanced security suitable for most production sites. Enables essential protections without breaking typical web functionality.
- HSTS enabled (1 year, includeSubdomains)
- X-Frame-Options: SAMEORIGIN
- X-Content-Type-Options: nosniff
- Referrer-Policy: strict-origin-when-cross-origin
Strict (High Security)¶
Enhanced security for applications handling sensitive data. May require CSP tuning for inline scripts.
- All Basic headers plus:
- Content-Security-Policy with restrictive defaults
- Permissions-Policy denying sensitive features
- X-Frame-Options: DENY
Paranoid (Maximum)¶
Maximum security for high-value targets. Expect to customize CSP directives for your specific application.
- All Strict headers plus:
- CSP with nonce-based script execution
- Cross-Origin policies fully restricted
- All permissions denied by default
Configuration¶
Using Presets¶
- Navigate to Hosts → Select your host → Security Headers
- Choose a preset from the dropdown
- Review the applied headers in the preview
- Click Save to apply
Custom Header Profiles¶
Create reusable header configurations:
- Go to Settings → Security Profiles
- Click Create Profile
- Name your profile (e.g., "API Servers", "Public Sites")
- Configure individual headers
- Save and apply to multiple hosts
Interactive CSP Builder¶
The CSP Builder provides a visual interface for constructing Content-Security-Policy:
- Select directive (script-src, style-src, img-src, etc.)
- Add allowed sources (self, specific domains, unsafe-inline)
- Preview the generated policy
- Test against your site before applying
How Profiles Work With Your App's Own Headers¶
Some apps send their own security headers. Here is what happens when a profile is applied:
- The profile wins. For every header your profile sets, your browser gets exactly one value: the profile's. Your app's own value for that header is replaced, not doubled up.
- Headers your profile doesn't set are left alone. They pass through exactly as your app sent them. This includes headers your profile turns off: Charon does not remove your app's own copy.
- Report-only CSP keeps your app's own policy. If your profile uses a "report only" Content-Security-Policy and your app sends its own enforcing one, both reach the browser. Your app's policy keeps working.
- HSTS: the profile beats the older per-host setting. If both are set, the profile's Strict-Transport-Security is the one that is used.
- Error pages are covered too. When Charon shows its own error page (for example a 502 when your app is down), the profile's security headers are included.
- Refused requests are covered too. When an access list or rate limit turns a visitor away (403 or 429), the response includes the profile's security headers.
Security Score Calculator¶
Each host displays a security score from 0-100 based on enabled headers:
| Score Range | Rating | Description |
|---|---|---|
| 90-100 | Excellent | All recommended headers configured |
| 70-89 | Good | Core protections in place |
| 50-69 | Fair | Basic headers only |
| 0-49 | Poor | Missing critical headers |
When to Use Each Preset¶
| Scenario | Recommended Preset |
|---|---|
| Marketing sites, blogs | Basic |
| E-commerce, user accounts | Strict |
| Banking, healthcare, government | Paranoid |
| Internal tools | Basic or Strict |
| APIs (no browser UI) | Minimal or disabled |
Related¶
- Proxy Headers - Backend communication headers
- Access Control - IP-based access control
- Back to Features