Security Architecture

SoarTime Pro Phase 1 — Data Isolation, Role-Based Access, Audit Logging, and Retention Lifecycle for Highly Sensitive staff information.

Phase 1 — Implemented

Data Isolation

SSN, EIN, bank account, and routing numbers are stored in a dedicated UserSensitiveProfile entity, completely separate from User and StaffProfile.

Non-sensitive display surrogates (ssn_last4, bank_account_last4, bank_name_display) are the only values returned to the UI by default.

Plaintext HS fields never appear in any default API response — they require an explicit, audited reveal request that passes role and re-authentication checks server-side.

Role-Based Access Matrix

All checks are enforced server-side. Bypassing the UI (direct API calls) does not bypass the role matrix.

RoleView Last4Reveal PlaintextEdit HS Fields
STAFF (self)
STAFF (other)
COORDINATOR
SCHEDULER
PROGRAM MANAGER
HR
FINANCE
ADMIN
SUPER ADMIN

Phase 1 policy: only the user themselves can reveal their own plaintext. All privileged-role reveals are deferred to Phase 2 with break-glass tooling and stronger re-auth controls.

Re-Authentication

All reveal and edit operations require the user to confirm their account password before any plaintext is returned or written.

After a successful reveal, the plaintext is visible for 30 seconds then automatically masked — no manual dismiss required.

Phase 2 ticket P2-SEC-005: Replace with a dedicated credential-verify endpoint (no new session token issued), brute-force rate limiting, and biometric challenge option on mobile.

Audit Logging

Every sensitive action writes an immutable row to SensitiveAccessAuditLog containing actor, target, agency, field name, IP, device, timestamp, and success/failure. Values are never logged.

READ_MASKEDREVEAL_PLAINTEXTWRITEEXPORTTRANSFERTERMINATIONPURGE

Cross-Agency Profile Portability

Transfers are initiated only from the user's own account — never admin-initiated. SSN and bank consents are separate full-screen steps.

A signed CrossAgencyImportConsent record with per-field flags, IP, device, timestamp, and signature text is created before any data moves.

HS fields are re-written under a fresh destination row — never reference-shared across agencies. Source agency is logged on every export event.

Retention & Purge Schedule

ClassRetentionNote
PAYROLL_TAX_RECORDS7 yrsIRS / DOL requirement
EMPLOYMENT_RECORDS5 yrsState labor law
OPERATIONAL_RECORDS2 yrsClock-in, geofence, daily tracker
SENSITIVE_PROFILE (HS plaintext)4 yrsSSN / EIN / bank — purge on schedule

Purge runs daily at 2 AM ET via a scheduled job. HS _value fields are set to null; _last4 surrogates and bank_name_display are retained for tax / audit compliance. Each purge writes an immutable PURGE audit row.

Phase 2 — Infrastructure Hardening (Deferred)

The following items require external infrastructure not available in Phase 1. Each is documented in SECURITY.md and tracked as Phase 2 tickets.

P2-SEC-001

AES-256-GCM field-level encryption

Requires external KMS

P2-SEC-002

DEK/KEK envelope encryption + rotation

Depends on P2-SEC-001

P2-SEC-003

Cryptographic tokenization (vault-issued tokens)

Replace ssn_value storage

P2-SEC-004

Tamper-proof signed audit logs

HMAC-signed / hash-chained entries

P2-SEC-005

True re-auth challenge endpoint

No-token credential verify; brute-force protection

P2-SEC-006

Server-side rate limiting on reveal endpoints

Redis-backed sliding window; anomaly alerting

P2-SEC-007

HR / Admin / SuperAdmin break-glass reveal

Requires P2-SEC-005 + documented reason workflow

P2-SEC-008

Biometric challenge (mobile)

Device / OS layer

P2-SEC-009

Cryptographic erasure on purge

DEK destruction via KMS

P2-SEC-010

Operational record bulk purge (2-year)

StaffLocationPing, ClockEvent, etc.

P2-SEC-011

Source agency export notification

Email / webhook to agency admin on cross-agency transfer

P2-SEC-012

Automated W-2/1099 workflow on termination

Tax document preparation integration

SoarTime Pro Security Architecture — Phase 1 · Last updated June 2026