Access Control
Overview
Apache Gravitino federates the catalogs of many systems under a single metalake, so permissions are defined once there rather than separately in each system. When authorization is enabled, the server checks every request before the operation runs and rejects it if the caller is not entitled to it.
Two things decide the answer:
- Ownership comes with creation. Whoever creates an object owns it, and owning it carries the right to alter it, drop it, and hand it to someone else. Ownership reaches down, so owning a catalog means administrative control over the schemas and tables inside it.
- Privileges are named permissions, each authorizing one kind of operation:
SELECT_TABLEreads a table,CREATE_SCHEMAcreates a schema in a catalog. A privilege is never given to a person directly. Privileges are collected into a role, and the role is granted to users and to groups.
Three rules govern how those apply:
- Grants reach downward. A grant covers everything beneath the object it is made on, both what
exists now and what is created later.
SELECT_TABLEon a schema covers every table in it. - Nothing is permitted unless granted. A user added to a metalake and given nothing can see the metalake and nothing else.
- An explicit deny overrides everything. Each privilege in a role carries an
ALLOWor aDENYcondition, and aDENYbeats anALLOWheld in any other role and at any other level of the hierarchy. A denial cannot be undone by granting something elsewhere, which makesDENYthe way to carve one object out of a broad grant.
Roles, users, and groups each have a page of their own: Roles covers the privileges and what they allow, Users covers service administrators and membership, and Groups covers where group membership comes from.
Quick Start
Authorization is off by default. Turn it on in ${GRAVITINO_HOME}/conf/gravitino.conf, name at least
one service administrator, and restart the server:
gravitino.authorization.enable = true
gravitino.authorization.serviceAdmins = {admin_user}
Service administrators are the only users who can create metalakes, and everything after that is done through the API. The Walkthrough runs a full sequence end to end, from an empty server to a user with read access to one schema. Server Configuration covers the remaining settings, including how a caller's identity reaches the server.
Authorization Model
Principals and Objects
Users and Groups
Users and groups are the principals that privileges and ownership are assigned to. A user must be added to a metalake before it can do anything there, and a role granted to a group applies to every member. See Users and Groups.
Objects
Everything Gravitino manages is an object with a type and a name. The name is the dotted path to it
below the metalake, so a table is {catalog}.{schema}.{table}, and requests identify an object by
both type and name, since the same name can exist at more than one type.
Access to an object is controlled by privileges, granted through roles, and by ownership. Ownership behaves like a privilege that arrives with the object rather than one you grant, and it carries the administrative rights, altering, dropping, and transferring, that no privilege name covers.
Everything sits under a metalake, but only the data objects nest below a catalog:
Metalake (top level)
├── Catalog (represents a data source)
│ └── Schema
│ ├── Table
│ ├── View
│ ├── Topic
│ ├── Fileset
│ ├── Model
│ └── Function
├── Tag
├── Policy
├── Job Template