YeneSchool
Security & Compliance

Defense-in-Depth Security & Authentication Architecture

Comprehensive overview of YeneSchool's security posture — JWT with Redis revocation, 10-role RBAC authorization hierarchy, and rate limiting.

Defense-in-Depth Security & Authentication Architecture

Educational management systems protect highly sensitive minor personal data, continuous academic evaluations, and financial ledgers. YeneSchool enforces a comprehensive Defense-in-Depth security architecture across network, transport, application, and database persistence layers.


1. Authentication & Token Lifecycle

YeneSchool implements modern Dual-Token Authentication designed for both responsive web sessions and offline-capable mobile clients:

  1. Short-Lived Access Tokens (JWT):
    • Cryptographically signed with HMAC-SHA256 or RSA.
    • 15-minute Time-To-Live (TTL).
    • Contains minimal user identity claims (sub, schoolId, role, branchId).
  2. Long-Lived Refresh Tokens:
    • 7-day expiration with sliding rotation.
    • Stored securely in HttpOnly, SameSite=Lax, Secure cookies on web, or OS-level Keychain / Android Keystore on mobile.
  3. Instant Logout & Token Revocation:
    • Unlike naive JWT implementations where stolen tokens remain valid until expiration, YeneSchool maintains a high-speed Redis blacklist.
    • When a user logs out or changes their password, their JWT token ID (jti) is immediately blacklisted in Redis for its remaining lifetime. Subsequent requests with that token are instantly rejected with HTTP 401 Unauthorized.

2. 10-Role RBAC Authorization Matrix

Permissions are governed by NestJS @Roles() decorators and custom guard middleware:

RoleAccess ScopeStrict Boundary Restrictions
SUPER_ADMINPlatform-wideManages school tenants, plans, and system health; cannot view private student grades.
SCHOOL_OWNERMulti-branch executiveExecutive analytics, consolidated financial reports, and campus allocations.
DIRECTORInstitutional campusMaster timetables, teacher assessments, siren triggers, and student risk flags.
SUPERVISORAcademic departmentLesson plan approvals, pedagogical rubrics, and curriculum pacing reviews.
REGISTRARStudent admissionsStudent enrollments, CSV bulk imports, ID cards, and report card publishing.
TEACHERAssigned classesMarks entry and attendance marking strictly restricted to subjects and classes taught.
STUDENTIndividual studentRead-only access to own timetable, grades, CBT exams, and learning materials.
PARENTVerified childrenAttendance alerts and fee clearance strictly scoped to verified biological/legal children.
FINANCEInstitutional ledgerFee structures, payment recording, receipts, and payroll; zero access to academic tests.
STOREKEEPERInventory warehouseAsset tracking, stock transactions, bookstore orders, and uniform sales.

3. Rate Limiting & Brute-Force Defense

Sensitive endpoints are protected against automated brute-force attacks via Redis sliding-window limiters:

  • Authentication (/api/auth/login): Max 5 failed attempts per IP / username pair per 15-minute window before exponential lockouts.
  • AI Assistant Queries: Enforced per-tier hourly token quotas to prevent denial-of-wallet exhaustion.
  • Bulk Exports: Rate-limited to prevent bandwidth saturation and unauthorized data scraping.
Copyright © 2026 YeneSchool · All rights reserved.