docs

Approvals and Grants

Applies to: VaultKit 0.13.0-alpha (the admin fallback for groups with no members and recorded self-approvals are new in 0.13.0-alpha)

Nobody in VaultKit holds standing access to data. Every request is checked against your policies, and if it’s allowed, VaultKit issues a grant: permission to run that one query, for a limited time. When a policy says a person must sign off first, the request waits for an approval.

What happens to a request

  1. Checked. The control plane checks that every dataset and field the query names is in the registry, and that the requester may see the dataset. It then applies the row limit, confines tenant-scoped datasets to the requester’s tenant, and evaluates your policies for every field and table the query touches. An unknown field is refused with 422 and recorded as Rejected. An unknown or hidden dataset is answered 404 “Dataset not found”, and recorded as Rejected or Denied.
  2. Decided. The strongest matching action wins: deny, then require approval, then mask, then allow.
    • Deny: the request is refused, with the policy’s reason.
    • Allow or mask: a grant is issued straight away. Masked fields are listed.
    • Require approval: the request is queued for the approver groups the policies name.
  3. Run. The requester fetches the rows with the grant. Asking the same question again while the grant is valid reuses it. If an admin revoked the grant, asking again is evaluated afresh: a new grant, or a new approval.

Every step is written to the audit log.

Approvals

An approval policy names a group in approver_role, or several in approver_roles with an approval_mode:

action:
  require_approval: true
  approver_role: payments_reviewer
  reason: Payment records need sign-off from a payments reviewer.
  ttl: 1h
action:
  require_approval: true
  approver_roles: [security, finance_manager]
  approval_mode: any     # all (the default): every group signs off; any: one does
  reason: Agents reading financial rows need security or finance review.

Who can approve:

Several policies, several groups:

Groups with no members

A group nobody active is in falls back to org admins:

Users who can approve any request still sign for one group at a time, whether it has members or not. Only admins sign for the built-in admin role, which an approval policy with no approver falls back to (only bundles from before approvers were required have such policies).

Progress reads the same in the console’s Approvals page, the approvals API (progress), GET /requests/:id (approval_progress) and the agent’s vaultkit_check_approval: “Needs 2 approvals: finance_manager ✓ Ada, security waiting”. A set of groups any one of which will do is shown once (“security or data_owner waiting”).

Deciding:

While it waits:

Grants

A grant is bound to:

When its query fails to run: if a run fails, for example because a column was renamed in the database since the last scan, Activity shows the request as failed (“Approved · failed: column doesn’t exist”) and counts it under Failed. Admins see the failed run’s SQL. When the failure is about the schema (a missing column or table), the grant can’t run again as it stands. It’s marked “Fails: column doesn’t exist” on the Agents page and in the approvals history; revoke it there. It isn’t revoked automatically, because such failures are often temporary.

How long it lasts: the matching policy’s ttl, or one hour when the policy sets none. The starter pack gives allowed requests four hours.

What stays with it: masking. A field masked by policy stays masked after approval: an approval lifts the approval requirement, not the masks.

Checked every time it’s used. A grant stops working when:

In the audit log

Requests record the full query, the requester and their role, clearance, region and tenant, the environment and the decision. Events include request.received, policy.evaluated, request.rejected, request.denied, request.queued_for_approval, approval.signed_off, approval.approved, approval.denied, grant.issued, grant.reused, grant.fetch.executed and grant.revoked.

Approval events say how each sign-off was made:

{"event": "approval.approved", "approval_id": 1, "dataset": "customers",
 "signed_roles": ["data_owner"], "approver_source": "admin_fallback", "self_approval": true}