Skip to main content

Security

What the plugin does for you​

  • Default deny inside the protected scope. Endpoints without a matching rule are reachable only by super admins. The guard runs for every request, even on endpoints that carry their own [Authorize].
  • Login protection: per-IP rate limit plus per-user lockout. Unknown users and wrong passwords get the same message and similar timing. returnUrl must be local. Logout is POST with an antiforgery token.
  • Sessions: HttpOnly cookie with no permissions inside. Password change, deactivation and "force logout" rotate the user's security stamp. Old sessions end on the next request, and open Blazor circuits at the next revalidation.
  • Seeding: the first admin password is never written to the log. Log files and aggregators keep it forever.
  • Server-side safety rules, not only hidden buttons:
    • you cannot delete or deactivate yourself;
    • the last active super admin cannot be removed;
    • only super admins can change super-admin users or roles, or grant the super-admin flag;
    • non-super-admins can grant only permissions they hold themselves (no privilege escalation);
    • only super admins (or holders of *) can create or change permissions and their URL rules;
    • system roles and permissions cannot be deleted.
  • Menu URLs accept only app paths or http(s) URLs, so javascript: links are rejected. Sidebar search uses the already filtered menu.
  • Operation log masks secrets recursively in form and JSON bodies.

Production checklist​

  • Auth:CookieSecurePolicy = Always and HTTPS only.
  • Admin password from user-secrets, environment or a vault. Never commit it.
  • Behind a proxy: configure ForwardedHeaders so the rate limit and the log see the real client IP.
  • Web farm: share the ASP.NET Core Data Protection keys (otherwise cookies are invalid across instances) and keep Cache:VersionCheckSeconds > 0.
  • Review Routes for endpoints marked super admin only that should be granted, and for public ones that should not be.

Upgrading from 0.1.x​

danger

0.1.x wrote the generated admin password to the application log. If you ran 0.1.x without Seed:AdminPassword, change that admin password and remove the line from stored logs. See the Changelog.