Skip to main content
Security

Security headers

Configure browser security policies for Easel applications.

HTTP response headers can reduce the impact of cross-site scripting, framing, MIME confusion, and information leakage.

Easel may set infrastructure-level headers, but application-specific browser policies remain your responsibility.

Content Security Policy

Content Security Policy (CSP) restricts which resources a browser may load and execute.

Example starting point:

Content-Security-Policy: default-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'none'

A real CSP must account for the application’s scripts, styles, images, APIs, fonts, frames, and development tooling.

Roll out CSP carefully:

  1. Begin with Content-Security-Policy-Report-Only.
  2. Collect violation reports.
  3. Remove unsafe dependencies.
  4. Narrow allowed sources.
  5. Enforce the policy.

Avoid adding broad values such as *, 'unsafe-inline', or 'unsafe-eval' without understanding the tradeoff.

HSTS

HTTP Strict Transport Security instructs browsers to use HTTPS.

Example:

Strict-Transport-Security: max-age=31536000

Only add includeSubDomains when every subdomain supports HTTPS.

Only request preload after verifying the domain meets browser preload requirements and the policy can be maintained.

See HTTPS and TLS.

Framing

Prevent unauthorized framing with CSP:

Content-Security-Policy: frame-ancestors 'none'

X-Frame-Options remains useful for older clients:

X-Frame-Options: DENY

Use SAMEORIGIN or an explicit CSP allowlist when legitimate embedding is required.

MIME sniffing

X-Content-Type-Options: nosniff

This helps prevent browsers from interpreting a response as a different content type.

Referrer policy

Example:

Referrer-Policy: strict-origin-when-cross-origin

Choose a policy based on analytics and privacy requirements.

Permissions policy

Permissions Policy controls browser features such as camera, microphone, and geolocation.

Example:

Permissions-Policy: camera=(), microphone=(), geolocation=()

Framework configuration

Configure headers using your framework’s supported mechanism (for example Next.js headers in next.config).

See also Request and response headers for platform headers Easel may set on CDN responses.