Skip to main content
Version 3.0

NiFi policies
centralized in Ranger.

Three scenarios: how NiFi connects to Ranger, the order for enabling the integration, and what to do after reinstalling NiFi. Each one covers: the chart default, what changes in the cluster, and where the configuration lives.

ChartVersion3.0.3TypeapplicationAppVersion1.28.0
CompatibilityKubernetes1.32+OpenShift4.19+Rancher2.10.x+

NiFi can use Apache Ranger as the source of its access policies. The integration has two sides: in the tdp-nifi chart, mode 3 of Security - NiFi replaces the local authorizer with the Ranger plugin. In the tdp-ranger chart, the rangerIntegrations values register the NiFi service, generate the Ranger client certificate, and create the minimum technical policies. This page shows how the two sides fit together and in what order to apply them. The Ranger values are in Integrations - Ranger.

Your environment

If you fill in your environment details here, the examples and commands on the page use what you provided.

Scenarios​

Who queries whom, and with which certificate.

NiFi connects to Ranger through two pieces: the Ranger plugin, which ships in the NiFi image and downloads the policies from Ranger Admin, and the Ranger client certificate, with which Ranger Admin queries the NiFi resources. By default, none of this is on: NiFi uses the local authorizer, and the integration is off in the Ranger chart. The following tabs cover only Ranger: the order for enabling the integration and what to do after reinstalling NiFi.

Before enabling it, it is worth understanding the path. In mode 3, the Ranger plugin on the NiFi nodes downloads the policies from Ranger Admin. In the opposite direction, Ranger Admin queries NiFi's /nifi-api/resources endpoint to list the resources in the policy editor. That query uses SSL authentication, with a client certificate that cert-manager generates through the NiFi issuer and that NiFi identifies as CN=ranger-nifi-client. The NiFi address in the Ranger service uses a hostname present in the SANs of the NiFi certificate: the headless Service, not the external Service. After each Ranger installation or upgrade, a Job creates the technical users and the minimum technical policies.

NiFi

Local authorizer (nifiCluster.security.authorization.mode: file). Mode 3 is in Security - NiFi.

Ranger

Integration disabled (rangerIntegrations.nifi.enabled), as are the integration Job (rangerIntegrations.configJob.enabled) and the client certificate generation (rangerIntegrations.nifi.tlsClientCertificate.autoGenerate.enabled).

Human policies

The integration does not create any /flow policy for people. Create it afterwards, with the real users and groups synchronized in your environment's Ranger.

NiFi, Ranger and the client certificate

namespace <NAMESPACE>/nifi-api/resources (SSL)policiesusers and policiesNiFi nodesRangerNiFiAuthorizerRanger Admintdp_nifi serviceIntegration Job<RANGER_RELEASE>-ranger-integrationsSecret ranger-nifi-client-tlsCN=ranger-nifi-clientJKS password Secretranger-nifi-client-tls-passwordIssuer nifi-issuercert-manager
  1. NiFi nodes in mode 3. The Ranger plugin, already included in the default image, downloads the policies from Ranger Admin and sends the audit. The NiFi side is in Security - NiFi, scenario Policies in Ranger. Chart default: authorization.mode: file. (nifiCluster.security.authorization.mode)
  2. Ranger Admin. Holds the NiFi service and the policies. To build the policy editor, it queries NiFi's /nifi-api/resources over SSL, with the client certificate. Chart default: integration disabled. (rangerIntegrations.nifi.enabled)
  3. Integration Job. Hook after the installation and after each Ranger upgrade: it creates the technical users and the minimum technical policies. If any of them cannot be created, the hook fails explicitly. Chart default: disabled. (rangerIntegrations.configJob.enabled)
  4. Ranger client certificate. Generated by cert-manager with the NiFi issuer (nifi-issuer), with a JKS keystore and truststore. NiFi identifies this client as CN=ranger-nifi-client. Chart default: generation disabled. (rangerIntegrations.nifi.tlsClientCertificate.autoGenerate.enabled)
  5. JKS password. Created by you before the installation, not by the chart. The same password generates the JKS files and lets Ranger open them later: keep it stable across upgrades and reinstalls. (rangerIntegrations.nifi.tlsClientCertificate.autoGenerate.passwordSecretName)
  6. NiFi issuer. The same cert-manager issuer that issues the NiFi certificates. (rangerIntegrations.nifi.tlsClientCertificate.autoGenerate.issuerRef)
Click an element to see what it is and the chart default.

When something goes wrong​

Troubleshooting

Paste the error message or choose the symptom. The answer comes with the cause, what to do, and the command.

  1. Policy editor: PKIX path building failed. Cause: NiFi was reinstalled: NiFiKop created a new CA and the Ranger client certificate no longer matches it. What to do: Delete the certificate Secret so that cert-manager reissues it from the current CA, and restart Ranger Admin (scenario 3).
  2. The Ranger installation fails in the integration hook. Cause: The integration Job could not create a technical user or a policy, and failed explicitly. What to do: List the Jobs and read the integration Job log.
  3. Another problem. Cause: Start with the state of the pods and the namespace events. What to do: In mode 3, the real source of the policies is Ranger: check the configuration and the policies of the NiFi service in Ranger. On the NiFi side, the events and the node log show what prevents the cluster from starting. See also Security - NiFi.

Next steps​