- Ranger Admin: the core module of Ranger with a built-in web page. Users can create and update security policies on this page or through a REST interface. Plugins of various components of the Hadoop ecosystem poll and pull these policies at a regular basis.
- Agent Plugin: plugins of components embedded in the Hadoop ecosystem. These plugins pull security policies from Ranger Admin on a regular basis and store the policies in local files. When users access a component, the corresponding plugin assesses the request based on the configured security policy and sends the authentication results to the corresponding component.
- User Sync: used to pull user and user group information, and synchronize the permission data of users and user groups to Ranger’s database.
- Creates access policies, masking policies, and row-level filter policies through Apache Ranger.
- Ranger audit logs.
- Ranger Servers that use Kerberos for authentication are not supported.
- Ranger policy conditions that are evaluated by JavaScript are not supported, such as the
expressioncondition and theaccessed-after-expirycondition of tag-based policies. See the note below. - You can register multiple Services in the same Apache Ranger service to manage privileges in different clusters.
failed to evaluate condition '<condition>': script engine not found each time. For example, an allow item with an expression condition then grants access without checking the expression. Do not use these conditions in the policies that apply to the database.
When it loads policies, the FE also logs failed to initialize condition 'accessed-after-expiry'. This comes from the EXPIRES_ON policy of the tag service that Ranger Admin links to a service by default. The message has no effect as long as no resource has the EXPIRES_ON tag. Access to a resource with this tag is denied even before its expiry date.
This topic describes the permission control methods and integration process of the database and Apache Ranger. For information on how to create security policies on Ranger to manage data security, see the Apache Ranger official website.
From v3.5.0 onwards, the database supports Group Provider to collect group information from external authentication systems for user group management. For more information, see Authenticate User Groups.
Permission control method
The database integrated with Apache Ranger provides the following permission control methods:- Create Service in Ranger to implement permission control. When users access internal tables, external tables, or other objects, access control is performed according to the access policies configured in Service.
- When users access an external data source, the external service (such as the Hive Service) on Apache Ranger can be reused for access control. The database can match Ranger services with different External Catalogs and implements access control based on the Ranger service corresponding to the data source.
- Use Apache Ranger to uniformly manage access to internal tables, external tables, and all objects.
- Use Apache Ranger to manage access to internal tables and objects. For External Catalogs, reuse the policy of the corresponding external service on Ranger for access control.
- Use Apache Ranger to manage access to External Catalogs by reusing the Service corresponding to the external data source. Use the database native RBAC privilege system to manage access to internal tables and objects.
- You can also use LDAP for user authentication, then use Ranger to synchronize LDAP users and configure access rules for them. The database can also complete user login authentication through LDAP.
- When users initiate a query, the database parses the query statement, passes user information and required privileges to Apache Ranger. Ranger determines whether the user has the required privilege based on the access policy configured in the corresponding Service, and returns the authentication result to the database. If the user has access, the database returns the query data; if not, the database returns an error.
Prerequisites
- Apache Ranger 2.1.0 or later has been installed. For the instructions on how to install Apache Ranger, see Ranger quick start.
-
All the database FE machines have access to Apache Ranger. You can check this by running the following command on each FE machine:
If
Connected to <ip>is displayed, the connection is successful.
Integrate Service with Ranger
(Optional) Install ranger-starrocks-plugin
Note The main purpose of this step is to use Ranger’s resource name autocomplete feature. When authoring policies in Ranger Admin, users need to enter the name of the resources whose access need to be protected. To make it easier for users to enter the resource names, Ranger Admin provides the autocomplete feature, which looks up the available resources in the service that match the input entered so far and automatically completes the resource name. If you do not have the permissions to operate the Ranger cluster or do not need this feature, you can skip this step. Also, please notice that if you didn’t install the ranger-starrocks-plugin, then you cannot usetest connection when creating service. However, that doesn’t mean that you can not create the service successfully.
-
Create the
starrocksfolder in the Ranger Admin directoryews/webapp/WEB-INF/classes/ranger-plugins. -
Download plugin-starrocks/target/ranger-starrocks-plugin-3.0.0-SNAPSHOT.jar and mysql-connector-j.jar, and place them in the
starrocksfolder. -
Restart Ranger Admin.
-
Ranger 0.5.x:
-
Ranger 2.x and above:
-
Ranger 0.5.x:
Configure Service on Ranger Admin
Note This step configures the Service on Ranger so that users can perform access control on the database objects through Ranger.-
Copy ranger-servicedef-starrocks.json to any directory of the database FE machine or Ranger machine.
Note If you do not need Ranger’s autocomplete feature (which means you did not install the ranger-starrocks-plugin), you must set
implClassin the .json file to empty:If you need Ranger’s autocomplete feature (which means you have installed the ranger-starrocks-plugin), you must setimplClassin the .json file toorg.apache.ranger.services.starrocks.RangerServiceStarRocks:To grant SELECT on views and materialized views through Ranger, theaccessTypeRestrictionsof theviewandmaterialized_viewresources in the .json file must include"select". If they do not, add it before you add or update the service definition in the next step. -
Add Service by running the following command as a Ranger administrator.
If the service definition is already registered in Ranger, for example when you upgrade the database, update it instead of adding it again:
-
Access
http://<ranger-ip>:<ranger-host>/login.jspto log in to the Apache Ranger page. The STARROCKS service appears on the page.
-
Click the plus sign (
+) after STARROCKS to configure Service.

Service Name: You must enter a service name.Display Name: The name you want to display for the service under STARROCKS. If it is not specified,Service Namewill be displayed.UsernameandPassword: FE username and password, used to auto-complete object names when creating policies. The two parameters do not affect the connectivity between the database and Ranger. If you want to use auto-completion, configure at least one user with thedb_adminrole activated.jdbc.url: Enter the database FE IP address and port.
The following figure shows the added service.

- Click Test connection to test the connectivity, and save it after the connection is successful. If you didn’t install ranger-starrocks-plugin, then you can skip test connection and create directly.
Enable Ranger on the FE nodes
-
On each FE machine of the cluster, create ranger-starrocks-security.xml in the
fe/conffolder and copy the content. You must modify the following two parameters and save the modifications:ranger.plugin.starrocks.service.name: Change to the name of the Service you created in Step 4.ranger.plugin.starrocks.policy.rest the url: Change to the address of the Ranger Admin.
ranger.plugin.starrocks.policy.pollIntervalMsto change the interval for pulling policy changes. -
(Optional) If you want to use the Audit Log service of Ranger, you need to create the ranger-starrocks-audit.xml file in the
fe/conffolder of each FE machine. Copy the content, replacesolr_urlinxasecure.audit.solr.solr_urlwith your ownsolr_url, and save the file. The database supports two destinations for Ranger audit logs, and you can use only one of them at a time:- Solr: Use the
xasecure.audit.solr.*properties that the template uses. Configuring Solr withxasecure.audit.destination.solris not supported. - Local file: Set
xasecure.audit.destination.filetotrueandxasecure.audit.destination.file.dirto the directory of the audit files.
xasecure.audit.destination.*property is enabled, Ranger ignores all thexasecure.audit.<destination>.*properties, including the Solr ones. This also applies toranger-hive-audit.xml. - Solr: Use the
-
Add the configuration
access_control = rangerto all FE configuration files. -
Restart all FE machines.
Reuse other services to control access to external tables
For External Catalog, you can reuse external services (such as Hive Service) for access control. The database supports matching different Ranger external services for different Catalogs. When users access an external table, the system implements access control based on the access policy of the Ranger Service corresponding to the external table. The user permissions are consistent with the Ranger user with the same name.-
Copy Hive’s Ranger configuration files ranger-hive-security.xml and ranger-hive-audit.xml to the
fe/conffile of all FE machines. Make sure Ranger’s IP and port are correct. - Restart all FE machines.
-
Configure External Catalog.
-
When you create an External Catalog, add the property
"ranger.plugin.hive.service.name". -
You can also add this property to an existing External Catalog.
-
When you create an External Catalog, add the property
-
(Optional) Prefix the database name with the catalog name. This applies to every External Catalog that sets
ranger.plugin.hive.service.name, such as Hive, Iceberg, and Hudi catalogs. The Ranger Hive Service only knowsdatabase,table, andcolumn. It has no catalog level, so when several External Catalogs share one Hive Service (for example, several AWS Glue catalogs), a database that exists in more than one catalog matches the same policies. Set the property"ranger.plugin.hive.catalog_prefix.enabled"to"true"on such a catalog, and the database sends<catalog_name>_<database_name>as thedatabaseresource to Ranger instead of the bare database name. For example, a query againstglue_prod.sales.ordersis checked against a Ranger policy whose database isglue_prod_sales.- Valid values are
trueandfalse. Any other value makes CREATE or ALTER CATALOG fail. - When the property is not set, the catalog follows the FE configuration item
ranger_hive_catalog_prefix_enabled(defaultfalse). Catalogs that do not setranger.plugin.hive.service.nameignore this property. - The separator between the catalog name and the database name is the FE configuration item
ranger_hive_catalog_prefix_separator(default_). It is global because every catalog that shares one Ranger Service must use the same separator.
- Valid values are