Last Updated: 2026-01-10 Status: Strategic Planning Author: Massimo Todaro / Claude
RISKCORE is a READ-ONLY risk aggregation platform. We never write back to source systems, never execute trades, and never modify client booking data. This fundamentally shapes our security posture:
What we ARE:
- A viewing and analytics platform
- A data processor (clients are data controllers)
- A read-only overlay on existing systems
What we are NOT:
- A trading platform (no risky actions can go through us)
- An order management system
- A data controller for position/trade data
This document covers authentication, authorization, data protection, GDPR compliance, and audit requirements.
- Core Security Principles
- Authentication
- Authorization & Role-Based Access Control
- Data Protection
- GDPR & Data Residency
- Audit Logging
- Export Controls
- API Security
- Infrastructure Security
- Incident Response
- Compliance Roadmap
- Future: Treasury Risk Module
Multiple layers of security:
┌─────────────────────────────────────────────────────────────┐
│ LAYER 1: NETWORK │
│ HTTPS everywhere, API rate limiting │
├─────────────────────────────────────────────────────────────┤
│ LAYER 2: AUTHENTICATION │
│ Supabase Auth, JWT tokens, 2FA (Enterprise) │
├─────────────────────────────────────────────────────────────┤
│ LAYER 3: AUTHORIZATION │
│ Row Level Security, Role-based permissions │
├─────────────────────────────────────────────────────────────┤
│ LAYER 4: DATA PROTECTION │
│ Encryption at rest, encryption in transit │
├─────────────────────────────────────────────────────────────┤
│ LAYER 5: AUDIT │
│ Sensitive action logging, immutable audit trail │
└─────────────────────────────────────────────────────────────┘
- Users get minimum permissions required for their role
- PMs see only their own book(s)
- Analysts see only assigned books
- No user can access another tenant's data
- RISKCORE never writes back to source systems
- We cannot modify booking system data
- No trade execution capability
- Risk mitigation: even if compromised, no financial damage to client portfolios
| Tier | Method | 2FA | SSO |
|---|---|---|---|
| Free | Email + Password | ❌ | ❌ |
| Pro | Email + Password | Optional | ❌ |
| Enterprise | Email + Password | ✅ Required | ✅ Available |
Provider: Supabase Auth
Features:
- JWT-based session management
- Secure password hashing (bcrypt)
- Email verification on signup
- Password reset flow
- Session expiry (configurable, default 7 days)
Availability: Enterprise tier only
Supported Methods:
- TOTP (Google Authenticator, Authy, etc.)
- SMS backup (optional)
Implementation: Supabase Auth MFA
-- User table extension for 2FA
ALTER TABLE users ADD COLUMN mfa_enabled BOOLEAN DEFAULT FALSE;
ALTER TABLE users ADD COLUMN mfa_secret TEXT; -- Encrypted TOTP secretStatus: Nice-to-have, Phase 2-3
Planned Support:
- SAML 2.0
- OAuth 2.0 / OpenID Connect
- Azure AD
- Okta
- Google Workspace
Implementation: Third-party provider (WorkOS, Auth0) or Supabase Enterprise
SUPERADMIN (RISKCORE Team)
│
└── ADMIN (Firm Admin)
│
├── CIO/CEO (All books, view-only)
│
├── CRO (All books, can set limits)
│
├── PM (Own book(s) only)
│
└── ANALYST (Assigned books, view-only)
| Action | SuperAdmin | Admin | CIO/CEO | CRO | PM | Analyst |
|---|---|---|---|---|---|---|
| View all tenants | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Create tenant | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Manage users | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| View all books | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
| View own book(s) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Set risk limits | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ |
| Override model inputs | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ |
| Export trades | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Export Riskboard | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
| Export correlation | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
| Export PM drill-down | ✅ | ✅ | ✅ | ✅ | Own only | ❌ |
| API access | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| Upload data | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| Configure integrations | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
Implementation: Supabase PostgreSQL RLS
-- Enable RLS on all tables
ALTER TABLE positions ENABLE ROW LEVEL SECURITY;
ALTER TABLE books ENABLE ROW LEVEL SECURITY;
ALTER TABLE users ENABLE ROW LEVEL SECURITY;
-- Tenant isolation policy
CREATE POLICY tenant_isolation ON positions
FOR ALL
USING (tenant_id = (SELECT tenant_id FROM users WHERE id = auth.uid()));
-- Book access policy
CREATE POLICY book_access ON positions
FOR SELECT
USING (
book_id IN (
SELECT book_id FROM user_book_access WHERE user_id = auth.uid()
)
OR
(SELECT role FROM users WHERE id = auth.uid()) IN ('admin', 'cio', 'cro')
);{
"sub": "user-uuid",
"email": "user@firm.com",
"tenant_id": "tenant-uuid",
"role": "pm",
"book_ids": ["book-1-uuid", "book-2-uuid"],
"plan": "pro",
"mfa_verified": true,
"exp": 1704931200
}| Layer | Method | Provider |
|---|---|---|
| In Transit | TLS 1.3 | Supabase / Cloudflare |
| At Rest | AES-256 | Supabase (PostgreSQL) |
| Backups | AES-256 | Supabase |
| Classification | Examples | Handling |
|---|---|---|
| Public | Marketing content | No restrictions |
| Internal | Aggregated analytics | Tenant-isolated |
| Confidential | Position data, risk metrics | RLS, encryption |
| Restricted | User credentials, API keys | Encrypted, never logged |
Policy: 5 years, not configurable
| Data Type | Retention |
|---|---|
| Position snapshots | 5 years |
| Trade history | 5 years |
| Risk metrics | 5 years |
| Audit logs | 5 years |
| User sessions | 30 days |
| Temporary files | 24 hours |
Rationale: Financial regulations typically require 5-7 year retention. Fixed policy simplifies compliance.
On account termination:
- User requests deletion via Admin
- 30-day grace period (recoverable)
- Permanent deletion after grace period
- Audit log retained (anonymized)
Note: Data may be retained longer if required by law (e.g., regulatory investigation).
Role: Data Processor
Why? RISKCORE processes data on behalf of clients (Data Controllers). We do not determine the purpose of data collection — clients do.
Client Role: Data Controller
Relationship:
Client (Hedge Fund) → Data Controller
↓ instructs
RISKCORE → Data Processor
↓ uses
Supabase → Sub-processor
| Data Type | Personal Data? | GDPR Applies? |
|---|---|---|
| Position data (ticker, quantity, price) | ❌ No | ❌ No |
| Trade records (symbol, size, execution) | ❌ No | ❌ No |
| Risk metrics (VaR, Greeks, exposures) | ❌ No | ❌ No |
| PM names | ✅ If identifiable | |
| User accounts (email, login) | ✅ Yes | ✅ Yes |
| Audit logs (who did what) | ✅ Yes | ✅ Yes |
Key Insight: Most RISKCORE data (positions, trades, risk metrics) is NOT personal data. GDPR primarily applies to user account data.
From research:
"GDPR does not mandate that data must physically reside within the European Union. However, it does heavily regulate any transfer of personal data to countries outside the EEA."
Legal Mechanisms for US Data Storage:
- EU-US Data Privacy Framework — Adequacy decision for certified US companies
- Standard Contractual Clauses (SCCs) — Contractual safeguards
- Binding Corporate Rules — For corporate groups
MVP / Pro Tier:
- US infrastructure (Supabase, AWS us-east)
- Adequate for most clients
- SCCs and DPA template provided
Enterprise Tier (Phase 2-3):
- EU region option (Supabase EU, AWS eu-west)
- Required for some European clients
- IP whitelisting available
Required for all clients processing EU data. Template includes:
- Nature and purpose of processing
- Types of personal data processed
- Duration of processing
- Sub-processors list (Supabase, etc.)
- Security measures
- Breach notification procedures
- Data subject rights procedures
Clients are responsible for:
- Lawful basis for collecting position/trade data
- Informing their employees (PMs, traders) about data processing
- Responding to data subject requests
- Notifying RISKCORE of any data subject requests
RISKCORE is responsible for:
- Processing data only as instructed by client
- Implementing appropriate security measures
- Assisting client with data subject requests
- Notifying client of data breaches within 72 hours
- Maintaining records of processing activities
- Providing DPA to all clients
Sensitive actions only (start simple, expand later)
Rationale: We are a viewing platform, not a trading platform. No risky actions can go through us. We focus on logging:
- Authentication events
- Authorization changes
- Data exports
- Configuration changes
- Limit breaches
| Category | Actions Logged |
|---|---|
| Authentication | Login success, login failure, logout, password change, 2FA enable/disable |
| Authorization | Role change, book access grant/revoke, user create/delete |
| Data Export | Any export (Riskboard, correlation, drill-down) |
| Configuration | Risk limit create/update/delete, integration add/remove, model override |
| Limit Events | Limit breach, limit clear |
| System | API key create/revoke, tenant create, plan change |
CREATE TABLE audit_logs (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
tenant_id UUID NOT NULL REFERENCES tenants(id),
user_id UUID REFERENCES users(id), -- NULL for system events
action VARCHAR(100) NOT NULL,
category VARCHAR(50) NOT NULL,
resource_type VARCHAR(50),
resource_id UUID,
details JSONB, -- Additional context
ip_address INET,
user_agent TEXT,
created_at TIMESTAMPTZ DEFAULT NOW()
);
-- Index for efficient querying
CREATE INDEX idx_audit_tenant_date ON audit_logs(tenant_id, created_at DESC);
CREATE INDEX idx_audit_user ON audit_logs(user_id, created_at DESC);
CREATE INDEX idx_audit_action ON audit_logs(action);{
"action": "USER_LOGIN_SUCCESS",
"category": "authentication",
"details": {
"method": "password",
"mfa_used": true
}
}
{
"action": "EXPORT_RISKBOARD",
"category": "data_export",
"resource_type": "riskboard",
"details": {
"format": "csv",
"books_included": ["book-1", "book-2"],
"as_of_date": "2026-01-10"
}
}
{
"action": "LIMIT_BREACH",
"category": "limit_events",
"resource_type": "risk_limit",
"resource_id": "limit-uuid",
"details": {
"limit_type": "hard",
"risk_factor": "equity_beta",
"limit_value": 5000000,
"actual_value": 5234000,
"breach_pct": 4.68
}
}- Retention: 5 years
- Storage: Immutable (append-only)
- Access: SuperAdmin and Admin (own tenant only)
- Export: SuperAdmin only
Potential future logging (not MVP):
- Page views / feature usage (for analytics)
- Search queries
- Correlation matrix views
- Every API call (for debugging)
| Export Type | SuperAdmin | Admin | CIO/CEO | CRO | PM | Analyst |
|---|---|---|---|---|---|---|
| Underlying Trades | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Riskboard (aggregated) | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
| Correlation Matrix | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
| PM Drill-down | ✅ | ✅ | ✅ | ✅ | Own book | ❌ |
Underlying Trades — SuperAdmin Only:
- Raw source data from client booking systems
- Most sensitive data in the platform
- Exporting could expose proprietary trading strategies
- Only RISKCORE team needs this for debugging/support
Riskboard — Admin, CIO, CRO:
- Aggregated exposure data
- CROs need to share risk reports with boards and regulators
- Already abstracted from individual trades
Correlation Matrix — Admin, CIO, CRO:
- Analytical output, not raw data
- Useful for board presentations
- No trade-level detail
PM Drill-down — CRO + PM (own book only):
- More sensitive than Riskboard (shows book-level detail)
- PMs should be able to export their own book's risk
- CRO needs access to all books for oversight
- Analysts can view but not export
| Format | Use Case |
|---|---|
| CSV | Spreadsheet analysis |
| Board reports, regulatory filings | |
| JSON | API consumers (Enterprise) |
All exports include:
- Timestamp
- User who exported
- Tenant name
- "Confidential — [Tenant Name]" watermark (PDF)
Availability: Admin role only
| Tier | API Access | Rate Limit |
|---|---|---|
| Free | ❌ | N/A |
| Pro | ✅ | 100 requests/minute |
| Enterprise | ✅ | 1000 requests/minute |
Method: API Key + JWT
# API request example
curl -X GET https://api.riskcore.io/v1/riskboard \
-H "Authorization: Bearer <jwt_token>" \
-H "X-API-Key: <api_key>"- Keys created/revoked by Admin
- Keys are hashed in database (never stored in plain text)
- Each key has:
- Name/description
- Expiry date (optional)
- Last used timestamp
- IP whitelist (Enterprise)
Implementation: FastAPI middleware
from slowapi import Limiter
from slowapi.util import get_remote_address
limiter = Limiter(key_func=get_remote_address)
@app.get("/v1/riskboard")
@limiter.limit("100/minute") # Pro tier
async def get_riskboard():
...Implementation: Pydantic models
- All inputs validated before processing
- SQL injection prevention via parameterized queries
- XSS prevention via output encoding
- File upload validation (type, size)
| Feature | Status |
|---|---|
| Row Level Security (RLS) | ✅ Enabled |
| SSL/TLS encryption | ✅ Default |
| Database encryption at rest | ✅ Default |
| Automatic backups | ✅ Daily |
| DDoS protection | ✅ Cloudflare |
| SOC 2 Type II | ✅ Supabase certified |
HTTPS Everywhere:
- All traffic encrypted via TLS 1.3
- HSTS enabled
- Certificate managed by Cloudflare/Vercel
Secrets Management:
- Environment variables for all secrets
- Never commit secrets to code
- Rotate API keys annually
- Use
.env.localfor development (gitignored)
Dependency Security:
- Dependabot enabled for vulnerability scanning
- Monthly dependency updates
- No known critical vulnerabilities policy
| Severity | Definition | Response Time |
|---|---|---|
| Critical | Data breach, system compromise | Immediate (< 1 hour) |
| High | Service outage, security vulnerability | < 4 hours |
| Medium | Performance degradation, minor bugs | < 24 hours |
| Low | Feature requests, minor issues | < 1 week |
- Detect: Automated monitoring or user report
- Contain: Isolate affected systems
- Assess: Determine scope and impact
- Notify:
- Internal team: Immediately
- Affected clients: Within 72 hours (GDPR requirement)
- Regulators: Within 72 hours if required
- Remediate: Fix vulnerability, restore systems
- Review: Post-incident analysis, update procedures
- Security issues: security@riskcore.io
- General support: support@riskcore.io
- Emergency (Enterprise): Dedicated Slack channel
| Requirement | Status |
|---|---|
| HTTPS everywhere | ✅ |
| RLS tenant isolation | ✅ |
| Input validation | ✅ |
| Audit logging (sensitive) | ✅ |
| Password security | ✅ |
| DPA template | ✅ |
| Requirement | Status |
|---|---|
| 2FA (Enterprise) | 🔄 Planned |
| SSO/SAML | 🔄 Planned |
| EU data residency option | 🔄 Planned |
| IP whitelisting | 🔄 Planned |
| SOC 2 Type II audit | 🔄 Planned |
| Requirement | Status |
|---|---|
| ISO 27001 certification | 🔄 Planned |
| Penetration testing | 🔄 Planned |
| Dedicated infrastructure (Enterprise) | 🔄 Planned |
| Custom data retention policies | 🔄 Planned |
Future module for capital risk, regulatory capital, and liquidity risk:
| Feature | Description |
|---|---|
| Basel III/IV | Capital adequacy calculations |
| RWA | Risk-Weighted Assets calculation |
| LCR | Liquidity Coverage Ratio |
| NSFR | Net Stable Funding Ratio |
| Leverage Ratio | Tier 1 capital / total exposure |
| Capital Buffers | CCB, CCyB, G-SIB buffers |
Treasury Risk module will require:
- Stricter access controls (regulatory data)
- Enhanced audit logging
- Regulatory reporting exports (restricted)
- Potential data residency requirements (jurisdiction-specific)
| Role | Permissions |
|---|---|
| Treasury | View treasury metrics, export regulatory reports |
| Compliance | View all risk, generate compliance reports |
| Regulator | Read-only access to specific reports (via secure portal) |
Placement: Bottom-right corner of dashboard
Style:
- Small, subtle, non-intrusive
- Light gray text on light background
- Does not obstruct any functionality
- Tasteful, professional
Implementation:
// Free tier only
{plan === 'free' && (
<div className="fixed bottom-4 right-4 text-xs text-gray-400 opacity-60">
Powered by RISKCORE
</div>
)}Removal: Upgrading to Pro tier removes the watermark.
- All secrets in environment variables
- RLS enabled on all tables
- Input validation on all endpoints
- Rate limiting configured
- HTTPS enforced
- Audit logging active
- Backup system tested
- DPA template ready
- Privacy policy published
- Security contact published
| Task | Frequency |
|---|---|
| Dependency updates | Monthly |
| Access review | Quarterly |
| Backup restoration test | Quarterly |
| Security training | Annually |
| Penetration test | Annually (Phase 2+) |
| SOC 2 audit | Annually (Phase 2+) |
| Version | Date | Author | Changes |
|---|---|---|---|
| 1.0 | 2026-01-10 | Claude | Initial version |
Security architecture for RISKCORE platform