Skip to content

Latest commit

 

History

History

docs

Secure Headers Documentation

Welcome to the documentation for Secure Headers, a flexible Python library for managing HTTP security headers. This guide will help you get started with configuring headers, integrating with various web frameworks, and understanding how each security header works.


📖 Table of Contents


🚀 Getting Started

To quickly get started using Secure Headers, check out the basic configuration guide in the main README:

For installation instructions, see the Installation section.

For usage examples, see the Usage Guide.

For detailed configuration options, see the Configuration Guide.


🔧 Supported Frameworks

Secure Headers is compatible with many popular Python web frameworks. Below are the integration guides for each supported framework, consolidated in the Frameworks Integration Guide:

Framework Documentation
aiohttp Integration Guide
Bottle Integration Guide
CherryPy Integration Guide
Django Integration Guide
Falcon Integration Guide
FastAPI Integration Guide
Flask Integration Guide
Masonite Integration Guide
Morepath Integration Guide
Pyramid Integration Guide
Quart Integration Guide
Responder Integration Guide
Sanic Integration Guide
Starlette Integration Guide
Tornado Integration Guide
TurboGears Integration Guide

If your framework is not listed here, Secure Headers can likely still be integrated. Refer to the Custom Framework Integration Guide for general integration tips.


🛡️ Security Headers

Secure Headers supports many critical HTTP security headers. Below is a list of headers you can configure, along with detailed documentation for each:

  • Cache-Control
    Configure caching behavior to protect sensitive content.

  • Content-Security-Policy
    Prevent XSS and data injection attacks by controlling allowed content sources.

  • Cross-Origin-Embedder-Policy
    Enhance cross-origin security by specifying cross-origin resource policies.

  • Cross-Origin-Opener-Policy
    Prevent attackers from accessing your global objects via cross-origin documents.

  • Custom Headers
    Define and manage custom HTTP headers for advanced configurations.

  • Permissions-Policy
    Control access to browser features such as geolocation, camera, and microphone.

  • Referrer-Policy
    Manage how much referrer information is shared during navigation.

  • Server
    Hide or customize the Server header to prevent exposing your server details.

  • Strict-Transport-Security (HSTS)
    Ensure that communication is only over HTTPS by enforcing strict transport security.

  • X-Content-Type-Options
    Prevent MIME-sniffing attacks by ensuring the browser follows the declared Content-Type.

  • X-Frame-Options
    Protect against clickjacking by controlling whether your content can be framed.


📚 Additional Resources


💬 Contributing

We welcome contributions! If you'd like to contribute or have any feedback, feel free to:

  • Open an Issue: Report bugs or request features.
  • Submit a Pull Request: Contribute code or documentation improvements.
  • Contact Us: Reach out via GitHub.