Configuring enabled Ranger services and custom service repositories¶
Overview¶
On Self-Managed deployments, Apache Ranger Admin creates service definitions, default privacera_* service repositories, and internal service users during startup. By default, Ranger creates the full set of Privacera service definitions except kms.
Use RANGER_ENABLED_SERVICES when you want Ranger to create only the service definitions and default repositories you actively use, similar to a Cloudera-style Ranger deployment. This reduces unused service definitions and avoids creating internal users for services you do not enable.
Use the Portal Add Service workflow when you need an additional service repository with a custom name (for example, dev_s3 or privacera_snowflake_prod) for policy isolation or multiple connector instances.
Note
RANGER_ENABLED_SERVICES applies to Self-Managed deployments where Privacera Manager configures Ranger Admin, and needs a Ranger Admin image that supports ranger_enabled_services. Older images ignore the variable without an error. PrivaceraCloud does not read this variable, but Ranger no longer creates the kms service definition there either.
Limit service definitions created at startup¶
Configure RANGER_ENABLED_SERVICES¶
Perform the following steps to limit which service definitions and default repositories Ranger creates at startup:
- SSH into the instance where Privacera Manager is installed.
- Navigate to the
privacera-managerdirectory:
| Bash | |
|---|---|
- Copy the sample vars file if you have not already (
-navoids overwriting an existing file):
| Bash | |
|---|---|
If config/custom-vars/vars.ranger.admin.yml already exists from an older release, cp -n leaves it unchanged and the file might not include RANGER_ENABLED_SERVICES. You add that variable in the next step.
- Open the custom vars file for editing:
| Bash | |
|---|---|
- Set
RANGER_ENABLED_SERVICES. Uncomment the line in the sample if it is present, or add it by copying the commented block from the currentconfig/sample-vars/vars.ranger.admin.ymlwhen your custom file has no line to uncomment. Use a comma-separated list of service-definition names (not Privacera Manager directory names). For example,starburst-enterprise-prestois valid;starburstenterpriseprestois not.
| Variable | Definition |
|---|---|
RANGER_ENABLED_SERVICES | Service-definition names Ranger may create at startup. Rendered into Ranger Admin install.properties as ranger_enabled_services. |
The sample file includes a commented line with every valid name. Copy from that comment and remove services you do not need.
- Update Privacera Manager so Ranger Admin restarts with the new setting:
Behavior¶
| Setting | Result |
|---|---|
| Unset, empty, or commented out | Same as before this feature, with two changes. First, the kms service definition, privacera_kms, and the Ranger padmin user are not created at startup. Second, on a new install, the default privacera_s3 policy (all - bucketname, objectpath) grants only the s3 user, not hive and presto; add them to that policy if your workloads rely on it. Built-in definitions follow policymgr_supportedcomponents (shipped default includes tag, hive, s3, presto). Privacera definitions from startup include all supported connectors except kms. |
| Non-empty list | Ranger creates only the listed service definitions plus tag. The gds definition is created only when gds is in the list. The hive definition is created only when hive is in the list. Each enabled Privacera connector service gets its default privacera_* repository and service user (for example, privacera_s3 and user s3). For Apache built-in names such as hdfs, atlas, or nestedstructure, only the service definition is created. |
kms in the list | Ignored with the warning WARN service-def 'kms' is not created. kms is never created on Self-Managed startup. A list that names only kms stops Ranger Admin startup with ERROR ranger_enabled_services has only kms; at least one valid service name is required; exiting. |
| Invalid name | Ranger Admin fails startup before database setup completes. The Admin container log names the bad entry with WARN unknown service-def '<name>' in ranger_enabled_services, followed by ERROR ranger_enabled_services has an unknown name. Correct vars.ranger.admin.yml and run the update again. On Kubernetes, the container restarts, so use kubectl logs --previous on the Ranger Admin pod. |
The tag service definition is always included when the list is non-empty, because tag-based policies are stored on the tag definition and apply to resources in the services you enable.
On an existing install, definitions, repositories, and users already in the Ranger database are kept on upgrade; startup never deletes them. This includes an existing privacera_kms and padmin.
Verify the configuration¶
- After Ranger Admin restarts, check the Admin container log for the list Ranger uses. Names are lower-cased, de-duplicated, and sorted, and
tagis added. The line appears only when the list is not empty:
| Text Only | |
|---|---|
On Kubernetes, use kubectl logs on the Ranger Admin pod. On Docker, use docker logs on the Ranger Admin container.
-
In the Privacera Portal, go to Access Management → Resource Policies and confirm that only the expected service types and default repositories are present.
-
If you previously ran with a broader list, definitions and repositories that are no longer in the list are not deleted automatically. The Admin log reports them with lines such as:
| Text Only | |
|---|---|
To remove definitions and service users you no longer need, use the Ranger REST API as a Ranger admin user. Delete only service definitions named on WARN service-def '…' not in ranger_enabled_services lines. Do not delete definitions that appear only on INFO service-def '…' is not managed lines (for example, kms or a customer-defined definition).
Before each delete, export policies for every repository listed on that WARN line:
| Bash | |
|---|---|
Delete one service definition at a time. Do not restart Ranger Admin during a delete. After each delete, wait until a GET on that definition returns 404 before you start the next delete or remove the service user. Back-to-back force deletes can leave Ranger Admin unreachable.
| Bash | |
|---|---|
<user> is the repository's service user (for example, s3). Confirm the name is not a real user synced from your directory (for example, an account named hive or postgres) before you delete it.
| Text Only | |
|---|---|
1 2 3 4 5 | |
One-time cleanup
Removing definitions and service users that are outside your RANGER_ENABLED_SERVICES list is a one-time activity after you first apply a restricted list. While the list stays set, Ranger Admin does not recreate those services on later restarts; each restart creates only the definitions and default repositories that match your list (plus tag when the list is non-empty). If you later clear RANGER_ENABLED_SERVICES or leave it empty, the next restart uses the default startup path again and recreates every service definition, repository, and service user that the default path would create, including any you deleted earlier.
Valid service-definition names¶
Use the names from the commented sample in vars.ranger.admin.yml. Common Privacera connector names include s3, hive, presto, trino, snowflake, postgres, redshift, bigquery, databricks_sql_analytics, databricks_unity_catalog, lakeformation, adls, gcs, files, and starburst-enterprise-presto. Built-in Apache-style names include hdfs, kafka, atlas, and nestedstructure.
Add a custom service repository in Ranger Admin¶
When you need a custom repository name (not only the default privacera_<service> created at startup), create the repository in the Portal. Connectors and plugins can then point to that name in their configuration.
Perform the following steps:
- Log in to the Privacera Portal.
- Go to Access Management → Resource Policies.
- Under the connector or plugin type (for example, S3 or SNOWFLAKE), select the more menu (), then Add Service.
- On Add Service, set:
- Service Name: Your custom repository name (for example,
dev_s3orprivacera_snowflake_prod). - Active Status: On.
- Select Tag Service: the same tag service as the default repository, normally
privacera_tag. If you leave it empty, tag-based policies, including deny and masking, are not enforced for this repository. - Username: The service user for that repository (for example,
s3for S3). - Common Name for Certificate:
Ranger. - Select SAVE.
Configure the connector or runtime plugin to use the same service name (for example, ranger.policysync.connector.0.ranger.service.name or the connector-specific property documented in that connector's advanced configuration).
For multiple repositories per connector type and policy isolation patterns, see Multiple Ranger policy repositories.
- Prev topic: Advanced Configurations
- Next topic: Troubleshooting