Securing NiFi with SSL
The NiFi operator
makes securing your NiFi cluster with SSL. You may provide your own certificates, or instruct the operator to create them for from your cluster configuration.
Below this is an example configuration required to secure your cluster with SSL :
managedAdminUsers
: list of users account which will be configured as admin into NiFi cluster, please check for more information.readOnlyConfig.nifiProperties.webProxyHosts
: A list of allowed HTTP Host header values to consider when NiFi is running securely and will be receiving requests to a different host[:port] than it is bound to. web-properties
If listenersConfig.sslSecrets.create
is set to false
, the operator will look for the secret at listenersConfig.sslSecrets.tlsSecretName
and expect these values :
key | value |
---|---|
caCert | The CA certificate |
caKey | The CA private key |
clientCert | A client certificate (this will be used by operator for NiFI operations) |
clientKey | The private key for clientCert |
Using an existing Issuer
As described in the Reference section, instead of using a self-signed certificate as CA, you can use an existing one.
In order to do so, you only have to refer it into your Spec.ListenerConfig.SslSecrets.IssuerRef
field.
Example : Let's encrypt
Let's say you have an existing DNS server, with external dns deployed into your cluster's namespace. You can easily use Let's encrypt as authority for your certificate.
To do this, you have to :
- Create an issuer :
- Setup External dns and correctly create your issuer into your cluster configuration :
Create SSL credentials
You may use NifiUser
resource to create new certificates for your applications, allowing them to query your Nifi cluster.
To create a new client you will need to generate new certificates sign by the CA. The operator can automate this for you using the NifiUser
CRD :
This will create a user and store its credentials in the secret example-client-secret
. The secret contains these fields :
key | value |
---|---|
ca.crt | The CA certificate |
tls.crt | The user certificate |
tls.key | The user private key |
You can then mount these secret to your pod. Alternatively, you can write them to your local machine by running:
The operator can also include a Java keystore format (JKS) with your user secret if you'd like. Add includeJKS
: true
to the spec
like shown above, and then the user-secret will gain these additional fields :
key | value |
---|---|
tls.jks | The java keystore containing both the user keys and the CA (use this for your keystore AND truststore) |
pass.txt | The password to decrypt the JKS (this will be randomly generated) |