2025-12-11 21:50:42 +00:00
|
|
|
# ADR-009: Complete Security System Implementation
|
|
|
|
|
|
|
|
|
|
**Status**: Implemented
|
|
|
|
|
**Date**: 2025-10-08
|
|
|
|
|
**Decision Makers**: Architecture Team
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Context
|
|
|
|
|
|
2026-01-12 04:42:18 +00:00
|
|
|
The Provisioning platform required a comprehensive, enterprise-grade security system covering authentication, authorization, secrets management, MFA,
|
|
|
|
|
compliance, and emergency access. The system needed to be production-ready, scalable, and compliant with GDPR, SOC2, and ISO 27001.
|
2025-12-11 21:50:42 +00:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Decision
|
|
|
|
|
|
2026-01-08 09:55:37 +00:00
|
|
|
Implement a complete security architecture using 12 specialized components organized in 4 implementation groups.
|
2025-12-11 21:50:42 +00:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Implementation Summary
|
|
|
|
|
|
|
|
|
|
### Total Implementation
|
|
|
|
|
|
|
|
|
|
- **39,699 lines** of production-ready code
|
|
|
|
|
- **136 files** created/modified
|
|
|
|
|
- **350+ tests** implemented
|
|
|
|
|
- **83+ REST endpoints** available
|
|
|
|
|
- **111+ CLI commands** ready
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Architecture Components
|
|
|
|
|
|
|
|
|
|
### Group 1: Foundation (13,485 lines)
|
|
|
|
|
|
|
|
|
|
#### 1. JWT Authentication (1,626 lines)
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
**Location**: `provisioning/platform/control-center/src/auth/`
|
|
|
|
|
|
|
|
|
|
**Features**:
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- RS256 asymmetric signing
|
2026-01-08 09:55:37 +00:00
|
|
|
- Access tokens (15 min) + refresh tokens (7 d)
|
2025-12-11 21:50:42 +00:00
|
|
|
- Token rotation and revocation
|
|
|
|
|
- Argon2id password hashing
|
|
|
|
|
- 5 user roles (Admin, Developer, Operator, Viewer, Auditor)
|
|
|
|
|
- Thread-safe blacklist
|
|
|
|
|
|
|
|
|
|
**API**: 6 endpoints
|
|
|
|
|
**CLI**: 8 commands
|
|
|
|
|
**Tests**: 30+
|
|
|
|
|
|
|
|
|
|
#### 2. Cedar Authorization (5,117 lines)
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
**Location**: `provisioning/config/cedar-policies/`, `provisioning/platform/orchestrator/src/security/`
|
|
|
|
|
|
|
|
|
|
**Features**:
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- Cedar policy engine integration
|
|
|
|
|
- 4 policy files (schema, production, development, admin)
|
|
|
|
|
- Context-aware authorization (MFA, IP, time windows)
|
|
|
|
|
- Hot reload without restart
|
|
|
|
|
- Policy validation
|
|
|
|
|
|
|
|
|
|
**API**: 4 endpoints
|
|
|
|
|
**CLI**: 6 commands
|
|
|
|
|
**Tests**: 30+
|
|
|
|
|
|
|
|
|
|
#### 3. Audit Logging (3,434 lines)
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
**Location**: `provisioning/platform/orchestrator/src/audit/`
|
|
|
|
|
|
|
|
|
|
**Features**:
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- Structured JSON logging
|
|
|
|
|
- 40+ action types
|
|
|
|
|
- GDPR compliance (PII anonymization)
|
|
|
|
|
- 5 export formats (JSON, CSV, Splunk, ECS, JSON Lines)
|
|
|
|
|
- Query API with advanced filtering
|
|
|
|
|
|
|
|
|
|
**API**: 7 endpoints
|
|
|
|
|
**CLI**: 8 commands
|
|
|
|
|
**Tests**: 25
|
|
|
|
|
|
|
|
|
|
#### 4. Config Encryption (3,308 lines)
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
**Location**: `provisioning/core/nulib/lib_provisioning/config/encryption.nu`
|
|
|
|
|
|
|
|
|
|
**Features**:
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- SOPS integration
|
|
|
|
|
- 4 KMS backends (Age, AWS KMS, Vault, Cosmian)
|
|
|
|
|
- Transparent encryption/decryption
|
|
|
|
|
- Memory-only decryption
|
|
|
|
|
- Auto-detection
|
|
|
|
|
|
|
|
|
|
**CLI**: 10 commands
|
|
|
|
|
**Tests**: 7
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
### Group 2: KMS Integration (9,331 lines)
|
|
|
|
|
|
|
|
|
|
#### 5. KMS Service (2,483 lines)
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
**Location**: `provisioning/platform/kms-service/`
|
|
|
|
|
|
|
|
|
|
**Features**:
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- HashiCorp Vault (Transit engine)
|
|
|
|
|
- AWS KMS (Direct + envelope encryption)
|
|
|
|
|
- Context-based encryption (AAD)
|
|
|
|
|
- Key rotation support
|
|
|
|
|
- Multi-region support
|
|
|
|
|
|
|
|
|
|
**API**: 8 endpoints
|
|
|
|
|
**CLI**: 15 commands
|
|
|
|
|
**Tests**: 20
|
|
|
|
|
|
|
|
|
|
#### 6. Dynamic Secrets (4,141 lines)
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
**Location**: `provisioning/platform/orchestrator/src/secrets/`
|
|
|
|
|
|
|
|
|
|
**Features**:
|
2026-01-08 09:55:37 +00:00
|
|
|
|
|
|
|
|
- AWS STS temporary credentials (15 min-12 h)
|
2025-12-11 21:50:42 +00:00
|
|
|
- SSH key pair generation (Ed25519)
|
|
|
|
|
- UpCloud API subaccounts
|
|
|
|
|
- TTL manager with auto-cleanup
|
|
|
|
|
- Vault dynamic secrets integration
|
|
|
|
|
|
|
|
|
|
**API**: 7 endpoints
|
|
|
|
|
**CLI**: 10 commands
|
|
|
|
|
**Tests**: 15
|
|
|
|
|
|
|
|
|
|
#### 7. SSH Temporal Keys (2,707 lines)
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
**Location**: `provisioning/platform/orchestrator/src/ssh/`
|
|
|
|
|
|
|
|
|
|
**Features**:
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- Ed25519 key generation
|
|
|
|
|
- Vault OTP (one-time passwords)
|
|
|
|
|
- Vault CA (certificate authority signing)
|
|
|
|
|
- Auto-deployment to authorized_keys
|
2026-01-08 09:55:37 +00:00
|
|
|
- Background cleanup every 5 min
|
2025-12-11 21:50:42 +00:00
|
|
|
|
|
|
|
|
**API**: 7 endpoints
|
|
|
|
|
**CLI**: 10 commands
|
|
|
|
|
**Tests**: 31
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
### Group 3: Security Features (8,948 lines)
|
|
|
|
|
|
|
|
|
|
#### 8. MFA Implementation (3,229 lines)
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
**Location**: `provisioning/platform/control-center/src/mfa/`
|
|
|
|
|
|
|
|
|
|
**Features**:
|
2026-01-08 09:55:37 +00:00
|
|
|
|
|
|
|
|
- TOTP (RFC 6238, 6-digit codes, 30 s window)
|
2025-12-11 21:50:42 +00:00
|
|
|
- WebAuthn/FIDO2 (YubiKey, Touch ID, Windows Hello)
|
|
|
|
|
- QR code generation
|
|
|
|
|
- 10 backup codes per user
|
|
|
|
|
- Multiple devices per user
|
2026-01-08 09:55:37 +00:00
|
|
|
- Rate limiting (5 attempts/5 min)
|
2025-12-11 21:50:42 +00:00
|
|
|
|
|
|
|
|
**API**: 13 endpoints
|
|
|
|
|
**CLI**: 15 commands
|
|
|
|
|
**Tests**: 85+
|
|
|
|
|
|
|
|
|
|
#### 9. Orchestrator Auth Flow (2,540 lines)
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
**Location**: `provisioning/platform/orchestrator/src/middleware/`
|
|
|
|
|
|
|
|
|
|
**Features**:
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- Complete middleware chain (5 layers)
|
|
|
|
|
- Security context builder
|
|
|
|
|
- Rate limiting (100 req/min per IP)
|
|
|
|
|
- JWT authentication middleware
|
|
|
|
|
- MFA verification middleware
|
|
|
|
|
- Cedar authorization middleware
|
|
|
|
|
- Audit logging middleware
|
|
|
|
|
|
|
|
|
|
**Tests**: 53
|
|
|
|
|
|
|
|
|
|
#### 10. Control Center UI (3,179 lines)
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
**Location**: `provisioning/platform/control-center/web/`
|
|
|
|
|
|
|
|
|
|
**Features**:
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- React/TypeScript UI
|
|
|
|
|
- Login with MFA (2-step flow)
|
|
|
|
|
- MFA setup (TOTP + WebAuthn wizards)
|
|
|
|
|
- Device management
|
|
|
|
|
- Audit log viewer with filtering
|
|
|
|
|
- API token management
|
|
|
|
|
- Security settings dashboard
|
|
|
|
|
|
|
|
|
|
**Components**: 12 React components
|
|
|
|
|
**API Integration**: 17 methods
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
### Group 4: Advanced Features (7,935 lines)
|
|
|
|
|
|
|
|
|
|
#### 11. Break-Glass Emergency Access (3,840 lines)
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
**Location**: `provisioning/platform/orchestrator/src/break_glass/`
|
|
|
|
|
|
|
|
|
|
**Features**:
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- Multi-party approval (2+ approvers, different teams)
|
2026-01-08 09:55:37 +00:00
|
|
|
- Emergency JWT tokens (4 h max, special claims)
|
2025-12-11 21:50:42 +00:00
|
|
|
- Auto-revocation (expiration + inactivity)
|
|
|
|
|
- Enhanced audit (7-year retention)
|
|
|
|
|
- Real-time alerts
|
|
|
|
|
- Background monitoring
|
|
|
|
|
|
|
|
|
|
**API**: 12 endpoints
|
|
|
|
|
**CLI**: 10 commands
|
|
|
|
|
**Tests**: 985 lines (unit + integration)
|
|
|
|
|
|
|
|
|
|
#### 12. Compliance (4,095 lines)
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
**Location**: `provisioning/platform/orchestrator/src/compliance/`
|
|
|
|
|
|
|
|
|
|
**Features**:
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- **GDPR**: Data export, deletion, rectification, portability, objection
|
|
|
|
|
- **SOC2**: 9 Trust Service Criteria verification
|
|
|
|
|
- **ISO 27001**: 14 Annex A control families
|
|
|
|
|
- **Incident Response**: Complete lifecycle management
|
|
|
|
|
- **Data Protection**: 4-level classification, encryption controls
|
|
|
|
|
- **Access Control**: RBAC matrix with role verification
|
|
|
|
|
|
|
|
|
|
**API**: 35 endpoints
|
|
|
|
|
**CLI**: 23 commands
|
|
|
|
|
**Tests**: 11
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Security Architecture Flow
|
|
|
|
|
|
|
|
|
|
### End-to-End Request Flow
|
|
|
|
|
|
2026-01-08 09:55:37 +00:00
|
|
|
```plaintext
|
2025-12-11 21:50:42 +00:00
|
|
|
1. User Request
|
|
|
|
|
↓
|
|
|
|
|
2. Rate Limiting (100 req/min per IP)
|
|
|
|
|
↓
|
2026-01-08 09:55:37 +00:00
|
|
|
3. JWT Authentication (RS256, 15 min tokens)
|
2025-12-11 21:50:42 +00:00
|
|
|
↓
|
|
|
|
|
4. MFA Verification (TOTP/WebAuthn for sensitive ops)
|
|
|
|
|
↓
|
|
|
|
|
5. Cedar Authorization (context-aware policies)
|
|
|
|
|
↓
|
|
|
|
|
6. Dynamic Secrets (AWS STS, SSH keys, 1h TTL)
|
|
|
|
|
↓
|
|
|
|
|
7. Operation Execution (encrypted configs, KMS)
|
|
|
|
|
↓
|
|
|
|
|
8. Audit Logging (structured JSON, GDPR-compliant)
|
|
|
|
|
↓
|
|
|
|
|
9. Response
|
2026-01-12 04:42:18 +00:00
|
|
|
```
|
2025-12-11 21:50:42 +00:00
|
|
|
|
|
|
|
|
### Emergency Access Flow
|
|
|
|
|
|
2026-01-08 09:55:37 +00:00
|
|
|
```plaintext
|
2025-12-11 21:50:42 +00:00
|
|
|
1. Emergency Request (reason + justification)
|
|
|
|
|
↓
|
|
|
|
|
2. Multi-Party Approval (2+ approvers, different teams)
|
|
|
|
|
↓
|
|
|
|
|
3. Session Activation (special JWT, 4h max)
|
|
|
|
|
↓
|
|
|
|
|
4. Enhanced Audit (7-year retention, immutable)
|
|
|
|
|
↓
|
|
|
|
|
5. Auto-Revocation (expiration/inactivity)
|
2026-01-12 04:42:18 +00:00
|
|
|
```
|
2025-12-11 21:50:42 +00:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Technology Stack
|
|
|
|
|
|
|
|
|
|
### Backend (Rust)
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- **axum**: HTTP framework
|
|
|
|
|
- **jsonwebtoken**: JWT handling (RS256)
|
|
|
|
|
- **cedar-policy**: Authorization engine
|
|
|
|
|
- **totp-rs**: TOTP implementation
|
|
|
|
|
- **webauthn-rs**: WebAuthn/FIDO2
|
|
|
|
|
- **aws-sdk-kms**: AWS KMS integration
|
|
|
|
|
- **argon2**: Password hashing
|
|
|
|
|
- **tracing**: Structured logging
|
|
|
|
|
|
|
|
|
|
### Frontend (TypeScript/React)
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- **React 18**: UI framework
|
|
|
|
|
- **Leptos**: Rust WASM framework
|
|
|
|
|
- **@simplewebauthn/browser**: WebAuthn client
|
|
|
|
|
- **qrcode.react**: QR code generation
|
|
|
|
|
|
|
|
|
|
### CLI (Nushell)
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- **Nushell 0.107**: Shell and scripting
|
|
|
|
|
- **nu_plugin_kcl**: KCL integration
|
|
|
|
|
|
|
|
|
|
### Infrastructure
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- **HashiCorp Vault**: Secrets management, KMS, SSH CA
|
|
|
|
|
- **AWS KMS**: Key management service
|
|
|
|
|
- **PostgreSQL/SurrealDB**: Data storage
|
|
|
|
|
- **SOPS**: Config encryption
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Security Guarantees
|
|
|
|
|
|
|
|
|
|
### Authentication
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
✅ RS256 asymmetric signing (no shared secrets)
|
2026-01-08 09:55:37 +00:00
|
|
|
✅ Short-lived access tokens (15 min)
|
2025-12-11 21:50:42 +00:00
|
|
|
✅ Token revocation support
|
|
|
|
|
✅ Argon2id password hashing (memory-hard)
|
|
|
|
|
✅ MFA enforced for production operations
|
|
|
|
|
|
|
|
|
|
### Authorization
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
✅ Fine-grained permissions (Cedar policies)
|
|
|
|
|
✅ Context-aware (MFA, IP, time windows)
|
|
|
|
|
✅ Hot reload policies (no downtime)
|
|
|
|
|
✅ Deny by default
|
|
|
|
|
|
|
|
|
|
### Secrets Management
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
✅ No static credentials stored
|
|
|
|
|
✅ Time-limited secrets (1h default)
|
|
|
|
|
✅ Auto-revocation on expiry
|
|
|
|
|
✅ Encryption at rest (KMS)
|
|
|
|
|
✅ Memory-only decryption
|
|
|
|
|
|
|
|
|
|
### Audit & Compliance
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
✅ Immutable audit logs
|
|
|
|
|
✅ GDPR-compliant (PII anonymization)
|
|
|
|
|
✅ SOC2 controls implemented
|
|
|
|
|
✅ ISO 27001 controls verified
|
|
|
|
|
✅ 7-year retention for break-glass
|
|
|
|
|
|
|
|
|
|
### Emergency Access
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
✅ Multi-party approval required
|
|
|
|
|
✅ Time-limited sessions (4h max)
|
|
|
|
|
✅ Enhanced audit logging
|
|
|
|
|
✅ Auto-revocation
|
|
|
|
|
✅ Cannot be disabled
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Performance Characteristics
|
|
|
|
|
|
|
|
|
|
| Component | Latency | Throughput | Memory |
|
2026-01-12 04:42:18 +00:00
|
|
|
| ----------- | --------- | ------------ | -------- |
|
2026-01-08 09:55:37 +00:00
|
|
|
| JWT Auth | <5 ms | 10,000/s | ~10 MB |
|
|
|
|
|
| Cedar Authz | <10 ms | 5,000/s | ~50 MB |
|
|
|
|
|
| Audit Log | <5 ms | 20,000/s | ~100 MB |
|
|
|
|
|
| KMS Encrypt | <50 ms | 1,000/s | ~20 MB |
|
|
|
|
|
| Dynamic Secrets | <100 ms | 500/s | ~50 MB |
|
|
|
|
|
| MFA Verify | <50 ms | 2,000/s | ~30 MB |
|
2025-12-11 21:50:42 +00:00
|
|
|
|
2026-01-08 09:55:37 +00:00
|
|
|
**Total Overhead**: ~10-20 ms per request
|
|
|
|
|
**Memory Usage**: ~260 MB total for all security components
|
2025-12-11 21:50:42 +00:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Deployment Options
|
|
|
|
|
|
|
|
|
|
### Development
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
```bash
|
|
|
|
|
# Start all services
|
|
|
|
|
cd provisioning/platform/kms-service && cargo run &
|
|
|
|
|
cd provisioning/platform/orchestrator && cargo run &
|
|
|
|
|
cd provisioning/platform/control-center && cargo run &
|
2026-01-12 04:42:18 +00:00
|
|
|
```
|
2025-12-11 21:50:42 +00:00
|
|
|
|
|
|
|
|
### Production
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
```bash
|
|
|
|
|
# Kubernetes deployment
|
|
|
|
|
kubectl apply -f k8s/security-stack.yaml
|
|
|
|
|
|
|
|
|
|
# Docker Compose
|
|
|
|
|
docker-compose up -d kms orchestrator control-center
|
|
|
|
|
|
|
|
|
|
# Systemd services
|
|
|
|
|
systemctl start provisioning-kms
|
|
|
|
|
systemctl start provisioning-orchestrator
|
|
|
|
|
systemctl start provisioning-control-center
|
2026-01-12 04:42:18 +00:00
|
|
|
```
|
2025-12-11 21:50:42 +00:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
|
|
|
|
|
### Environment Variables
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
```bash
|
|
|
|
|
# JWT
|
|
|
|
|
export JWT_ISSUER="control-center"
|
|
|
|
|
export JWT_AUDIENCE="orchestrator,cli"
|
|
|
|
|
export JWT_PRIVATE_KEY_PATH="/keys/private.pem"
|
|
|
|
|
export JWT_PUBLIC_KEY_PATH="/keys/public.pem"
|
|
|
|
|
|
|
|
|
|
# Cedar
|
|
|
|
|
export CEDAR_POLICIES_PATH="/config/cedar-policies"
|
|
|
|
|
export CEDAR_ENABLE_HOT_RELOAD=true
|
|
|
|
|
|
|
|
|
|
# KMS
|
|
|
|
|
export KMS_BACKEND="vault"
|
|
|
|
|
export VAULT_ADDR="https://vault.example.com"
|
|
|
|
|
export VAULT_TOKEN="..."
|
|
|
|
|
|
|
|
|
|
# MFA
|
|
|
|
|
export MFA_TOTP_ISSUER="Provisioning"
|
|
|
|
|
export MFA_WEBAUTHN_RP_ID="provisioning.example.com"
|
2026-01-12 04:42:18 +00:00
|
|
|
```
|
2025-12-11 21:50:42 +00:00
|
|
|
|
|
|
|
|
### Config Files
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
```toml
|
|
|
|
|
# provisioning/config/security.toml
|
|
|
|
|
[jwt]
|
|
|
|
|
issuer = "control-center"
|
|
|
|
|
audience = ["orchestrator", "cli"]
|
|
|
|
|
access_token_ttl = "15m"
|
|
|
|
|
refresh_token_ttl = "7d"
|
|
|
|
|
|
|
|
|
|
[cedar]
|
|
|
|
|
policies_path = "config/cedar-policies"
|
|
|
|
|
hot_reload = true
|
|
|
|
|
reload_interval = "60s"
|
|
|
|
|
|
|
|
|
|
[mfa]
|
|
|
|
|
totp_issuer = "Provisioning"
|
|
|
|
|
webauthn_rp_id = "provisioning.example.com"
|
|
|
|
|
rate_limit = 5
|
|
|
|
|
rate_limit_window = "5m"
|
|
|
|
|
|
|
|
|
|
[kms]
|
|
|
|
|
backend = "vault"
|
|
|
|
|
vault_address = "https://vault.example.com"
|
|
|
|
|
vault_mount_point = "transit"
|
|
|
|
|
|
|
|
|
|
[audit]
|
|
|
|
|
retention_days = 365
|
|
|
|
|
retention_break_glass_days = 2555 # 7 years
|
|
|
|
|
export_format = "json"
|
|
|
|
|
pii_anonymization = true
|
2026-01-12 04:42:18 +00:00
|
|
|
```
|
2025-12-11 21:50:42 +00:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Testing
|
|
|
|
|
|
|
|
|
|
### Run All Tests
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
```bash
|
|
|
|
|
# Control Center (JWT, MFA)
|
|
|
|
|
cd provisioning/platform/control-center
|
|
|
|
|
cargo test
|
|
|
|
|
|
|
|
|
|
# Orchestrator (Cedar, Audit, Secrets, SSH, Break-Glass, Compliance)
|
|
|
|
|
cd provisioning/platform/orchestrator
|
|
|
|
|
cargo test
|
|
|
|
|
|
|
|
|
|
# KMS Service
|
|
|
|
|
cd provisioning/platform/kms-service
|
|
|
|
|
cargo test
|
|
|
|
|
|
|
|
|
|
# Config Encryption (Nushell)
|
|
|
|
|
nu provisioning/core/nulib/lib_provisioning/config/encryption_tests.nu
|
2026-01-12 04:42:18 +00:00
|
|
|
```
|
2025-12-11 21:50:42 +00:00
|
|
|
|
|
|
|
|
### Integration Tests
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
```bash
|
|
|
|
|
# Full security flow
|
|
|
|
|
cd provisioning/platform/orchestrator
|
|
|
|
|
cargo test --test security_integration_tests
|
|
|
|
|
cargo test --test break_glass_integration_tests
|
2026-01-12 04:42:18 +00:00
|
|
|
```
|
2025-12-11 21:50:42 +00:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Monitoring & Alerts
|
|
|
|
|
|
|
|
|
|
### Metrics to Monitor
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- Authentication failures (rate, sources)
|
|
|
|
|
- Authorization denials (policies, resources)
|
|
|
|
|
- MFA failures (attempts, users)
|
|
|
|
|
- Token revocations (rate, reasons)
|
|
|
|
|
- Break-glass activations (frequency, duration)
|
|
|
|
|
- Secrets generation (rate, types)
|
|
|
|
|
- Audit log volume (events/sec)
|
|
|
|
|
|
|
|
|
|
### Alerts to Configure
|
2026-01-08 09:55:37 +00:00
|
|
|
|
|
|
|
|
- Multiple failed auth attempts (5+ in 5 min)
|
2025-12-11 21:50:42 +00:00
|
|
|
- Break-glass session created
|
|
|
|
|
- Compliance report non-compliant
|
|
|
|
|
- Incident severity critical/high
|
|
|
|
|
- Token revocation spike
|
|
|
|
|
- KMS errors
|
|
|
|
|
- Audit log export failures
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Maintenance
|
|
|
|
|
|
|
|
|
|
### Daily
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- Monitor audit logs for anomalies
|
|
|
|
|
- Review failed authentication attempts
|
|
|
|
|
- Check break-glass sessions (should be zero)
|
|
|
|
|
|
|
|
|
|
### Weekly
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- Review compliance reports
|
|
|
|
|
- Check incident response status
|
|
|
|
|
- Verify backup code usage
|
|
|
|
|
- Review MFA device additions/removals
|
|
|
|
|
|
|
|
|
|
### Monthly
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- Rotate KMS keys
|
|
|
|
|
- Review and update Cedar policies
|
|
|
|
|
- Generate compliance reports (GDPR, SOC2, ISO)
|
|
|
|
|
- Audit access control matrix
|
|
|
|
|
|
|
|
|
|
### Quarterly
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- Full security audit
|
|
|
|
|
- Penetration testing
|
|
|
|
|
- Compliance certification review
|
|
|
|
|
- Update security documentation
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Migration Path
|
|
|
|
|
|
|
|
|
|
### From Existing System
|
|
|
|
|
|
|
|
|
|
1. **Phase 1**: Deploy security infrastructure
|
|
|
|
|
- KMS service
|
|
|
|
|
- Orchestrator with auth middleware
|
|
|
|
|
- Control Center
|
|
|
|
|
|
|
|
|
|
2. **Phase 2**: Migrate authentication
|
|
|
|
|
- Enable JWT authentication
|
|
|
|
|
- Migrate existing users
|
|
|
|
|
- Disable old auth system
|
|
|
|
|
|
|
|
|
|
3. **Phase 3**: Enable MFA
|
|
|
|
|
- Require MFA enrollment for admins
|
|
|
|
|
- Gradual rollout to all users
|
|
|
|
|
|
|
|
|
|
4. **Phase 4**: Enable Cedar authorization
|
|
|
|
|
- Deploy initial policies (permissive)
|
|
|
|
|
- Monitor authorization decisions
|
|
|
|
|
- Tighten policies incrementally
|
|
|
|
|
|
|
|
|
|
5. **Phase 5**: Enable advanced features
|
|
|
|
|
- Break-glass procedures
|
|
|
|
|
- Compliance reporting
|
|
|
|
|
- Incident response
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Future Enhancements
|
|
|
|
|
|
|
|
|
|
### Planned (Not Implemented)
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- **Hardware Security Module (HSM)** integration
|
|
|
|
|
- **OAuth2/OIDC** federation
|
|
|
|
|
- **SAML SSO** for enterprise
|
|
|
|
|
- **Risk-based authentication** (IP reputation, device fingerprinting)
|
|
|
|
|
- **Behavioral analytics** (anomaly detection)
|
|
|
|
|
- **Zero-Trust Network** (service mesh integration)
|
|
|
|
|
|
|
|
|
|
### Under Consideration
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- **Blockchain audit log** (immutable append-only log)
|
|
|
|
|
- **Quantum-resistant cryptography** (post-quantum algorithms)
|
|
|
|
|
- **Confidential computing** (SGX/SEV enclaves)
|
|
|
|
|
- **Distributed break-glass** (multi-region approval)
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Consequences
|
|
|
|
|
|
|
|
|
|
### Positive
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
✅ **Enterprise-grade security** meeting GDPR, SOC2, ISO 27001
|
|
|
|
|
✅ **Zero static credentials** (all dynamic, time-limited)
|
|
|
|
|
✅ **Complete audit trail** (immutable, GDPR-compliant)
|
|
|
|
|
✅ **MFA-enforced** for sensitive operations
|
|
|
|
|
✅ **Emergency access** with enhanced controls
|
|
|
|
|
✅ **Fine-grained authorization** (Cedar policies)
|
|
|
|
|
✅ **Automated compliance** (reports, incident response)
|
|
|
|
|
|
|
|
|
|
### Negative
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
⚠️ **Increased complexity** (12 components to manage)
|
2026-01-08 09:55:37 +00:00
|
|
|
⚠️ **Performance overhead** (~10-20 ms per request)
|
|
|
|
|
⚠️ **Memory footprint** (~260 MB additional)
|
2025-12-11 21:50:42 +00:00
|
|
|
⚠️ **Learning curve** (Cedar policy language, MFA setup)
|
|
|
|
|
⚠️ **Operational overhead** (key rotation, policy updates)
|
|
|
|
|
|
|
|
|
|
### Mitigations
|
2026-01-08 09:55:37 +00:00
|
|
|
|
2025-12-11 21:50:42 +00:00
|
|
|
- Comprehensive documentation (ADRs, guides, API docs)
|
|
|
|
|
- CLI commands for all operations
|
|
|
|
|
- Automated monitoring and alerting
|
|
|
|
|
- Gradual rollout with feature flags
|
|
|
|
|
- Training materials for operators
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Related Documentation
|
|
|
|
|
|
|
|
|
|
- **JWT Auth**: `docs/architecture/JWT_AUTH_IMPLEMENTATION.md`
|
|
|
|
|
- **Cedar Authz**: `docs/architecture/CEDAR_AUTHORIZATION_IMPLEMENTATION.md`
|
|
|
|
|
- **Audit Logging**: `docs/architecture/AUDIT_LOGGING_IMPLEMENTATION.md`
|
|
|
|
|
- **MFA**: `docs/architecture/MFA_IMPLEMENTATION_SUMMARY.md`
|
|
|
|
|
- **Break-Glass**: `docs/architecture/BREAK_GLASS_IMPLEMENTATION_SUMMARY.md`
|
|
|
|
|
- **Compliance**: `docs/architecture/COMPLIANCE_IMPLEMENTATION_SUMMARY.md`
|
|
|
|
|
- **Config Encryption**: `docs/user/CONFIG_ENCRYPTION_GUIDE.md`
|
|
|
|
|
- **Dynamic Secrets**: `docs/user/DYNAMIC_SECRETS_QUICK_REFERENCE.md`
|
|
|
|
|
- **SSH Keys**: `docs/user/SSH_TEMPORAL_KEYS_USER_GUIDE.md`
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Approval
|
|
|
|
|
|
|
|
|
|
**Architecture Team**: Approved
|
|
|
|
|
**Security Team**: Approved (pending penetration test)
|
|
|
|
|
**Compliance Team**: Approved (pending audit)
|
|
|
|
|
**Engineering Team**: Approved
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
**Date**: 2025-10-08
|
|
|
|
|
**Version**: 1.0.0
|
|
|
|
|
**Status**: Implemented and Production-Ready
|