Chuyển tới nội dung chính

Engines and policy

Governance → Engine & policy is where data-access policy reaches the query engines. Each engine downloads one policy profile, a named bundle of Apache Ranger policies that egret compiles from the grants and rules you write. This page lists the engines and profiles; each engine has its own page for engine permissions, policies, overlaps, the Ranger plugin and advanced policies.

Engine and policy: the provisioned docs-trino, the external docs-trino-ext (no profile) and trino-demo-ext, and seven profiles without an engine

The area needs the policy:read permission. Writes are checked per control.

ghi chú

Egret is the Ranger admin for its engines. There is no separate Ranger server: the plugin inside Trino or StarRocks downloads the profile from egret and enforces it, including row filters and column masks.

The Engine & policy list​

The header counts engines, profiles without an engine and hand-written policies. Two sections follow.

Engines​

ColumnMeaning
EngineThe engine name. Select it to open the engine page.
TypeTrino or StarRocks.
OriginProvisioned for an engine egret runs, External for one you registered.
ProfileThe profile the engine downloads, or No profile with the hint Bind a profile in Control plane.
PluginWhether the engine's plugin is up to date (Up to date for docs-trino on the demo stack). Not judged: external, Not judged: not running or Not judged: no profile say why egret cannot tell: an external engine is not monitored, a stopped engine cannot download, and an engine with no profile has nothing to download.
Engine grantsHow many engine permissions are granted on the engine.
Hand-written policiesHow many policies in the profile were written by hand in Ranger rather than compiled by egret.

Profiles without an engine​

Profiles that no engine downloads yet, with Profile, Type, Origin (Manual for one you created, Generated for one provisioning created) and Policies columns. The profile of a deleted provisioned engine stays here, with its policies. When every profile is bound the section says Every profile is bound to an engine. A profile can be deleted from here: the confirmation says The profile and every policy in it are removed. No engine downloads it.

Create a policy profile​

Provisioned engines get their profile automatically: provisioning docs-trino created the Trino profile docs-trino and its tag service docs-trino_tag. For an engine you run yourself, you create the profile first.

  1. Press New profile.
  2. Enter a Name, for example starrocks-prod.
  3. Choose the Type: Trino, StarRocks or Tag. A Tag profile holds a Trino profile's tag-based policies; no engine is bound to it.
  4. For a Trino profile, choose its Tag service: one of the existing Tag profiles, or None. The dialog says An engine can be bound to a Trino profile only once it names a tag service: the tag profile its classification masks and row filters live in.
  5. Press Create profile.

The New profile dialog: name lake-trino, type Trino, and the Tag service picker

To create the Tag profile at the same time, press New tag profile beside the picker. The dialog switches to a Tag profile named <name>_tag (for lake-trino, lake-trino_tag). Press Create profile: the dialog says Tag profile lake-trino_tag created. and comes back to the Trino profile with the new Tag profile picked, and a second Create profile creates it. These are two separate creates, so a refusal never leaves half a pair.

The profile appears under Profiles without an engine, with origin Manual. Bind it to an engine on the engine's Settings tab in the Control Plane (see Register an external engine).

The unbound profile docs-external-policy with the 13 policies added by Seed default policies

Give a profile a tag service​

A Trino profile with no tag service cannot be bound to an engine: egret refuses with policy profile … has no usable tag service … so every tag-based column mask and row filter would silently compile to nothing, and the engine pickers list such a profile disabled. To give an existing profile one, open it and use the Tag service section of its Advanced tab (see Hand-written policies). Only an unbound profile you created can be changed there; for a profile an engine downloads, unbind the engine first.

The engine page​

Select an engine to open its page. The header shows the engine name, its Type badge, Provisioned or External, the bound Profile, the Ranger plugin version, and Open in Control plane. For an external engine a note reads egret compiles this engine's policies but cannot see whether the external engine downloads them.

For a StarRocks engine bound to a profile, a warning under the header says that official StarRocks images serve the metadata tables of Iceberg tables ($files, $partitions, $snapshots and the others) without asking Ranger, so anyone who can log in to the engine can read row counts, partition values, data file paths and each column's lowest and highest values for every table of an attached Iceberg catalog, whatever the profile's grants, masks, row filters and classifications say, and apply no mask or row filter to prepared statements; official images and Egret's earlier patched images also apply none through the HTTP SQL API or Arrow Flight SQL, let anyone read object storage through FILES() and let a masked or filtered user store a table's rows in the clear in a materialized view; images before 4.1.7-egret.4 also show a filtered user the statistics of hidden rows through EXPLAIN COSTS and let anyone reach object storage with the cluster's own identity through loads, exports and SELECT INTO OUTFILE without keys (KI-340, KI-345 to KI-348, KI-350, KI-351). It advises running the engine on Egret's patched image ghcr.io/egret-data/egret-starrocks-fe 4.1.7-egret.4 or later, or giving StarRocks logins only to people who may see these values and serving masked or filtered data through Trino (since platform #822, widened in #827 and #832). With engine:read, it is not shown for a provisioned engine on Egret's patched image ghcr.io/egret-data/egret-starrocks-fe 4.1.7-egret.4 or later (the default for new engines since platform #832), which fixes all of them; it is shown for an engine still on 4.1.7-egret.1 or 4.1.7-egret.3; an external engine always shows it, because Egret does not know its image.

The Governance page of the external StarRocks engine docs-starrocks: the warning that official StarRocks images serve Iceberg metadata tables without asking Ranger and apply no mask or row filter to prepared statements, above the tabs

The tabs are:

TabWhat it is forPage
Engine permissionsGrant capabilities such as impersonating a user.Engine permissions
PoliciesEvery policy in the profile, by source.Policies and overlaps
OverlapsMask and row-filter rules that collide.Policies and overlaps
PluginFiles and settings to install the Ranger plugin.Ranger plugin
AdvancedHand-written policies, default policies and, for a Trino profile, its tag service.Hand-written policies
MigrateMove hand-written policies into the permission model.Migrate policies

Migrate appears only while the profile holds a hand-written policy. An unbound profile has its own page with the frame of an engine page, but without Engine permissions and Plugin. A bound profile has no page of its own: its URL redirects to its engine.

The Policies tab of docs-trino: 28 policies, 12 compiled by egret and 16 seeded by egret

Make an engine serve a catalog​

Policies reach an engine only for the catalogs it serves. In Control plane → Engines → engine → Catalogs, attach the catalog (provisioned engine) or declare it (external engine). The Data page's Engines line then shows the engine, and the Governance overview stops reporting catalog is attached to no engine. See Engine detail.

How a change reaches the engine​

  1. You save a grant, rule, clearance or engine permission.
  2. Egret recompiles every profile it touches, in the same transaction. A compile that fails rolls the write back.
  3. The engine's plugin polls egret on an interval (30 seconds by default) and downloads the new policy set. Until then the engine enforces the previous one. The engine's Plugin tab shows the version each plugin last reported; confirmation takes two polls, about a minute.

On StarRocks a table change recompiles too: a create, rename, register, undrop or column change of a table that carries a classification with a clearance on the whole table recompiles the StarRocks profiles bound to its catalog, and a change whose recompile would be refused is refused at the Iceberg commit (see Clearance). A rename of a classified table or column, on either engine, recompiles Trino and StarRocks and is held until their plugins serve the result (see Renames and drops). So is a rename that copies a deny grant, mask or row filter to the new name; its allow grants move after the commit and reach the engines at their next poll (see Renames and drops on the Grants page). Egret also recompiles, at every start and one profile at a time, each StarRocks profile that reaches a whole-table classification with a clearance or one selected by a row-filter rule; a refusal there keeps the profile's previous compile and shows as Profile compile failed on the Governance overview.

Changing the profile bound to an engine recompiles both the old and the new profile. If that would leave two mask or row-filter rules deciding one column differently, egret refuses and changes nothing.

Limits and known issues​

  • Egret cannot see whether an external engine downloads its profile. The Governance overview's plugin checks are Not judged for external engines.
  • Profiles created in the console cannot be bound to Trino engines (see the warning above).

Further reading​