Isolation & Privilege
Most database-backed platforms ship a single high-privilege credential — a root user, a service_role key, a postgres superuser — and trust application code to scope it correctly at runtime. The credential becomes a single point of failure: anyone who steals it, anyone who escalates to it, anyone who guesses where it was logged owns every record in the system. The privilege model is a policy on top of a primitive that does not enforce the policy.
Kilimanjaro's isolation posture is built around two structural moats. The first — the Privilege Compartmentalisation Matrix — eliminates the root key by replacing it with six role-scoped credentials per project, each holding exactly the privilege its named function requires. The second — the Tri-Layer Cross-Project Isolation Bastion — defends against a query crossing from one project's data into another's, with three independent enforcement layers acting in sequence, each capable of catching a failure at the layer above.
1. Scope
This surface defends against:
| Threat class | Example |
|---|---|
| Credential escalation | An attacker who compromises a low-privilege credential pivoting to a higher-privilege one |
| Lateral movement | A compromised credential used to access projects or resources outside its intended scope |
| Cross-project query escape | A buggy query planner, a configuration drift, or a malicious neighbour executing a query that returns data from a different project |
| Root-key compromise | A single credential whose theft compromises an entire org's data |
| Static credential exposure | A credential leaked in code, logs, or backups that remains valid indefinitely |
| Database driver bypasses | Application-layer RLS or scoping code that is bypassed by a query that arrives through a different path |
This surface does not address:
- In-project access control — RBAC and JSON-policy evaluation cover who-can-do-what within a project's data. See API → Security and API → Control.
- Query-layer injection — that a query payload cannot manipulate the resulting SQL is the Injection surface.
- Storage at rest — that data stored on disk cannot be read without keys is the Cryptographic Boundary surface.
2. The Privilege Compartmentalisation Matrix
The death of the root key. Every project provisions six independent PostgreSQL role-scoped users at creation, each holding exactly the privileges its named function requires and no others:
| Role | Privileges | Use case |
|---|---|---|
| query | SELECT + scoped INSERT / UPDATE / DELETE on user-data tables; no DDL, no schema escape | The default SDK runtime credential — what every API call uses by default |
| admin | DDL on user-data tables (CREATE, ALTER, schema-level migrations); no DROP of system tables, no superuser | Schema migrations + collection management from the Console or CLI |
| backup | SELECT-only across user-data tables; no writes; row-level visibility identical to query | Backup-job credential — read-only snapshot extraction |
| replicate | Logical-replication slot creation + SELECT on user-data; no writes, no schema changes | Replication to read replicas and to customer-side change-data-capture sinks |
| export | SELECT-only with bulk-export semantics (cursor-based, no row-count limits); audit-logged separately from query | Bulk-export jobs from the Console — kept distinct from query for forensic clarity |
| drop | DROP TABLE on user-data tables only; the only role authorised to drop user-data tables; no other privileges | Tombstone and retention-purge operations; scoped down to nothing else |
Each role's credential is a high-entropy random secret generated at project provisioning. The secrets are:
- Encrypted at rest in Kibo. Each credential is wrapped with the project's custody mode in effect — Platform-Managed, SKR (Secure Key Release), BYOK (Bring Your Own Key), or HYOK (Hold Your Own Key). The customer's custody choice automatically governs the credential storage, with no separate configuration.
- Never exposed to application code in plaintext. The SDK fetches the appropriate credential via an attested channel on demand and uses it inline; the credential does not live in environment variables or configuration files.
- Rotated on a zero-downtime schedule. Every credential is rotated on the project's configured cadence. Rotation creates the new credential, switches all live connections to it, and revokes the old credential — all without dropping in-flight queries.
The Compliance Attestation API generates a signed package proving role separation, rotation cadence, and access patterns over a chosen window. The package is structured for HIPAA, SOC 2, and FedRAMP evidence requirements — auditors get cryptographic proof, not a screenshot of a settings page.
The effect: there is no credential in the system whose compromise gives an attacker control of more than one narrow function within one project. There is no "production root key." There is no "service role" that bypasses RLS. The blast radius of any single credential leak is bounded by the role's named scope.
3. The Tri-Layer Cross-Project Isolation Bastion
The threat: a query — buggy, malicious, or accidentally cross-scoped — returns rows from a different project than the one the request was made against. The mitigation is three independent enforcement layers acting in sequence. Each layer can catch a failure at the layer above; a failure at any single layer is rejected by the next.
Layer 1 — Connection-Pool Routing
The platform maintains an isolated PostgreSQL connection pool per project. A request's project context is established at Gate (the Identity-Aware Kernel) and is bound to the request's runtime context. When the request reaches the data layer, the pool router resolves to the project's distinct pool object — a memory-address lookup, not a string comparison.
A request cannot acquire a connection from a different project's pool. The pool objects are not addressable by string lookup or by symbolic name from request-handler code; they are resolved through a request-scoped accessor that takes the request's verified project context as input and returns the matching pool reference or fails.
The pool routing is total in-memory separation: a buggy handler that accidentally referenced "the wrong pool" cannot compile, because the pool is not a variable that can be referenced by name.
Layer 2 — Query Planner Scoping
The query planner is architecturally context-aware: the planner accepts a project context as a parameter to query compilation and treats every collection / table reference as scoped to that context. Cross-project syntax — a query that names a table in a different project's namespace — does not exist in the planner's vocabulary. Such a syntax cannot be parsed; the planner returns a PARSE_ERROR before any privilege check runs.
This is not a runtime filter that could be forgotten or bypassed. The planner does not know how to express the concept "a table in another project," in the same way a typed compiler does not know how to express "this int is actually a string." The grammar excludes the dangerous construct.
Layer 3 — DB Credential Scoping
Even if the upper layers failed — even if a query somehow reached PostgreSQL referencing a different project's schema — PostgreSQL's native schema-level permission check denies the access. Each project's PostgreSQL credentials (the six roles from the Compartmentalisation Matrix) are scoped to that project's schema namespace at the database level. A query that names a different project's schema fails with permission denied for schema <name> at parse time, before any rows are read.
This layer is the platform's structural backstop. It is enforced by PostgreSQL itself — not by Kilimanjaro code — and could only be bypassed by a PostgreSQL vulnerability of a kind that has not been seen at the schema-permission layer in production-grade releases. The credential cannot be elevated; the schema check cannot be skipped; the rejection is a hard block, not a warning.
The System Law
Every layer's enforcement decision — pass or fail — is emitted as an audit-log entry with hardware-attested provenance (per the Identity-Aware Kernel attestation chain). The audit ledger contains the cross-layer trace: which layer evaluated the request, what decision it returned, and (for rejections) the layer that fired.
A failure at any single layer is automatically caught by the layer below it, with a mandatory audit ledger entry generated at the point of catch. There is no silent fallthrough. There is no "the previous layer should have caught this; we'll trust it did." Each layer enforces independently.
4. Composition with other surfaces
Isolation & Privilege depends on, and is depended on by, other threat surfaces:
- Depends on Infrastructure — the TEE protection of the connection-pool router and planner code is what makes the in-memory separation meaningful. A hypervisor adversary who could read TEE memory could observe pool reference patterns; the infrastructure surface stops that.
- Depends on Identity-Aware Kernel — the project context that flows into Layer 1 is established at Gate. A forged session that claimed a different project's context would defeat the layers below; Gate's attestation discipline closes that.
- Depended on by Cryptographic Boundary — wrapped-DEK records in Kibo's store are partitioned per project; the same isolation layers ensure one project's wrapped DEKs are not visible to another project's query path.
- Depended on by Injection — even a successful injection that escapes the four anti-injection layers would face Layer 3's credential scoping; the injection model assumes Isolation & Privilege as the final structural backstop.
5. What this surface does not cover
- Within-project authorisation — the platform RBAC role taxonomy and JSON-policy evaluation cover who can do what within a project. See API → Security and API → Control.
- Cross-region data movement — region-pin enforcement is a separate concern; see Regions & residency.
- End-user identity boundary — the boundary between two end-users within a project is RLS, not the project-isolation bastion. See Identity-Aware Kernel.