How to Configure Couchbase Drop Table Protection

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up couchbase drop table protection by limiting bucket and collection admin roles. You give users read and write access without schema change rights. Most teams start by sharing one broad admin account across several apps. When a role has too much power, one bad query can wipe out a collection. How native couchbase drop table protection works Couchbase groups data into buckets, scopes, and collections. Collections work much like tables do in relational databases. Native access control

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 couchbase drop table protection by limiting bucket and collection admin roles. You give users read and write access without schema change rights. Most teams start by sharing one broad admin account across several apps. When a role has too much power, one bad query can wipe out a collection.

How native couchbase drop table protection works

Couchbase groups data into buckets, scopes, and collections. Collections work much like tables do in relational databases. Native access control ties user accounts to specific roles at each level. To stop drops, you must take away full admin roles from daily users. You assign data reader and data writer roles instead.

Data roles let apps read, insert, and update JSON documents. These roles do not allow users to drop collections or flush buckets. You can scope these roles down to a single collection. This setup keeps a user in one area of the cluster. If someone runs a drop statement, the database rejects the command right away.

You should also turn off the bucket flush setting on production data. Flushing deletes every document inside a bucket at once. Even if a user gets admin rights, disabling flush adds a safety check. For automated scripts, teams create separate service accounts with strict scope rules.

Where native role setups fall short in daily work

Native role limits work well for standard app traffic. They decide who can log in and which buckets they can touch. Still, they do not inspect individual queries after a privileged user logs in. Database admins and migration tools still need schema change rights to do their jobs.

During an outage, an engineer might log in with an admin role to fix data. While logged in, nothing stops an accidental drop collection command from running. Shared admin accounts make this risk much worse. You cannot tell which person on the team ran the bad statement.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Static roles also struggle when someone runs a bulk delete query. A user with data writer rights cannot drop a collection. Yet that same user can still run a delete statement without a filter. That query removes every record while keeping the empty collection around. Native roles see a valid write command and let it pass. Teams also need data masking to rewrite emails, phone numbers, card numbers, and national IDs in results.

Managing schema changes without broad admin roles

To lower risk, teams separate daily queries from schema updates. Engineers use read roles for routine checks. When a collection needs a change, the team uses a review process. No one keeps permanent drop rights on their personal account.

Good logging is also key for database safety. You need to log every query along with the person who ran it. Native logs often show the shared database user instead of the real person. Linking every command to a single person helps teams audit changes fast.

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

What is the Couchbase equivalent of a drop table command?

Couchbase stores records in collections instead of tables. Dropping a collection or a bucket removes all records inside that container.

Can a user with write access still wipe out collection data?

Yes, a data writer role cannot drop the collection itself. Still, that user can still run a delete query that removes every document.

How do we run schema migrations if we block drop commands?

Teams keep drop rights off human accounts during normal work. They require peer approval before running a schema drop in production.

The query runs. The emails stay hidden.