amanah-auth-security

Implement Amanah authentication, sessions, RBAC, admin hardening, and sensitive-operation security.

SKILL.md

GitHub

Purpose

Prevent unauthorized access to private records and operational tools.

Scope

Email/phone verification, passwords, sessions, 2FA, biometrics architecture, rate limits, brute-force protection, RBAC, and logging.

Rules

Support USER, ADMIN, SUPER_ADMIN and future granular roles. Enforce ownership and permissions server-side. Require 2FA and verified email for admins.

Required patterns

Hash passwords with an approved adaptive algorithm; rotate/revoke sessions; step up authentication for sensitive actions; log security-relevant events.

Forbidden patterns

Never depend on frontend visibility as authorization, expose secrets, share sessions across user/admin surfaces, or log credentials.

Relevant modules

Auth, permissions, sessions, admin management, security settings, API middleware.

Testing

Test role/ownership denial, session expiry, brute-force controls, 2FA, escalation, and audit emission.

Definition of done

Unauthorized paths fail server-side with safe errors and significant security actions are auditable.