Docs
Live demo

Bring an existing database under management

Connect a database in observe mode, discover accounts, adopt them into Principal and verify drift.

On this page

Before you start: Admin role and Principal’s database account (Prepare a target).

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.
  1. Add the target with Managed by Principal off (Observe). Avoid the three write actions in Resources.
  2. Open the target and click Run discovery.
  3. Expand accounts in Roles to review access.
  4. Click Manage it in the header.
  5. Click Adopt on a row (or Review & adopt under Access patterns).
  6. Under Mapping, pick New or Existing, then click Create identity and adopt or Confirm adoption.
  7. Open Drift and click Check all targets.

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.

Adopted accounts show Adopted, get a matching rule and are never deleted. Unmanaged accounts stay untouched. Fix drift rows with Fix drift.

Through the API#

  1. Test: POST /targets/test-connection (kind, connection_ref)
  2. Create: POST /targets (kind, name, connection_ref)
  3. Discover: POST /targets/{id}/discover, read GET /resources/targets/{id}/inventory
  4. Manage: PATCH /targets/{id} with {"managed": true} (observe returns 422 on adopt)
  5. Preview POST /targets/{id}/accounts/adopt/preview, adopt POST /targets/{id}/accounts/adopt:
    json
    {
      "account_key": {"engine": "postgres", "role_name": "reporting"},
      "identity": {"mode": "existing", "identity_id": "<identity-id>"},
      "rules": [{"resources": ["pg://<target-id>/app/public/*"],
                 "permissions": ["SELECT"]}]
    }
↑ ↓ to moveEnter to openEsc to close