Files
Charon/docs/features/security-headers.md
akanealw eec8c28fb3
Some checks failed
Go Benchmark / Performance Regression Check (push) Has been cancelled
Cerberus Integration / Cerberus Security Stack Integration (push) Has been cancelled
Upload Coverage to Codecov / Backend Codecov Upload (push) Has been cancelled
Upload Coverage to Codecov / Frontend Codecov Upload (push) Has been cancelled
CodeQL - Analyze / CodeQL analysis (go) (push) Has been cancelled
CodeQL - Analyze / CodeQL analysis (javascript-typescript) (push) Has been cancelled
CrowdSec Integration / CrowdSec Bouncer Integration (push) Has been cancelled
Docker Build, Publish & Test / build-and-push (push) Has been cancelled
Quality Checks / Auth Route Protection Contract (push) Has been cancelled
Quality Checks / Codecov Trigger/Comment Parity Guard (push) Has been cancelled
Quality Checks / Backend (Go) (push) Has been cancelled
Quality Checks / Frontend (React) (push) Has been cancelled
Rate Limit integration / Rate Limiting Integration (push) Has been cancelled
Security Scan (PR) / Trivy Binary Scan (push) Has been cancelled
Supply Chain Verification (PR) / Verify Supply Chain (push) Has been cancelled
WAF integration / Coraza WAF Integration (push) Has been cancelled
Docker Build, Publish & Test / Security Scan PR Image (push) Has been cancelled
Repo Health Check / Repo health (push) Has been cancelled
History Rewrite Dry-Run / Dry-run preview for history rewrite (push) Has been cancelled
Prune Renovate Branches / prune (push) Has been cancelled
Renovate / renovate (push) Has been cancelled
Nightly Build & Package / sync-development-to-nightly (push) Has been cancelled
Nightly Build & Package / Trigger Nightly Validation Workflows (push) Has been cancelled
Nightly Build & Package / build-and-push-nightly (push) Has been cancelled
Nightly Build & Package / test-nightly-image (push) Has been cancelled
Nightly Build & Package / verify-nightly-supply-chain (push) Has been cancelled
Update GeoLite2 Checksum / update-checksum (push) Has been cancelled
Container Registry Prune / prune-ghcr (push) Has been cancelled
Container Registry Prune / prune-dockerhub (push) Has been cancelled
Container Registry Prune / summarize (push) Has been cancelled
changed perms
2026-04-22 18:19:14 +00:00

4.2 KiB
Executable File

title, description, category
title description category
HTTP Security Headers Automatic security headers including CSP, HSTS, and more security

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

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

  1. Navigate to Hosts → Select your host → Security Headers
  2. Choose a preset from the dropdown
  3. Review the applied headers in the preview
  4. Click Save to apply

Custom Header Profiles

Create reusable header configurations:

  1. Go to SettingsSecurity Profiles
  2. Click Create Profile
  3. Name your profile (e.g., "API Servers", "Public Sites")
  4. Configure individual headers
  5. Save and apply to multiple hosts

Interactive CSP Builder

The CSP Builder provides a visual interface for constructing Content-Security-Policy:

  1. Select directive (script-src, style-src, img-src, etc.)
  2. Add allowed sources (self, specific domains, unsafe-inline)
  3. Preview the generated policy
  4. Test against your site before applying

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