How to Configure Couchbase Read Only User

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a couchbase read only user by assigning reader roles to an account. These built-in roles let users read bucket documents or cluster settings without changing data. Many engineering teams share one broad admin login during urgent production checks. Broad permissions create high risk because one wrong query can delete or alter records. Setting up strict read roles stops accidental writes before they happen. How a couchbase read only user works in practice Couchbase uses role-based co

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.

You set up a couchbase read only user by assigning reader roles to an account. These built-in roles let users read bucket documents or cluster settings without changing data. Many engineering teams share one broad admin login during urgent production checks. Broad permissions create high risk because one wrong query can delete or alter records. Setting up strict read roles stops accidental writes before they happen.

How a couchbase read only user works in practice

Couchbase uses role-based control to manage what each database account can do. Admins create a user profile and pick where the account lives. Local accounts live inside the cluster, while external accounts link to central directory groups. Next, the admin attaches specific read roles to that user profile. A cluster read role lets someone view node health, bucket lists, and cluster status. That role does not let the user read actual data inside the buckets.

To allow data queries, the admin assigns a data reader role instead. Admins can scope this role to the whole cluster or to one bucket. You can narrow the scope further down to a single scope or collection. If the user runs queries, they also need a query select permission. This combination lets analysts and engineers run read statements without modifying any documents. When the user logs in, the database checks these roles on every request.

What native read roles solve and what they miss

Native database roles do a great job of blocking destructive write commands. An engineer with a reader role cannot drop a bucket or update records. This setup protects data integrity during routine debugging and reporting tasks. Still, static database roles only decide who can log in and read tables. They do not inspect what individual statements return while queries run in flight.

A read role still returns full documents from every allowed collection. Those documents often hold sensitive values like emails, phone numbers, and card numbers. Anyone with a reader login can pull full copies of this private data. Admins also struggle to manage dozens of static passwords across big teams. Shared read passwords still hide which specific person ran an expensive query. Also, native roles stay active all the time instead of expiring after a task.

Read-Only Root Filesystem + User Provisioning (SCIM): architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Scoping permissions and auditing database queries

Good access control starts with narrowing permissions to the smallest possible collection. Teams should separate cluster monitoring roles from data reading roles right away. Engineers who check server metrics do not need to read customer documents. Support staff who look up orders only need read rights on order collections.

Teams also need clear visibility into every query that hits production buckets. Native audit logs often require extra setup and use lots of disk space. Even with logs turned on, tying a shared database user to one person is hard. Reviewing raw data exposure also requires active data masking on query results. Masking rewrites matched fields like national IDs in results before they reach the screen. Combining narrow read roles with query-level controls closes the remaining security gaps.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev sits inline in the wire protocol beside those services as an open-source proxy, a sidecar for your Postgres or API. On every query an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Can a couchbase read only user run query statements?

Yes, if you assign both data reader and query select roles to the account. This pair lets the user run select queries on allowed buckets without changing data.

What is the difference between cluster read and data reader roles?

A cluster read role lets users view server metrics, node status, and settings. A data reader role lets users read actual documents stored inside buckets and collections.

Do read roles hide sensitive fields inside documents?

No, native read roles return the entire document to the user. To hide fields like card numbers or emails, you need field-level data masking in place.

The query runs. The emails stay hidden.