Bring your own cloud: Permissions and security
KiviDB works in your AWS account only through the KiviDBManagement-<connection ID> role that you create from its CloudFormation template (connections made…
KiviDB works in your AWS account only through the KiviDBManagement-<connection ID>
role that you create from its CloudFormation template (connections made before
October 2026 use a role named just KiviDBManagement). This page explains what that role
allows, in plain terms. The template itself is the authority: download it from
Settings → Cloud accounts and read it, or have your security team review it.
Who can use the role
- Only KiviDB's own two roles, named in the stack's parameters, can use it.
- Only when they present your connection's ExternalId, a secret unique to that connection. Another KiviDB customer cannot point KiviDB at your account.
- Each session lasts at most one hour.
Limits that apply to everything
- Your regions only. The role works only in the regions you listed in
AllowedRegions. - KiviDB's resources only. Anything the role creates must carry the tag
managed-by=kividbfrom the moment it is created, and the role can change or delete only resources that already carry that tag. - No tagging your resources into scope. The role can add tags only while
creating a resource. On its own resources it can update other tags, but it can
never add or remove
managed-byon anything.
What the role can do
Look around, read-only. Describe EC2 and Auto Scaling resources in your regions, such as VPCs, subnets, availability zones and images, to place databases correctly. It also looks up the current Amazon Linux image that AWS publishes.
Create, tagged managed-by=kividb. EC2 instances, EBS volumes and
snapshots (and copies of them), security groups, Elastic IPs and launch
templates. Launching an instance into your subnet uses your VPC and subnet
without changing them.
Manage what it created. Start, stop, reboot and terminate its instances; attach, resize and delete its volumes; delete its snapshots; change the rules of and delete its security groups; associate and release its Elastic IPs; update and delete its launch templates.
Run read replicas (Pro). Create Auto Scaling groups tagged
managed-by=kividb, and resize, update and delete only those groups.
Create one AWS-defined role. The first Auto Scaling group in an account
needs AWSServiceRoleForAutoScaling, the service-linked role AWS itself
defines. The role can create that one role and no other.
Use your backup bucket. Read, write and delete objects under kividb/ in
the bucket you named, and list the bucket and look up its region. It cannot
read, change or delete anything outside kividb/, and it has no access to any
other bucket.
What the role cannot do
- Create, change or delete IAM users, roles, policies or access keys, apart from the one Auto Scaling service-linked role above.
- Stop, change or delete any resource that is not tagged
managed-by=kividb: your instances, volumes, snapshots, security groups and addresses are out of reach. - Change your VPCs, subnets, route tables, internet gateways or network ACLs.
- Do anything in regions you did not list.
- Use your other AWS services or the data in them, such as databases, functions, queues, secrets or other S3 buckets.
The database machines themselves get no AWS role or credentials of their own.
Revoke access
Delete the CloudFormation stack. The role is deleted with it, and from then on KiviDB cannot act in your account at all.
Databases that are running keep running, because they are in your account, but KiviDB can no longer manage them: no failover, recovery, backups, resizing or deletion. To shut down cleanly, delete the databases and backups in KiviDB first, then disconnect the account, then delete the stack.
If you delete the stack first, you can find and remove everything KiviDB
created by the tag managed-by=kividb, for example with Resource Groups &
Tag Editor in the AWS console. Backups are under kividb/ in your bucket.
Disconnect an account
Settings → Cloud accounts, open the connection, Disconnect. You can disconnect an account only when no databases run in it and no backups are stored in it; delete those first. Disconnecting removes the connection from KiviDB. It does not delete the CloudFormation stack: delete that in AWS yourself to remove the role.
To connect the same account again later, start a new connection. It gets a new ExternalId, so update the stack's parameters, or create a new stack, with the new values.
Updating the role
When KiviDB needs a new permission, it publishes a new version of the role template. To update your role:
- Settings → Cloud accounts, open the connection, Download template.
- In CloudFormation, select your stack, Update, Replace existing template, and upload the new file.
- Keep the same parameter values and finish the update.
- Back in KiviDB, click Check again.
Network security
- KiviDB does not change your VPC, subnets or routes. Each database gets its own security group, which allows your VPC on the database's ports, the addresses on the database's allowlist, and KiviDB, so the console can manage the database.
- Every client must authenticate with a password. TLS can be turned on or required in Configuration.
- Database contents stay on disks in your account. KiviDB receives the metrics and logs it shows in the console.
Google Cloud
In a Google Cloud project, KiviDB works as the service account kividb-mgmt,
which you create with KiviDB's setup script or Terraform module. KiviDB's own
service account may impersonate it: it holds the Service Account Token
Creator role on kividb-mgmt and on nothing else in your project. No key is
ever created, so there is no credential to leak or rotate. Every token KiviDB
gets lasts at most one hour.
kividb-mgmt holds three custom roles. The permissions in them are exactly the
calls KiviDB makes, and the setup script, the Terraform module and the
Verify check all read them from one list.
kividbManagement: Compute Engine, kividb- names only. This role lets
KiviDB:
- create, start, stop, reset, resize and delete virtual machines
- create, resize, snapshot and delete disks
- create firewall rules for a database's allowlist
- create instance templates for read replicas
It is granted with an IAM condition, so each action works only on instances,
disks, snapshots, firewall rules, instance templates, forwarding rules and backend
services whose names start with kividb-. Your own resources are out of reach.
Everything KiviDB creates is named kividb-…, including the read replicas a
managed instance group starts (kividb-<id>-r-…), their disks and every disk
snapshot.
kividbManagementProject: project-wide. These permissions have no
condition, because Google Cloud cannot limit them by name:
- reads of your network, subnets, routes, routers and machine types
- listings
- waiting on operations
- static external addresses and managed instance groups (read replicas)
- using your subnet for a database's network interface and public address
- adding firewall rules to your network
- reading which APIs are enabled and which organization policies apply, which Verify uses
kividbBackups: your bucket, kividb/ only. This role is granted on the
backup bucket alone, with a condition. KiviDB can read, write and delete objects
under kividb/, and read the bucket's location. It cannot touch anything else in
the bucket, or any other bucket.
What Google Cloud cannot limit
These are limits of Google Cloud's IAM, stated plainly so your security review does not have to discover them:
- Listings show everything of that kind. For example, listing instances returns every VM in the project, with its metadata. IAM cannot filter a list.
- Static external addresses and managed instance groups cannot be limited by
name. KiviDB only ever creates, changes and deletes ones named
kividb-…, and finds them by label. Only a separate project would enforce that in IAM. - Listing the backup bucket covers the whole bucket, not just
kividb/. Reading and writing objects is limited tokividb/. To keep even the names of other objects private, use a bucket only for KiviDB.
What kividb-mgmt cannot do
- Change IAM: no role, policy or key of any kind, and it cannot act as any other service account. KiviDB's machines run with no service account at all.
- Change your networks, subnets or routes, or enable or disable APIs.
- Create or delete buckets, or touch other Google Cloud services.
Labels
Everything KiviDB creates in your project that can carry labels (VMs, disks,
static addresses, snapshots, and the VMs and disks a replica template creates)
is labelled managed-by=kividb, kividb-cloud-account-id=<connection id> and
kividb-instance-id=<database id>. Firewall rules, instance templates and
managed instance groups cannot carry labels in Google Cloud; they are named
kividb-<id>-…. When KiviDB deletes a database it removes only resources whose
names start with kividb-, even if something else carries one of its labels.
Revoke access on Google Cloud
Delete the kividb-mgmt service account, or remove KiviDB's Token Creator grant
on it. From then on KiviDB cannot act in your project at all. With Terraform,
terraform destroy on the module removes the account, the roles and every grant.
It leaves the APIs enabled, because other things in your project may use them.
Databases that are running keep running, but KiviDB can no longer manage them.
To shut down cleanly, delete the databases and backups in KiviDB first, then
disconnect the project, then remove the access. If you remove access first, find
what KiviDB created by the label managed-by=kividb and the kividb- name
prefix; backups are under kividb/ in your bucket.
Azure
In an Azure subscription, KiviDB works as its own multi-tenant app, KiviDB, which you bring into your tenant with KiviDB's setup script, Terraform module or admin-consent link. KiviDB signs in to your tenant as that app, with a secret that never leaves KiviDB. Nothing of yours is created that could leak: no key, no secret, no password.
The app holds three custom roles and two built-in ones. The actions in the custom roles are exactly the calls KiviDB makes, and the setup script, the Terraform module and the Verify check all read them from one list.
KiviDB management: your resource group only. Assigned on the one resource group you named, and nowhere else. It lets KiviDB:
- create, start, power off, deallocate, restart, resize and delete virtual machines, and read their boot diagnostics
- create, scale and delete Flexible scale sets for read replicas
- create, resize, snapshot and delete disks
- create and delete a network interface, a public IP and a network security group for each database node
- list what is in the resource group, so deleting a database can prove nothing it owned was left behind
KiviDB subscription reads: read-only. Assigned on the subscription. It lets KiviDB read which resource providers are registered, compute quota and VM sizes, Azure Policy assignments, your virtual networks, subnets and route tables (to verify the network you chose), and the status of its own long-running operations. It cannot change anything.
KiviDB subnet join: your subnets only. Assigned on each subnet you named. It lets KiviDB place a network interface in that subnet, and nothing else.
Storage Blob Data Contributor: your backup container only. KiviDB writes,
reads and deletes its backups, under kividb/.
Storage Blob Delegator: your backup storage account. Lets KiviDB sign short-lived links (user delegation SAS) so a database node can upload or download its own backup. It grants no data access by itself, and KiviDB never reads the account's keys.
What Azure cannot limit
- The boundary is the resource group, not names. Azure RBAC has no general condition on resource names, so KiviDB's management role covers everything in its resource group. Put nothing there that KiviDB should not manage.
- Regions. RBAC cannot limit regions. Choosing regions in KiviDB is what limits where databases go; to enforce it on your side, assign the Allowed locations policy on the resource group. Verify checks that it allows the regions you chose.
- Network reads are subscription-wide. KiviDB can read the virtual networks, subnets and route tables in the subscription, not only the ones you named.
What the KiviDB app cannot do
- Assign roles, change Azure Policy, or read storage account keys.
- Create, change or delete virtual networks, subnets, route tables or NAT gateways, or create resources outside its resource group.
- Run commands on, or install extensions in, any machine.
Tags
Everything KiviDB creates in your resource group (virtual machines, scale sets,
disks, network interfaces, public IP addresses, network security groups and
disk snapshots) is tagged managed-by=kividb and
kividb-cloud-account-id=<connection id>. Each database's network interfaces
go in the subnet you named for its region.
Revoke access on Azure
Delete the KiviDB application from your tenant (Microsoft Entra ID, Enterprise
applications, KiviDB, Properties, Delete), or remove its role assignments. From
then on KiviDB cannot act in your subscription at all. With Terraform,
terraform destroy on the module removes the app, the roles and every
assignment (and the resource group, if the module created it).
Databases that are running keep running, but KiviDB can no longer manage them.
To shut down cleanly, delete the databases and backups in KiviDB first, then
disconnect the subscription, then remove the access. If you remove access first,
find what KiviDB created by the tag managed-by=kividb in the resource group;
backups are under kividb/ in your container.