Skip to main content

Database Data ProtectionSensitive data. Gated and masked.

At the database layer, data protection comes down to two controls. Gate decides who can reach the data, and for how long. Mask decides what they see when they do.

Database data protection architecture

Two controls. One sensitive dataset.

Gate

Who can connect, with what role, for how long. Just-in-time grants replace standing credentials. Requests carry a stated reason, route to an approver, expire on a clock. Standing privileges fall to near zero; every access has a documented trail.

Mask

What's actually returned. Dynamic data masking transforms sensitive values at query time based on the requester's role — full value for one user, hashed for another, last-four for a third. The data at rest does not change; the SELECT result does.

Database data protection in Bytebase

Gated at request. Masked at query.

Bytebase sits in front of the database and runs both controls. Access requests carry a database, a role, and a duration; an approver signs off and the grant expires automatically. At query time, masking rules — written as CEL conditions on environment, project, table, column, or classification — transform sensitive values based on the requester's role.

One workflow. Every engine.

Database data protection questions

Common questions.

What is database data protection?
Database data protection is everything that keeps sensitive values from reaching people or systems that shouldn't have them. The big buckets are encryption (at rest and in transit), access control (who can connect at all), and result-set control (what those who connect actually see). This series focuses on the last two, where most production-incident risk sits — the others are usually solved at the infrastructure layer by the cloud provider or the application stack.
When do I need both gate and mask, vs. just one?
Gate alone is enough when every approved user is allowed to see every value in the columns they query — typical for back-office tools where the role itself signals trust. You need mask on top when different users are allowed to query the same column but should see different things — analysts get hashed emails, support sees the last 4 digits, fraud investigators see the full value. JIT gating + DDM are complementary: JIT keeps standing access near zero; DDM filters what the granted access actually returns.
How does this differ from row-level security (RLS)?
RLS hides whole rows based on a policy. Masking transforms specific column values without hiding the row. Postgres, SQL Server, and Oracle support RLS natively, but engine-native RLS comes with performance footguns and bypass risks (see the linked Postgres RLS posts). A workflow gateway sits in front of the database and applies masking and gating policies that work the same way across engines, with a centralized audit trail.

Explore the standard for database development