Search the archive

14,355 indexed articles, 13,283 of them summarised by us.

Articles
14,355
Research papers
91,965
Models priced
2,249
Providers
163

1 results for “Strict-Transport-Security”

Newest and most relevant first

Define HTTP security headers once, apply them across Python web apps

Python developers can now manage security headers through one dependency-free library instead of scattering configuration across middleware and handlers.

A free, open-source Python library called 'secure' helps web developers keep their websites safer with less hassle. Websites use hidden labels, called HTTP security headers, that tell browsers to block attacks like clickjacking. Usually developers sprinkle these settings across many code files, so it's easy to miss one. This tool stores all the settings in one place and applies them across popular Python frameworks, offering ready-made presets named BASIC, BALANCED, and STRICT.

Teams maintaining multiple Python web services often lose track of which layer sets which security header, creating audit and risk blind spots. The open-source 'secure' library consolidates that configuration into a single policy object applied via ASGI or WSGI middleware. It has zero dependencies, reducing audit surface, and its defaults follow MDN and OWASP guidance. The trade-off: presets still need per-application review, especially Content Security Policy.

The 'secure' library (github.com/typeerror/secure) exposes a single Secure policy object applied through ASGI middleware, WSGI middleware, or response hooks, with both set_headers and set_headers_async methods. Secure.with_default_headers() yields a BALANCED preset covering COOP, CORP, CSP, HSTS, Permissions-Policy, Referrer-Policy, X-Content-Type-Options and X-Frame-Options; Preset.BASIC and Preset.STRICT are also available. Duplicate handling, overwrites, and validation are explicit, and the dependency count is zero. The README warns defaults are a starting point, not a substitute for application-specific review.

GitHub Opensource Projects →