Configure Deny Policy Dominance for Trino on EMR¶
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 the deny.dominates.in.any 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 Manager is installed.
-
Navigate to the Privacera Manager configuration directory:
Bash -
Open the EMR 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:
To enable deny policy dominance for Trino on EMR, set EMR_TRINO_RANGER_PLUGIN_OPTION_DENY_DOMINATES_IN_ANY to true in the EMR bootstrap actions.
-
Update the
BootstrapActionsconfiguration in the EMR template as shown below. Then, create a new EMR cluster with this template:privacera-emr-bootstrap-actions-trino-deny-dominates-in-any
Note
- Set to
trueto enable deny-dominates behavior: an explicit deny policy takes precedence over an allow policy for access types set to_any(for example,SHOW TABLES). - Omitting this export (default) retains allow-dominates behavior.
- Set to
-
After updating the configuration, follow the setup steps starting from the Create EMR Cluster for triggering an EMR cluster.
Verification¶
After creating an EMR cluster with this configuration, verify the setting on the master node:
-
SSH into the EMR master node.
-
Run the following command to check both the Trino and Hive Ranger security configurations:
When enabled, you should seeBash <value>true</value>for both properties:
- Prev topic: Advanced Configuration