Skip to main content

Compliance

This document maps Platform-Kernel's technical architecture to regulatory and industry frameworks. All controls listed below are implemented in the codebase at M9 — no planned or aspirational items are included.

important

This document describes technical controls implemented in the Platform-Kernel codebase. It does not constitute legal advice or a certification statement. Engage a qualified auditor for formal compliance attestations.


Regulatory Framework Coverage

FrameworkScopeCoverage
GDPR (Regulation EU 2016/679)EU personal data processingImplemented
PCI-DSS v4.0Cardholder data environment (CDE)Partial (no card PAN storage)
AML/KYC (FATF Recommendations)Financial tenant identificationArchitectural hooks
SOC 2 Type II (AICPA TSC)Security, Availability, ConfidentialityImplemented
ISO 27001:2022Information security managementImplemented
OWASP ASVS 4.0Application security verificationImplemented

GDPR

Data Classification

CategoryExamplesStorageEncryption
Personal Data (standard)Name, email, phonePostgreSQLAES-256 at rest
Special Category DataNot stored by default
Pseudonymous DataUser UUID, tenant UUIDPostgreSQL, Kafka, ClickHouseAt rest
Audit LogsAccess logs, mutationsClickHouseAES-256

Right to Erasure (Article 17)

Platform-Kernel implements GDPR deletion via a crypto-wipe state machine introduced in M9 Phase 4 (feat(gdpr): deletion state machine, 2026-04-19).

Deletion stages:

  1. User calls DELETE /api/v1/users/:id (or POST /api/v1/audit/anonymize).
  2. IAM marks user as pending_deletion.
  3. The GDPR pipeline anonymizes PII fields in PostgreSQL using UPDATE … SET email = sha256(email), name = '[DELETED]'.
  4. The ClickHouse audit log anonymizes the user via ReplacingMergeTree FINAL merge — existing rows are overwritten by anonymized replacements.
  5. After BILLING_CRYPTO_WIPE_PERIOD_DAYS (default: 30 days), the field-level AES-256 DEK for that user is destroyed in Vault. Data becomes permanently unrecoverable.

Kafka events retention: Audit events on platform.audit.events are retained 30 days (KAFKA_AUDIT_RETENTION_HOURS = 720). After TTL, Kafka removes the events automatically.

S3 (cold audit): Audit cold-tier exports on S3 Glacier must be deleted manually by the Platform Owner as part of the GDPR SAR workflow. The Audit Service export endpoint supports JSON and CSV for SAR fulfillment: GET /api/v1/audit/export.

Data Portability (Article 20)

The Audit Service provides a full data export:

GET /api/v1/audit/export?format=json&userId={id}
Authorization: Bearer {JWT}

Data Minimization

  • Notifications store no payload content after delivery — only status, channel, sent_at. Payload TTL: 0 (discarded on queue drain).
  • Audit records store the diff field as JSONB. PII in diff is anonymized during the GDPR wipe.
  • File storage metadata excludes original filenames for GDPR-flagged tenants (configurable per tenant).

Data Retention Summary

Data TypeHot RetentionCold RetentionDeletion
Audit logs (ClickHouse)90 daysGDPR anonymize
Audit logs (S3 Glacier)7 yearsManual by Platform Owner
Notification history90 daysAuto-purge
Soft-deleted files30 daysAuto-purge
Kafka events7 days (168 h)Kafka auto-expire
Kafka audit events30 days (720 h)Kafka auto-expire
WAL audit fallback7 daysAuto-replay + purge
Delegation tokensUp to 7 daysVault TTL

Basis of Processing (Articles 6 and 9)

Platform-Kernel provides no built-in consent collection UI. Module authors are responsible for collecting and recording consent. The Audit primitive (POST /api/v1/audit) records consent events with full tamper-proof history at the ClickHouse layer.


PCI-DSS v4.0

Platform-Kernel deliberately does not store, process, or transmit cardholder data (PAN, CVV, expiry). All payment flows delegate to a PCI-certified payment provider (e.g., Stripe) via the Integration Hub. The Billing Service stores only provider-assigned subscription IDs and plan metadata — never raw card data.

Applicable Controls

PCI-DSS RequirementImplemented Control
Req 2.2 — Secure configurationgolangci-lint v2, hardened Docker images (minimal base), no default credentials
Req 3.4 — Render PAN unreadableNot applicable — no PAN stored
Req 6.3 — Security patchesRenovate Bot automated dependency updates, SAST via Snyk
Req 6.4 — Web app protectionOpenAPI request validation at Gateway, OWASP ZAP quarterly pen testing
Req 7 — Access controlRBAC (IAM internal/rbac), least-privilege roles per tenant
Req 8 — AuthenticationES256 JWT, Argon2id passwords, TOTP MFA (RFC 6238)
Req 10 — Audit loggingAppend-only ClickHouse, dual-write, 7-year cold retention
Req 11 — Security testingContract tests (Pact), SAST (Snyk), pen testing (OWASP ZAP + Burp Suite) quarterly
Req 12.3.2 — Risk managementSECURITY.md, architecture threat model documented

AML and KYC Hooks

Platform-Kernel provides architectural hooks for Know Your Customer (KYC) and Anti-Money Laundering (AML) workflows without implementing a built-in identity verification provider. Module authors connect third-party KYC providers (e.g., Sumsub, Onfido) via the Integration Hub and record verification results in the Audit Log.

Transaction Monitoring Hooks

The Money Service emits the following Kafka events that AML modules can subscribe to for suspicious activity detection:

Kafka EventTriggerPayload
money.wallet.creditedAny credit to any walletamount, currency, source, tenantId
money.wallet.debitedAny debit from any walletamount, currency, destination, tenantId
money.wallet.transferInter-wallet transferfromWalletId, toWalletId, amount

Velocity Controls

The Money Service enforces hard limits that provide baseline velocity controls:

  • Max transaction: $100 000 per operation.
  • Max balance: $1 000 000 per wallet (Billing plan enforced via BillingService.CheckLimit).
  • MONEY_MAX_HOLDS_PER_WALLET = 100 — prevents concurrent hold abuse.

Additional AML velocity rules (daily transaction count, cumulative amounts) must be implemented at the module layer using the Data Primitive.


SOC 2 Type II

SOC 2 maps to five Trust Service Criteria (TSC). Controls below are implemented at the kernel layer.

CC6: Logical and Physical Access Controls

ControlImplementation
CC6.1 — Access is restricted to authorized usersRBAC engine (services/iam/internal/rbac/)
CC6.2 — New access requires authorizationModule manifest permission declarations, validated at Module Registry activation
CC6.3 — User access is removed when no longer neededDELETE /api/v1/users/:id (IAM) triggers GDPR wipe pipeline
CC6.6 — Network access is restrictedmTLS via Istio (service mesh), TLS 1.3 minimum, CORS strict no-wildcard
CC6.7 — Transmission is encryptedTLS 1.3 for all external traffic, mTLS for service-to-service
CC6.8 — Malware is detected and remediatedClamAV antivirus on all file uploads, Snyk SCA on all dependencies

CC7: System Operations

ControlImplementation
CC7.1 — Infrastructure is monitoredOTel → VictoriaMetrics, Grafana dashboards
CC7.2 — Security events are identifiedslog structured JSON, traceId propagation, Audit Log
CC7.3 — Incidents are evaluatedAlertmanager rules on circuit_breaker_state, error-rate, saturation
CC7.4 — Security incidents are responded toRunbooks in Self-Hosting docs (backup, DR procedures)

A1: Availability

ControlImplementation
A1.1 — Capacity is managedk6 load tests (14 000 RPS verified), horizontal scaling via Kubernetes HPA
A1.2 — Environmental protectionsDocker Compose health checks, Kubernetes liveness and readiness probes
A1.3 — Recovery is testedSee Backup and Recovery

C1: Confidentiality

ControlImplementation
C1.1 — Confidential information is identifiedData classification (see GDPR section above)
C1.2 — Confidential information is protectedAES-256-GCM field-level encryption (shared/crypto), Envelope Encryption

ISO 27001:2022 — Control Mapping

ISO ControlDomainImplemented By
A.5.15 — Access controlLogical accessRBAC, JWT, RLS
A.8.3 — Information access restrictionData accessRLS per table, ClickHouse row policies
A.8.5 — Secure authenticationAuthNArgon2id, ES256, TOTP MFA
A.8.7 — Protection against malwareAVClamAV on upload, Snyk on dependencies
A.8.9 — Configuration managementInfragolangci-lint, markdownlint, Renovate Bot
A.8.12 — Data leakage preventionData isolationTenant RLS, mTLS, CORS strict
A.8.16 — Monitoring activitiesObservabilityOTel, VictoriaMetrics, Grafana
A.8.22 — Filtering of web servicesAPI protectionOpenAPI validation, rate limiting
A.8.24 — Use of cryptographyCryptoAES-256-GCM, TLS 1.3, ES256, Argon2id
A.8.28 — Secure codingSSDLCgolangci-lint, OWASP ZAP, Pact, Snyk

Encryption Summary

LayerAlgorithmKey Management
Data at rest (PostgreSQL)AES-256 (TDE)Infrastructure
Data at rest (S3)AES-256 SSE-S3Infrastructure
Data at rest (ClickHouse)AES-256 encrypted volumesInfrastructure
Field-level PIIAES-256-GCMVault DEK (rotated 90 days)
JWT signingES256 (ECDSA P-256)Vault (secret/platform/iam/jwt-keys)
Password hashingArgon2id— (one-way)
MFA secretsAES-256Vault (MFA_ENCRYPTION_KEY)
Integration Hub credentialsAES-256-GCMVault
Data in transitTLS 1.3Vault-managed certificates
Service-to-servicemTLS (TLS 1.3)Istio (Vault CA)
Key hierarchyRSA-2048+ (KEK) → FIPS 140-3 Level 3 HSM (Master Key)Vault + HSM

Penetration Testing Schedule

TypeToolFrequency
SASTgovulncheck, Snyk CodeEvery commit (CI)
SCASnyk Open Source, Renovate BotWeekly
DASTOWASP ZAPQuarterly
Manual Pen TestBurp Suite ProQuarterly
Chaos EngineeringLitmus / Chaos MonkeyMonthly
Fuzz TestingAFL / libFuzzerMonthly

See Also