Docs
Live demo

Discovery and adoption

How discovery reads targets, why unmanaged accounts stay untouched and how adoption brings existing accounts under rules.

On this page

Discovery and ownership#

Discovery reads databases, schemas, tables, roles and users (or Kubernetes namespaces, roles and bindings) hourly by default and on request. Rules and templates pick objects from discovered inventory.

Swipe the screenshot sideways to see all of it, or tap it to open it full size.

A database target. The header shows when Principal last scanned it and whether its data is current.
  1. Circular arrows icon (Run discovery): read the target now, outside the schedule.
  2. Schedule of discovery and drift checks.
  3. Freshness of the data and the count of warnings.
  4. Found by discovery. Accounts that exist on the target but were not created by Principal. Review them to adopt or ignore.
  5. Access patterns. Groups of accounts with the same permissions, as candidates for templates.
Owner Meaning
Created by Principal
Created for a rule.
Adopted
Pre-existing account handed to Principal.
Unmanaged
Pre-existing account Principal never touches.
System
Built-in account or Principal’s connection role.

Swipe the screenshot sideways to see all of it, or tap it to open it full size.

Roles (users on MySQL and ClickHouse) of the target with their owner: created by Principal, adopted, unmanaged or system.

Principal modifies an account only with proof of ownership. A name is not proof: a DBA could recreate a deleted role with the same name. PostgreSQL, ClickHouse and MongoDB prove identity by internal ID. MariaDB lacks one, so a recreated account with the same name and password looks like Principal’s own.

Adoption and unadopt#

Adopting links an account to an identity and builds a rule from confirmed grants and role memberships (memberships stay memberships), for example adopting etl_writer on warehouse for service account etl. Confirmed grants belong to the rule on all four database engines. Unconfirmed grants are extra on PostgreSQL and MongoDB (Access granted by hand).

  • New identity. New (Create identity and adopt) creates an identity for that account. Later rules on that target must edit the existing adoption rule. Multiple adopted accounts on one identity require editing each account’s rule directly.
  • Not taken. Adoption leaves the password unknown until an explicitly confirmed rotation, and leaves the account on the target if its rules are deleted (revoking only rule grants).
  • Unadopt. Deletes the adoption rule and credentials and returns the account to unmanaged with nothing revoked, keeping pre-adoption access.

Name collisions and reserved accounts#

When a rule targets a login that already exists as an unmanaged account, apply refuses instead of taking it over silently:

Engine Rule account On existing unmanaged account
MariaDB
name@%
Apply window shows Apply is blocked.
PostgreSQL
name
Apply stops with an unconfirmed-account error.
MongoDB
admin.name
Apply and Rotate refuse. Deleting the rule sends nothing.
ClickHouse
name
Apply refuses (waits on replicas creating the user). Failed Principal-created accounts are retaken on retry.

Adopt the account or drop it on the database to continue. Accounts managed before an upgrade (including earlier MongoDB/ClickHouse auto-taken users) stay managed, and upgrade preflight counts them.

  • Same prefix. Account names use the part before @ ([email protected] and [email protected] both map to anna_lee). First applied rule owns it. The second person’s preview, apply and drift fix stop, drift skips it, and deleting their rule leaves the account untouched.
  • Reserved names. Principal’s connection role (System), ClickHouse default, PostgreSQL pg_*, and Linux system accounts like root on SSH hosts cannot be adopted or created by rules.

Access patterns#

Discovery groups accounts with identical grants into candidate templates (such as reporting-read-only for SELECT on reporting.*). Review & adopt adopts those accounts, creates a target-scoped template and creates unlinked rules (future template versions do not push to them).

The editor cannot change legacy PostgreSQL pattern templates, server-wide ClickHouse or server-wide-only MariaDB pattern templates, or unrepresentable grants (PostgreSQL functions by name, SELECT on all MariaDB databases): create a new template instead. PostgreSQL schemas or tables containing . or / cannot be adopted into a template.

Where to manage it#

Target details, Bring a database under management, POST /targets/{id}/discover, POST /targets/{id}/accounts/adopt/preview, POST /targets/{id}/accounts/adopt, POST /target-accounts/{id}/unadopt, Access profiles API.

↑ ↓ to moveEnter to openEsc to close