Skip to main content

Each identity
with the right access.

Apache Ranger policies decide access in Kafka, NiFi, and Trino, with masking, row filtering, and tags. Other components keep their own access control.

Authorization with Ranger​

Kafka, NiFi, and Trino permissions are administered in a single place.

Concept

Central policies, local enforcement

Authentication says who the user is. Authorization says what they can access. In Apache Ranger, policies are created in Ranger Admin, through the web interface or the REST API, and enforced by plugins that run inside each service.

In TDP Kubernetes

Kafka, NiFi, and Trino integrated

The tdp-ranger chart registers the Kafka, NiFi, and Trino services in Ranger through an integration job, which can bring initial policies. Each integration is enabled separately, and the service is configured to use Ranger as its authorizer.

What Ranger offers​

Policies

Permissions per resource

Each policy defines a service resource, such as a Kafka topic or a Trino schema, who can access it, and with which permissions.

Identities

Directory users and groups

UserSync brings the LDAP or Active Directory users and groups into Ranger, at regular intervals. Policies then reference the groups the company already maintains.

Administration

Roles assigned by group

Assignment rules grant Ranger roles to the synchronized users and groups, such as ROLE_SYS_ADMIN for administrators and ROLE_ADMIN_AUDITOR for auditors.

Auditing

Central record

In the model adopted by TDP Kubernetes, audited decisions are available in Ranger Admin, with the records stored in Solr.

Masking, row filtering, and tags​

Besides per-resource permissions, Ranger offers policies that act on the content returned by queries and policies associated with data tags.

With them, the same table can serve different teams, each receiving only the values and rows compatible with its purpose.

Column masking

The mask is applied at query time, on the value returned to the user. The types include redaction, partial display, hash, null value, and custom expression. With the hash or a custom expression, fields such as the CPF are pseudonymized.

Row filter

A condition associated with the user limits the rows returned: each user sees only the rows the condition allows.

Tag-based policies (ABAC)

The rule is associated with a tag, such as the one that identifies personal data, and follows the resources that carry that tag, instead of a specific resource.

Ranger documentation

Details in the Apache Ranger documentation: column masking and row filtering and tag-based policies.

Examples of per-resource policies​

Illustrative situations, with fictitious user, group, and resource names, to show the effect of each policy.

Kafka · topic

Consume the orders

Resource: topic orders.events.
Who: technical user consumer-app.
Permission: read (consume).

Effect: the application starts consuming the topic, and the permission is maintained in Ranger, along with the other Kafka policies.

Trino · catalog and schema

Query the sales schema

Resource: catalog lakehouse, schema vendas.
Who: user ana.souza, authenticated in LDAP.
Permission: query (SELECT).

Effect: the user queries the tables in the vendas schema from any SQL client connected to Trino.

NiFi · interface

Access to the flows

Resource: /flow, the NiFi flows interface.
Who: group engenharia-dados, synchronized from the directory.
Permission: view.

Effect: the group's members start seeing the NiFi interface, with the permission granted to the group, not to each person.

Column-level control

In Trino policies, the resource can reach the column: a policy can grant a user the query only on the columns they need, leaving out personal fields such as CPF and e-mail.

note

In the NiFi integration, the minimum technical policies are created at installation.

Access policies for people, such as the one for /flow, are created afterwards, with the users and groups already synchronized in Ranger.

Scenario: mask the CPF for the analytics team​

Situation: analysts query the customers table through Trino, which has a CPF column, and each analyst serves a different business unit.

What TDP does: in the Trino service in Ranger, a hash-type masking policy on the CPF column applies to the analytics team users, and a row filter limits the records to each user's unit.

Effect: the Trino query returns the masked CPF and only the rows of the permitted unit, and the decision is recorded in the Ranger audit.

Components' own access control​

Argo CD

Its own roles, with LDAP groups associated with each role.

Kafka

Besides Ranger, the broker accepts Strimzi ACLs, declared per user in the chart.

Kafka UI

Interface roles define what each user can do in the UI.

NiFi

With LDAP or AD login, policies can live in NiFi itself or in Ranger.

See also​