Skip to main content

Config Service — Security Model

Status: populated Owner: TBD Last updated: 2026-04-18 Companion: Service Template · 13 security-compliance-tenancy · 14 compliance-security-extended


1. RBAC / ABAC Matrix

OperationMinimum RoleAdditional Conditions
GET /internal/config/resolveAny service JWT (internal)tenantId in JWT must match nodeId tenant
GET /internal/config/uiAny service JWT (internal)tenantId must match
GET /internal/config/tokensAny service JWT (internal)nodeId (if provided) must belong to tenantId
POST /api/v1/config/modules/:key/featuresTENANT_ADMINTenant-scoped
POST /api/v1/config/rolesTENANT_ADMIN (custom) / SUPER_ADMIN (system)isSystem=true requires SUPER_ADMIN
POST /api/v1/config/roles/:key/inheritanceSUPER_ADMIN
POST /api/v1/config/roles/:key/feature-grantsTENANT_ADMINTenant-scoped
POST /api/v1/config/users/:userId/overridesTENANT_ADMINTarget user must be same tenant
DELETE /api/v1/config/users/:userId/overrides/:idTENANT_ADMINSame tenant check
POST /api/v1/config/design-tokens (tenant/module/user scope)TENANT_ADMIN
POST /api/v1/config/design-tokens (global scope)SUPER_ADMIN
Create/modify GLOBAL ConfigNodeSUPER_ADMIN
Hard-delete any ConfigNodeNobodyReturns 405 Method Not Allowed

2. Tenant Isolation

ControlImplementation
Row-Level SecurityPostgreSQL RLS on all tables; tenant_id = current_setting('app.current_tenant_id')
JWT claim enforcementtenantId extracted from JWT only; rejected if body/query provides a different value
Cross-tenant resolutionReturns { effect: "deny", reason: "CROSS_TENANT" } — never leaks data from another tenant
GLOBAL and system rolesVisible to all tenants (by design); cannot be mutated by TENANT_ADMIN
Outbox / inboxPartitioned by tenant_id in payload; Relay validates before publishing

3. Encryption

Data classEncryptionNotes
Config node payload (JSONB)At rest: PostgreSQL transparent data encryptionNo PHI stored here; config metadata only
Design token valuesAt rest: PostgreSQL TDEToken values are non-sensitive presentation data
User override justification textAt rest: PostgreSQL TDEMay contain clinical rationale; classified as metadata
Redis cache valuesIn transit: TLS; at rest: encrypted Redis (per deployment policy)Cache values may contain resolved permission results
Transit (all)TLS 1.2+ enforced on all internal + external connections

4. Audit Events

All mutations emit CloudEvents to NATS which audit-service persists with 7-year retention.

Audit triggerEvent subject
Feature definition created/updatedconfig.feature.created.v1 / config.feature.updated.v1
Role created/updated/deletedconfig.role.*.v1
Role feature grant created/updatedconfig.role_grant.*.v1
UI definition created/updatedconfig.ui_definition.*.v1
User node override created/deletedconfig.user_override.*.v1
Design token updatedconfig.design_token.updated.v1
Resolution calls1 % sampled diagnostic events only (not individual audit records)

Audit records include: actorId, tenantId, timestamp, action, targetId, before/after payload diff.


5. GDPR Participation

AspectNotes
Personal data storeduser_id references and justification text in user_node_overrides
Data subject rightsOverride records linked to user_id; deletion of a user triggers soft-delete of all their overrides
RetentionAudit records: 7 years (compliance minimum); config nodes: indefinite until tenant offboarded
Data residencyAll data stored in tenant's designated region; RLS prevents cross-region leakage
Purpose limitationConfig data used only for resolution and audit; not shared with analytics or AI pipelines

6. Security Hardening

ControlDetail
No secrets in configAll secrets in env vars validated via Zod at startup
Rate limitingKong applies rate limits on /api/v1/config/*; internal endpoints rate-limited by service mesh
Input validationZod schemas on all DTOs; unknown fields rejected
Cycle detectionRole graph and config node DAG cycle detection at write time
Fail-closed on upstream failuresResolution returns DENY when facility-service or access-policy is unavailable
No synchronize: true in ORMAll schema changes via explicit migrations
OpenTelemetry trace propagationAll inter-service calls include W3C trace context