Playbook: SOC 2, ISO 27001, and GDPR
Compliance belongs to the organization operating a product, not to a library or runtime. No platform can hand you a SOC 2 report or make you GDPR-compliant on its own—roughly half of any audit is organizational (policies, HR onboarding/offboarding, endpoint MDM, vendor reviews, incident drills, penetration tests, and legal DPAs).
What Plat5 gives you out of the box is the multi-tenant application security architecture auditors actually inspect: centralized default-deny access enforcement, tenant isolation, per-org SSO/MFA/IP guardrails, fail-closed append-only audit logs, declarative change management, and transactional erasure. (If you also run a separate internal support/staff control plane, see Plat5 Operator for its own audit and authorization controls.)
This playbook maps Plat5’s controls to SOC 2 Type II, ISO/IEC 27001:2022, and GDPR, and spells out the exact baseline your services and deployment must follow to stand behind them in an audit.
1. Shared responsibility
Section titled “1. Shared responsibility”| Layer | Owned by | What it covers |
|---|---|---|
| Plat5 runtime | Plat5 | Edge authentication (JWT / hashed API keys), default-deny RBAC or AuthZEN PDP enforcement, per-org security policies, JIT bindings, sub-second revocation, closed-world tenant ids, fail-closed append-only audit log with Owner/Writer DB role separation, deployment-wide long-polled export feed (GET /internal/events), and audit prune partition retention, declarative plan/apply revision history with OIDC attribution, transactional lifecycle erasure events, signed multi-arch images with SBOM/provenance |
| Your services | Your engineering team | Scoping every database query by the node id from the front door (write a service), never logging secrets/tokens, emitting X-Plat5-Audit-Details / X-Plat5-Audit-Created, propagating X-Request-ID and traceparent, consuming node.purged / member.removed / user.deleted to wipe service tables, and checking /access/v1/evaluations for background jobs |
| Deployment & infrastructure | Your ops / security team | External enterprise IdP (MFA, SSO, lockout), edge TLS termination, internal TLS (https://, Postgres sslmode=require, Valkey rediss://), VPC/network isolation, encryption at rest (KMS/disk), tested encrypted backups, SIEM log shipping & alerting (including 401/429 gateway logs), audit partition archival & retention, and internal staff access controls (e.g. Plat5 Operator) |
| Organization & legal | Your company | Written security policies, employee training & offboarding, laptop MDM, vendor risk management, annual penetration testing, incident response drills, privacy notices, lawful basis / consent records, DPAs, and (if applicable) HIPAA BAAs or PCI scope |
2. Mandatory compliance baseline
Section titled “2. Mandatory compliance baseline”To rely on the control mappings below in an audit, run Plat5 with these settings and conventions:
Identity & authentication
Section titled “Identity & authentication”- Use an enterprise IdP, not Plat5 Auth. Plat5 Auth is a lightweight reference issuer for local development and simple setups; it does not provide SAML federation, MFA/passkeys, SCIM, or account-lockout policies. In production, point the gateway at a SOC 2 / enterprise IdP (Okta, Auth0, Keycloak, WorkOS, Clerk) and configure
AUTH_ISSUER, explicitAUTH_ALLOWED_AUDIENCES(never*), andAUTH_JWKS_URIif your IdP doesn’t use OIDC discovery. - Enforce org-level MFA/SSO and IP guardrails. Expose relevant IdP claims via
policy_claimsinplat5.yml(e.g.,amr,idp_connection) so enterprise tenants can require SSO/MFA, restrictallowed_cidrs, and set bothallow_personal_keys: falseandallow_member_keys: false(required_idp_claimsevaluates JWTs only andallow_member_keysdefaults totrue) (Enterprise B2B SaaS). - Separate internal staff access. If you run Plat5 Operator for internal staff/support workflows, configure it with a separate staff IdP, hardware MFA, and VPN/tailnet network isolation — never share the customer IdP.
Audit logging & security monitoring
Section titled “Audit logging & security monitoring”- Keep
AUDIT_MODE=sync(the default) andOwner/Writerrole separation. Insyncmode, the gateway fails closed (503) if an intent cannot be recorded, guaranteeing no audited write reaches a service unlogged (audit). Runaudit migratewith the schemaOwnerPostgres role, and runaudit servewith the restrictedWriterrole (noDELETE,TRUNCATE, or DDL;audit serverefuses to boot otherwise). - Export finalized audit events to WORM / SIEM. Follow
audit’s deployment-wide long-polled internal feed (GET /internal/events?after=<seq>, internal API) to stream finalized events in commit order into immutable external storage (e.g., S3 Object Lock / GCS Bucket Lock) and your SIEM. - Ship stdout JSON logs and
/metricsto a SIEM. By design,401s,429s, and not-found403s are excluded fromaudit_eventsto prevent unauthenticated log flooding (audit). Ship structured gateway stdout logs plus Prometheus metrics (failed-auth limiter counters,audit_writes_total) to your SIEM (Datadog, Splunk, Grafana Cloud, CloudWatch) with alerting on auth-failure spikes and audit write errors (telemetry).
Network & encryption
Section titled “Network & encryption”- Terminate TLS at the edge and set
TRUSTED_PROXIES. WithoutTRUSTED_PROXIES,X-Forwarded-Foris ignored, breaking bothallowed_cidrsenforcement and accurateipattribution in audit events (gateway). - Protect internal traffic. Keep
INTERNAL_PORTendpoints strictly on a private VPC/network, enable Postgres TLS (?sslmode=requireonDATABASE_URL) and Valkey TLS (rediss://onVALKEY_URL), and either usehttps://service URLs / a service mesh or enable Ed25519 request signing (UPSTREAM_SIGNING_KEY) for cryptographic upstream verification (headers, deploy). - Encrypt storage and backups at rest. Run Postgres on encrypted volumes/managed RDS with KMS encryption and automated, periodically restore-tested backups.
Change management & supply chain
Section titled “Change management & supply chain”- Use OIDC JWT auth on the control plane (
AUTH_CONFIG_FILE) and omitADMIN_TOKEN. Configure multi-issuer OIDC inAUTH_CONFIG_FILE(validated offline withplat5 validate --auth-config <file>): grantreadaccess to pull-request workflows (plat5 plan --detailed-exitcode) andapplyaccess only to protectedmain/release pipelines (keyless GitHub/GitLab Actions OIDC) or MFA-verified human admins viaplat5 login(control plane API). Every applied revision records the cryptographically verifiedactor(issuer,issuer_name,subject) plus optionalX-Plat5-Change-Reason/X-Plat5-Change-Refmetadata inGET /revisions. - Pin releases and verify images. Pin
PLAT5_VERSIONto immutable release tags or digests—neverlatest. Verify published GHCR images with Cosign and archive BuildKit SBOM / SLSA provenance attestations as part of vendor/supply-chain evidence (deploy).
Service standards
Section titled “Service standards”Every backend service behind Plat5 must follow the three required rules in write a service plus these compliance-relevant standards:
- Tenant scoping: Scope every SQL query/mutation by the node id from the path/
X-Plat5-<Kind>-Idheader; never look up records by record id alone. - Audit enrichment: Return
X-Plat5-Audit-Details(before/after diffs, never secrets) andX-Plat5-Audit-Createdon writes. - Correlation: Log
X-Request-IDasrequest_idand propagatetraceparentso any audit event ties back to gateway and service logs. - Lifecycle cleanup: Consume
GET /internal/events(node.purged,member.removed,user.deleted) with the cursor stored in the same database as the cleaned data (lifecycle). - Background authorization: Ask
POST /access/v1/evaluationsbefore sending emails, webhooks, digests, or queued jobs on a member’s behalf (access).
3. SOC 2 & ISO 27001 control mapping
Section titled “3. SOC 2 & ISO 27001 control mapping”| SOC 2 TSC | ISO 27001:2022 | Control objective | How Plat5 satisfies the platform layer | What your deployment still owns |
|---|---|---|---|---|
| CC6.1 | A.5.15, A.8.3, A.8.5 | Logical access security & strong authentication | Centralized edge JWT/API-key verification; default-deny below root; uniform 403 prevents tenant/node enumeration; per-org required_idp_claims (SSO/MFA) and allowed_cidrs; hashed keys/invites (key_hash, token_hash) with leak-scanner prefixes |
External IdP MFA/password/lockout policies; staff IdP MFA; private network / VPN |
| CC6.2, CC6.3 | A.5.18, A.8.2 | Provisioning, least privilege, and timely revocation | Role-based permissions (assignable: false under custom_roles.permissions prevents privilege escalation; custom roles cannot grant *) or external AuthZEN PDP; scoped/expiring API keys (scopes, allowed_roots, allowed_cidrs, expires_at); JIT expiring bindings (expires_in/expires_at); reversible member suspension; sub-second revocation across gateway replicas via admit-invalidations |
Periodic user & staff access reviews; HR offboarding process (calling suspend/remove or SCIM) |
| CC6.6, CC6.7 | A.8.20, A.8.24 | Boundary protection & data in transit | Security headers (nosniff, DENY, Referrer-Policy); strict CORS allowlists; request body limits (max_body_bytes); path-traversal rejection; failed-auth IP rate limiter; optional Ed25519 X-Plat5-Signature; supports https:// upstreams, Postgres TLS, and Valkey rediss:// |
Edge TLS certificates; VPC security groups / egress SSRF rules; DB encryption at rest (KMS) |
| CC7.1, CC7.2 | A.8.15, A.8.16 | Monitoring, anomaly detection, and tamper-resistant audit trails | Fail-closed AUDIT_MODE=sync before upstream forward; append-only Postgres audit_events (DB triggers + Owner/Writer DB role separation, no edit/delete API); commit-ordered long-polled GET /internal/events export feed for WORM/SIEM shipping; AUDIT_MODE and AUTH_ISSUER isolated from control-plane config; correlated X-Request-ID, W3C traces, and /metrics |
SIEM ingestion & shipper relay, alerting rules (401/429 spikes, audit failures), WORM archival, and incident response |
| CC8.1 | A.8.32 | Change management for configuration & releases | Declarative plat5 plan / plat5 apply with dry-run diffs, strict JSON Schema validation, optimistic preconditions (expect.revision / 409 PLAN_STALE), blocked destructive kind changes, multi-issuer OIDC read/apply separation (AUTH_CONFIG_FILE), immutable Postgres revision history with cryptographically verified actor + reason/ref metadata (GET /revisions), CI drift detection (--detailed-exitcode), and signed multi-arch images with SBOM + SLSA provenance |
Git branch protection, PR approvals, and application release approvals |
| A1.2 (Availability) | A.8.13, A.8.14 | Resilience and recovery | Stateless horizontal gateway/identity/audit replicas; gateway serves last snapshot during control-plane outages and fails open if Valkey is unreachable; /health/live & /health/ready probes; replayable lifecycle log reconciles restored service backups |
Multi-AZ hosting, automated Postgres backups, and periodic backup-restore drills |
4. GDPR alignment
Section titled “4. GDPR alignment”Data minimization & privacy by design (Art. 5(1)(c), Art. 25, Art. 32)
Section titled “Data minimization & privacy by design (Art. 5(1)(c), Art. 25, Art. 32)”- Strict identity separation: Tree routes and tree audit logs receive only tree-scoped opaque
member_ids—neveruser_id. User routes receiveuser_idwith no tree context (model). - Minimal audit payloads: Audit events never record request bodies, response bodies, query strings, credentials, roles, permissions, or slugs (audit). Services must follow the same rule in
X-Plat5-Audit-Details. - Regional deployment: Each Plat5 stack is self-contained (one Postgres, one tree namespace), making EU-only regional deployments straightforward when data residency is required.
Right to erasure & tenant offboarding (Art. 17)
Section titled “Right to erasure & tenant offboarding (Art. 17)”- Account deletion (
DELETE /users/{user_id}): Runs in a single transaction—removes all tree memberships (deleting direct bindings and group memberships), deletes personal API keys and IdP links, deletes the user account row, strips the display name from historical removed member rows, and writes commit-orderedmember.removedanduser.deletedlifecycle events (lifecycle). - Tenant offboarding: Deleting a root node starts the configured
deletion_gracewindow; once elapsed, the purge sweeper marks the treepurged, deletes bindings, invites, groups, custom roles, security policy, and service accounts/keys, removes members, and emitsnode.purged(lifecycle). - Backup-safe service cleanup: Because services keep their lifecycle cursor in the same database as the data they delete, restoring a service database from an older backup automatically rewinds the cursor and replays any
user.deleted,member.removed, ornode.purgedevents that happened after the backup—preventing “zombie” deleted data from reappearing after disaster recovery (lifecycle).
Right of access & data portability / DSAR (Art. 15, Art. 20)
Section titled “Right of access & data portability / DSAR (Art. 15, Art. 20)”Plat5 exposes the personal data it holds for a user through existing user-scoped routes, which your DSAR workflow (or self-service export handler) can bundle alongside your own services’ user_id-keyed records:
GET /user— user profile (user_id, display name, status)GET /user/nodes— organizations / trees the user belongs toGET /user/keys— personal API key metadata (prefixes, names, scopes, expiry; raw secrets are never stored)GET /user/audit-events— the user’s own user-route audit log
Storage limitation & audit log retention (Art. 5(1)(e))
Section titled “Storage limitation & audit log retention (Art. 5(1)(e))”Audit events record client ip, user_agent, and actor.user_id (on user routes), which constitute personal data under GDPR.
- Do not delete individual rows on
user.deleted. Under GDPR Art. 6(1)(f) (legitimate security interest) and Art. 17(3)(b)/(e) (legal compliance / defense of legal claims), immutable security audit logs may be retained after account deletion provided retention is bounded and documented in your privacy notice and retention schedule. Per-row deletion would undermine SOC 2 / ISO 27001 audit integrity. - Enforce retention at the monthly partition boundary with
audit prune.auditstoresaudit_eventsin monthly Postgres partitions (audit storage). Archive completed events viaGET /internal/eventsto encrypted WORM storage (e.g., S3 Object Lock) if required for multi-year retention, then run a scheduled job (such as a monthly KubernetesCronJob) under the schemaOwnerrole to drop expired hot partitions:
# Dry-run, then drop partitions strictly older than 12 full months (run as audit_owner)audit prune --older-than 12m --dry-runaudit prune --older-than 12m5. Known boundaries & operational caveats
Section titled “5. Known boundaries & operational caveats”Be explicit about these when completing enterprise security questionnaires:
- Internal staff / operator plane: If you run Plat5 Operator alongside Plat5 for support and staff administration, follow its own security and authorization docs (external AuthZEN PDP, separate staff IdP, dedicated audit store).
- Control-plane static
ADMIN_TOKEN: OmitADMIN_TOKENin production onceAUTH_CONFIG_FILEis configured so no shared static root secret exists. If retained for break-glass, store it in an audited secrets vault with MFA-gated checkout. - HIPAA & PCI-DSS: Plat5’s controls align well with HIPAA access and audit rules, but HIPAA requires BAAs with every cloud/IdP/logging vendor touching PHI and strict end-to-end encryption; PCI-DSS requires dedicated cardholder-environment segmentation (most teams keep card data out of scope using a payment processor). Treat Plat5 as one component of a regulated deployment, not a pre-certified HIPAA/PCI environment.