On this page
Rule structure#
A rule (policy in the API) binds who gets which permissions on which target (analytics → SELECT on warehouse.reporting.*): Who (user, service account or group, synced automatically, optionally nested), Where (one target), What (pinned template version or custom rule).
Swipe the screenshot sideways to see all of it, or tap it to open it full size.
- Apply sends the pending changes of this rule to the target. It opens a confirmation first.
- State: Changes not applied means the target does not match the rule yet.
- Operation banner: an operation of this rule that runs or waits for your decision.
- Who gets access.
- Where: the target and the template the rule follows, with its version.
- Permissions: privileges per resource. Columns group them into Read and Write.
- History of applies and changes. Decide answers an operation that waits for you.
Permissions and masks#
| Engine | Objects | Example |
|---|---|---|
PostgreSQL |
database, schema, table, sequence, routine, type |
SELECT, INSERT on app.public.orders |
MySQL / MariaDB |
server, database, table |
SELECT on billing |
ClickHouse |
server, database, table |
SELECT on events.* |
MongoDB |
all databases, database, collection |
read on sales, find on orders.events |
Kubernetes |
namespaced, cluster, non-resource URLs |
get, list on pods in analytics |
- ClickHouse clusters:
ON CLUSTERDDL requires server-wideCLUSTER(cluster targets only). - Globs:
*matches inside one name (app_*),**matches any depth.?and[ ]are disallowed, so no*is exact. - PostgreSQL paths and
ALL: database-scoped paths start at schema (billing.*is schemabilling, usebilling.public.*orbilling/**for the database).ALLon a schema mask also grantsTEMPORARYon the database andEXECUTEon schema functions.
Templates#
Templates (postgres-read-only) belong to one organization for isolation and can leave databases or namespaces open for rules to place. Edits create versions: rules stay pinned until you preview and move them (Move rules to a new template version). Detach makes a rule custom (Create a template).
Swipe the screenshot sideways to see all of it, or tap it to open it full size.
- Create rule from this template.
- Summary: grants, rules that use the template, last update.
- Audience: users and groups with a rule from this template, with the target and the apply state.
One rule per identity and target#
First rule wins so access has one source: group rules skip members with a personal rule, and personal rules are refused under a group rule (Change a rule).
- Exceptions: Kubernetes SSO group-token targets bind the group directly. Temporary rules on databases and Kubernetes use a temporary account.
- Takeover: leaving a group shifts access to another group’s rule on that target without dropping shared access (removing both revokes all). Applying a group rule claims uncovered members (Needs attention on Installation health).
Group rule modes#
Fixed at creation on PostgreSQL, MariaDB and ClickHouse:
| Mode | Behavior | Notes |
|---|---|---|
Member grants |
Grants per member account. |
Default. Used on Kubernetes outside SSO group tokens. |
Group role |
Grants to one role, adds members. |
One edit touches one role. MariaDB: replaces default role. ClickHouse: keeps manual non-rule grants (ignored by drift, counted in Apply). |
On PostgreSQL and MongoDB, rules are the full truth for managed accounts: apply, fix, narrowing and delete strip extra manual grants. Other engines: Drift.
Manage#
Rules · Create a rule · Templates · Rules API · Templates API · Grants API