Security Architecture
Status: DRAFT Owner: Engineering Last Review: 2026-05-03 Applicable Standards: SOC 2 (CC6, CC7) / GDPR (Art. 32) / SEC (data protection)
1. Purpose
This document describes the security controls protecting the Equa platform — the technical mechanisms that safeguard user credentials, financial data, equity records, and organizational documents. It covers authentication, encryption, session management, network hardening, input validation, and infrastructure security.2. Scope
3. Authentication
For the full technical implementation, see Authentication and Permissions.3.1 Authentication Methods
The platform supports three authentication methods, all resulting in a server-side session stored in PostgreSQL.3.2 Two-Factor Authentication
Source:equa-server/modules/auth/src/two-factor.ts
3.3 Email Verification
Email verification is required before a user can log in. TheEmailVerifications entity stores a verification code linked to the user’s UUID.
Source: equa-server/modules/persistence/src/schema.ts (EmailVerifications entity)
3.4 Anti-Abuse Controls
4. Encryption
4.1 Current Implementation
Source:equa-server/modules/auth/src/lib/encryption.ts
Encrypted fields:
4.2 Password Hashing
4.3 Encryption Gaps
5. Session Management
Source:equa-server/modules/auth/src/sessions.ts
5.1 Session Storage Schema
Source:equa-server/modules/persistence/src/schema.ts (Sessions entity)
5.2 Session Cleanup
Source:equa-server/modules/auth/src/lib/session-cleaning.ts
A cron job periodically removes expired session records from the database based on the expires column.
6. Network and Infrastructure Security
6.1 Deployment
6.2 SSL/TLS
6.3 CORS
CORS is enabled via thevineyard-lawn middleware in equa-server/modules/api/src/server.ts. The specific allowed origins are configured at the application level.
6.4 Gateway HTTP Authentication and CORS
Source:equabot-gateway/src/gateway/auth.ts, equabot-gateway/src/gateway/channels-http.ts, equabot-gateway/src/gateway/config-http.ts, equabot-gateway/src/gateway/task-stack-http.ts
6.5 Security Headers Gap
6.6 Rate Limiting Gap
7. Input Validation
7.1 Backend Validation
Source:equa-server primarily uses class-validator decorators for backend request DTO validation. vineyard-lawn is used for endpoint wiring and request flow.
Validation for file names, URLs, phone numbers, and Ethereum addresses is also present in frontend validators (
equa-web/src/shared/helpers/field-validators.ts) and should not be treated as equivalent to backend enforcement without endpoint-specific confirmation.
7.2 Frontend Validation
Source:equa-web/src/shared/helpers/field-validators.ts
Frontend validation mirrors backend rules using the same validator library and custom regex patterns. React’s default JSX escaping provides baseline XSS protection.