Security Overview
5-layer defense strategy, security features, CORS configuration, rate limiting, and password policies.
SCRIPE implements a defense-in-depth security strategy with five layers: network protection, authentication, authorization, data isolation, and audit logging. Every request passes through multiple security checks before reaching business logic.
Security Defense Layers
Security Features
JWT Authentication
Short-lived access tokens (15 min) with automatic refresh. HMAC-SHA256 signing with configurable secret.
Two-Factor Auth
TOTP-based 2FA with QR code setup. Optional per-user, enforceable per-tenant or globally.
RBAC Permissions
A complete PBAC enforcement engine executing Role-Based (RBAC), Group-Based (GBAC), and Attribute/Field-Based (ABAC) rules instantly via zero-latency server-side JWT caching.
Rate Limiting
4-tier rate limiting: global DDoS, per-IP, per-endpoint, and authentication-specific.
Audit Logging
Every action logged with who, what, when, where. Real-time SignalR broadcasting.
CORS Configuration
Strict origin validation in production. Open CORS for localhost in development.
CORS Configuration
CORS policies differ between development and production environments. In development, all localhost origins are allowed. In production, only explicitly configured origins are accepted.
// Development: Open CORS for local testing
policy.WithOrigins("http://localhost:3000", "https://localhost:3000")
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials();Rate Limiting Policies
| Policy | Limit | Window | Response | Applied To |
|---|---|---|---|---|
| DDoS Protection | 1000 req/min | 1 minute | 429 Too Many | Global |
| Per-IP Throttle | 100 req/min | 1 minute | 429 Too Many | Per client IP |
| Login Brute Force | 5 attempts | 15 minutes | 429 + Lockout | /auth/login |
| Password Reset | 3 requests | 1 hour | 429 Too Many | /auth/forgot-password |
| API Write Operations | 30 req/min | 1 minute | 429 Too Many | POST/PUT/DELETE |
Password Policies
| Requirement | Minimum | Details |
|---|---|---|
| Length | 8 characters | Configurable via settings |
| Uppercase | 1 character | A-Z required |
| Lowercase | 1 character | a-z required |
| Digit | 1 digit | 0-9 required |
| Special Character | 1 character | !@#$%^&* required |
| Hashing | BCrypt | Cost factor 12 (default) |