Umbral Security
Official by Umbral contributorsCSRF, HSTS, secure headers, template escaping
About
The security features you forget to add are the ones that bite you. Umbral Security ships them on by default — CSRF protection on every POST, HSTS, clickjacking headers, and template auto-escaping — so a fresh app is hardened before you write a line of security code. When a default is genuinely too tight (a JSON API that authenticates by bearer token, say), the escape hatches are explicit and narrow, not a global off switch.
Install
Wire it up
The defaults need no configuration — just mount it.
use *;
use SecurityPlugin;
let app = builder
.database
.plugin
.build?;
Target: exempt a token-authed API from CSRF
CSRF protects cookie-authenticated form posts; a bearer-token API doesn't need it. Exempt the prefix without weakening the rest of the site.
use ;
with_config
.with_hsts;
What you get
- Double-submit CSRF token enforced on every POST
- HSTS + a full set of secure response headers
- Clickjacking protection (X-Frame-Options / frame-ancestors)
- Template output auto-escaped by default; opt out explicitly
- Per-path escape hatches instead of a global kill switch
Usage
Mount `SecurityPlugin::new()` for hardened defaults, or `SecurityPlugin::with_config(...)` to narrow a single default — e.g. `csrf_exempt_paths` for a bearer-token API. Exemptions are per-path, never a global off switch.
cargo add umbral-security
Feature tracker
Per-feature shipping status, recorded in the directory.
Signed double-submit token enforced on unsafe methods.
csrf_token and hidden input helpers are injected into templates.
Strict-Transport-Security and modern security headers.
X-Frame-Options and frame-ancestors headers.
Output escaped by default; opt out explicitly.
One preset flips HSTS, secure CSRF cookies, and stricter headers.
Optional request body cap for DoS hardening.
Compatibility
Declared support per Umbral version and database backend.
No compatibility rows declared yet.
Community notes
0 notes in the discussion thread.
No notes yet. Be the first to share how this plugin works for you.
Reported issues
Bugs and abuse reports filed against this plugin.
No open issues
No issues have been reported against this plugin. Track upstream bugs on the maintainer's tracker, or report a directory problem to the Umbral team.