Configure Deny Policy Dominance for Trino¶
Overview¶
By default, when Apache Ranger evaluates policies for operations that use the _any access type (for example, SHOW TABLES, SHOW SCHEMAS), an allow policy takes precedence over a deny policy for the same resource.
This feature reverses that behavior — when enabled, an explicit deny policy overrides any matching allow policy. This is useful when you want to enforce fine-grained exclusions within a broadly permitted resource scope, such as hiding specific tables inside a schema that is otherwise fully accessible.
Default behavior
This feature is disabled by default. Allow policies dominate deny policies unless explicitly configured.
How It Works¶
Consider a Hive schema with the following Ranger policies:
| Policy | Type | Scope |
|---|---|---|
| Policy 1 | Allow | All tables in the schema |
| Policy 2 | Deny | A subset of tables in the same schema |
The outcome of a SHOW TABLES query depends on this setting:
| Setting | Outcome |
|---|---|
"false" (default — allow dominates) | All tables are listed, including those covered by the deny policy |
"true" (deny dominates) | All tables are listed except those explicitly denied in Policy 2 |
Configure the Setting¶
-
SSH to the instance where Privacera is installed.
-
Navigate to the Privacera Manager configuration directory:
Bash -
Open the Trino variables file for editing:
Bash -
Uncomment and set the following property:
YAML Note
- Set to
"true"to enable deny-dominates behavior: an explicit deny policy takes precedence over an allow policy for access types set to_any(for example,SHOW TABLES). - Set to
"false"(default) to retain allow-dominates behavior.
- Set to
-
Apply the configuration by running the Privacera Manager post-install commands:
-
Now rebuild the image and redeploy the application.
- for Open Source Trino: click here
- for Starburst Trino: click here
Verification¶
After applying the configuration, verify the setting on the Trino coordinator node:
-
SSH into the Trino coordinator node.
-
Run the following command to check both the Trino and Hive Ranger security configurations. Use the path that matches your deployment:
When enabled, you should seeBash <value>true</value>for both properties:When enabled, you should seeBash <value>true</value>for both properties:
- Prev topic: Advanced Configuration