How to Configure YugabyteDB Backup User

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up a yugabytedb backup user, create a database role with read rights. Then grant that role permission to read tables and run snapshot exports. Many engineering teams start by using the main admin account for scheduled backups. This shortcut works at first, but it creates a big security risk. An admin account can drop tables, change schemas, or delete whole databases. If a backup script or server gets compromised, attackers gain full control. A dedicated backup role limits what the backup

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

To set up a yugabytedb backup user, create a database role with read rights. Then grant that role permission to read tables and run snapshot exports. Many engineering teams start by using the main admin account for scheduled backups. This shortcut works at first, but it creates a big security risk. An admin account can drop tables, change schemas, or delete whole databases. If a backup script or server gets compromised, attackers gain full control. A dedicated backup role limits what the backup tool can do.

How a yugabytedb backup user works

YugabyteDB splits its design into two main API layers for different workloads. One layer handles relational data and uses standard SQL roles and privileges. The other layer handles wide-column data and uses its own role system. When you set up a backup account, you must match your API layer. For the relational layer, you create a login role inside the cluster. You then grant read access across all tables in your target schemas. You also grant usage rights on schemas and sequences so dumps succeed.

Logical backups read table rows and schema rules through client tools. The backup role logs in, reads the current state, and writes files out. Distributed snapshots work at the storage layer instead of reading row by row. These snapshots copy tablet data files and upload them to cloud object storage. If you run snapshots through the management platform, the platform handles storage keys. If you run logical dumps from a host, the database role needs read rights. Teams often combine both methods to cover fast recovery and long-term archives.

Scoping permissions for backup jobs

A good backup role should never have write or delete permissions. You can group the needed read privileges into a single shared role. Then you assign that role to the specific user account for backups. When teams add new tables, default privileges help keep the backup role updated. Without default rules, new tables might get skipped during the next dump run.

Teams also need to secure how the backup host logs in. Storing plain text passwords in cron scripts puts the cluster at risk. Using TLS client certificates or external secret stores helps protect those login keys. You should also restrict which IP addresses can use the backup account. Network rules ensure that only the designated backup runner can log in.

User Provisioning (SCIM) + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native database roles solve and what they leave open

Native database roles do a great job of blocking unwanted write commands. A read-only backup account cannot drop a production table or alter rows. This setup satisfies basic least-privilege rules for automated background jobs. It also separates backup traffic from standard app traffic in basic connection logs.

Still, native database roles only check who logs in at the start. Once the session starts, the role can read every column in every table by default. A backup role must read everything to do its job well. If a human engineer uses those same keys, they read raw sensitive data. Native roles cannot rewrite emails, phone numbers, or card numbers in flight. They also do not tie shared service logins back to a single person. Teams still need a way to govern live queries and audit human sessions.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev sits inline in the protocol beside each supported service as an open-source proxy, a sidecar for your database or API. For every query or command an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human approval.

First, hoop.dev guardrails block banned queries before they run or hold risky ones for review, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

Does a yugabytedb backup user need admin rights for logical dumps?

No, a logical dump only requires read access to schemas, tables, and sequences. You can grant read-only privileges across the target database instead of full admin rights.

How do new tables get included in backup user permissions?

You can set default privileges on the schema for future tables and sequences. This rule grants read rights to the backup role whenever someone creates a table.

Can one backup role cover both SQL and wide-column APIs in YugabyteDB?

No, the two API layers manage users and roles in separate internal catalogs. You must create and scope a distinct backup account in each layer you use.

The query runs. The emails stay hidden.