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 Defense Layers
Layer 1: Network (CORS + HSTS + Rate Limiting)
Layer 2: Authentication (JWT + 2FA + Lockout)
Layer 3: Authorization (RBAC + Permissions)
Layer 4: Data (Tenant Isolation + Encryption)
Layer 5: Audit (Full Event Logging + Real-time)

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.

C#
// Development: Open CORS for local testing
policy.WithOrigins("http://localhost:3000", "https://localhost:3000")
      .AllowAnyMethod()
      .AllowAnyHeader()
      .AllowCredentials();

Rate Limiting Policies

PolicyLimitWindowResponseApplied To
DDoS Protection1000 req/min1 minute429 Too ManyGlobal
Per-IP Throttle100 req/min1 minute429 Too ManyPer client IP
Login Brute Force5 attempts15 minutes429 + Lockout/auth/login
Password Reset3 requests1 hour429 Too Many/auth/forgot-password
API Write Operations30 req/min1 minute429 Too ManyPOST/PUT/DELETE

Password Policies

RequirementMinimumDetails
Length8 charactersConfigurable via settings
Uppercase1 characterA-Z required
Lowercase1 charactera-z required
Digit1 digit0-9 required
Special Character1 character!@#$%^&* required
HashingBCryptCost factor 12 (default)