Docs
Live demo

Create a rule

Give people, groups or service accounts access to a target from one form.

On this page

Needs Admin (or custom role with rule change + apply), a managed target and a template.

  1. Rules & templates → Create → Give access (or Give access on a person/template to prefill). Left Access map updates live.
  2. People: select users, groups or service accounts (Search users and groups… + kind filter). One rule per identity.
  3. Permissions: pick a template (grouped by engine, version). Permission preview toggles Visual / Raw JSON.
  4. Targets: check target (prefilled for single-server templates), or pick all databases, a list or a pattern under Database targeting.
  5. Expires (optional, individual rules only): Ends — Never, 1 hour, 4 hours, 8 hours, 24 hours, 7 days or Pick a date (max 30 days). Hover icon for exact time.
  6. Description (optional, max 1000 chars): merged rules keep an existing description if set.
  7. Verify summary (Creates 1 rule · 1 person × 1 target), click Create and apply. Opens rule History.

When Principal refuses or can’t apply#

Message Cause Action
The template will be added to an existing rule
Person already has a rule on this target (permissions merge).
Keep if intended. Deleting later removes both templates.
A group rule already gives this access
Group and individual rules cannot combine on one target.
Remove person from group or delete group rule first.
This person already has a rule on this target
SSH, app and expiring rules allow one rule per person.
Edit or delete the existing rule first.
Principal doesn’t manage this target, so it doesn’t change access on it.
Target is in Observe mode.
Click Manage it on the target, then retry.
None of the chosen databases has a table this template names.
Named MySQL / MariaDB table absent in chosen databases.
Run discovery if new, or pick other databases.
Saved, but not applied
Rule saved, apply failed (e.g. account name collision).
Click Open rule (Apply a rule).

A table that only some databases have#

  • On MySQL / MariaDB, a template naming a table (e.g. migrations) applies that table only where last discovery found it. Whole-database grants apply everywhere.
  • Grants with CREATE or ALL apply to all chosen databases (MariaDB accepts them before table creation).
  • Added or dropped tables require re-running discovery and re-applying or updating the template. Principal sees tables only where its role has privileges (Prepare a target).

Custom rules#

Custom rules define permissions inline without a template. Use for one-offs, and use templates for shared access.

Through the API#

  1. Create: POST /policies (or idempotent POST /policies/ensure):
    json
    {"subject_id": "<group-id>", "target_id": "<target-id>",
     "template_name": "warehouse-read-only", "description": "Quarterly audit"}
  2. Preview: POST /policies/{id}/plan/diff.
  3. Apply: POST /policies/{id}/apply (202 + job_id).
  4. Track: GET /apply-runs or GET /admin/jobs/{id}.

Single-call alternative: POST /grants (Grant access from an integration).

↑ ↓ to moveEnter to openEsc to close