Skip to content

A scenario for a forward deployed engineer · Mid level and up

The app shows everyone everything

Vault · Security
Thursday, 11:10

A customer's HR app on Databricks Apps queries Unity Catalog tables with the app's service principal, which can read all of them. A team lead opened it and saw the salaries of the whole company.

What do you do?

Tap the one you would do. The answer opens below.

Show the best call

Turn on user authorization, so queries run as the signed-in user and Unity Catalog decides what each one sees.

The team lead sees their own team. Row filters and column masks on the tables apply with no code in the app.

Why

A Databricks app can act in two ways. With app authorization it uses its service principal, and every user shares that access. With user authorization (also called on-behalf-of-user) Databricks forwards the user's token, within scopes the app declares, and Unity Catalog enforces that user's permissions, row filters and column masks included.

Read it in the Databricks docs (opens in a new tab)

The other two

Works, at a price. Filter the rows in the app's code by the user's department.
It works for this screen. Every new query needs the same filter, and one day one is missed.
A poor call. Hide the salary column on the app's page.
The column is hidden and still in the response. Someone opens the browser's network tab.

The words in this scenario

Unity Catalog.
The part of Databricks that governs data: who may see and change which tables and files, where data came from, and who did what. In the docs (opens in a new tab)
Service principal.
An identity made for automation, not for a person. Jobs and tools sign in as one. In the docs (opens in a new tab)

Go deeper on brickster.ai

More scenarios

Had one like this at work? Send it to us: the best tickets come from real incidents.

Added on . Checked against the Databricks documentation on . brickster.ai is independent and is not affiliated with Databricks.