Skip to Content
Security & ComplianceSecurity Architecture

Security Architecture

Network Architecture

┌─────────────────────────────────────────────────────────────────────────┐ │ CUSTOMER NETWORK │ │ │ │ ┌─────────────────┐ ┌────────────────────────────────────┐ │ │ │ Active │ │ AD Connector │ │ │ │ Directory │◄── LDAPS ─►│ ┌─────────────────────────────┐ │ │ │ │ │ (636) │ │ • mTLS Client Cert │ │ │ │ │ • Users │ │ │ • RSA Key for Passwords │ │ │ │ │ • Groups │ │ │ • Config Encryption │ │ │ │ │ • Policies │ │ └─────────────────────────────┘ │ │ │ └─────────────────┘ └───────────────┬────────────────────┘ │ │ │ │ │ │ WSS/443 (Outbound) │ │ │ mTLS │ └─────────────────────────────────────────────────┼────────────────────────┘ ┌─────────────────────────────────────────────────┼────────────────────────┐ │ AD UNLOCK CLOUD ▼ │ │ │ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────────┐ │ │ │ WhatsApp │────►│ API │────►│ Connector Gateway │ │ │ │ (Z-API) │ │ (FastAPI) │ │ (WebSocket + mTLS) │ │ │ └──────────────┘ └──────┬───────┘ └──────────────────────────┘ │ │ │ │ │ ┌──────────────┐ ┌──────▼───────┐ ┌──────────────────────────┐ │ │ │ Email │◄────│ PostgreSQL │────►│ Redis │ │ │ │ (Password) │ │ (RLS) │ │ (Streams) │ │ │ └──────────────┘ └──────────────┘ └──────────────────────────┘ │ │ │ └──────────────────────────────────────────────────────────────────────────┘

Authentication Flow

Admin Portal

  1. User clicks “Sign In”
  2. Redirected to Azure AD / Google
  3. OAuth2 authorization code flow
  4. JWT tokens stored securely
  5. API calls include Bearer token

Connector

  1. Connector loads client certificate
  2. Establishes WebSocket with mTLS
  3. Gateway validates certificate chain
  4. Extracts tenant_id and connector_id from CN
  5. Maintains authenticated session

WhatsApp User

  1. User sends message
  2. Webhook validates secret
  3. System looks up user by phone
  4. OTP sent to registered email
  5. User verifies with OTP code

Data Flow

Account Unlock

1. User: "unlock my account" via WhatsApp 2. API: Classify intent (Claude AI) 3. API: Lookup user by phone number 4. API: Generate OTP, send to email 5. User: Reply with OTP 6. API: Verify OTP, calculate risk score 7. API: Check policies 8. API: Create unlock job 9. Gateway: Route to connector 10. Connector: Execute LDAP unlock 11. Connector: Return result 12. API: Notify user via WhatsApp 13. API: Create audit log entry

Password Reset

1-8. Same as unlock 9. Gateway: Route to connector 10. Connector: Generate secure password 11. Connector: Encrypt with API's public key 12. Connector: Execute LDAP password change 13. Connector: Return encrypted password 14. API: Decrypt password 15. API: Send password via EMAIL (not WhatsApp) 16. API: Notify user to check email 17. API: Securely delete password from memory 18. API: Create audit log entry

Encryption

In Transit

ConnectionProtocol
Admin Portal → APITLS 1.3
WhatsApp → APITLS 1.3
Connector → GatewayTLS 1.3 + mTLS
Connector → ADLDAPS (TLS 1.2+)

At Rest

DataEncryption
DatabaseAES-256 (transparent)
SecretsAWS Secrets Manager
PasswordsNever stored
Audit LogsImmutable, checksummed

Password Handling

  1. Generated on connector (customer network)
  2. Encrypted with RSA-OAEP (2048-bit)
  3. Transmitted encrypted
  4. Decrypted only for email
  5. Immediately zeroed from memory
  6. Never logged or stored
Last updated on