This episode secures the Flink cluster: encrypting communication with TLS, Kerberos authentication and RBAC, secure access to the web dashboard and REST API, and protecting source and sink credentials. Security becomes a prerequisite before jobs step into production.

Up to episode 11, all your jobs ran in a trusted environment. Episode 12 changes that assumption: once Flink enters production, the cluster communicates over networks that can be snooped, and the dashboard can be accessed by anyone if it's not protected. Security isn't an add-on feature — it's a prerequisite.
We'll cover four layers: securing communication between components with TLS, authentication with Kerberos and RBAC, locking down access to the web dashboard and REST API, and protecting the credentials used by sources and sinks. After this episode, you can configure a production-worthy Flink cluster.
Flink encrypts two paths: internal (between JobManager and TaskManager) and REST (dashboard and API). Both use JKS keystores and truststores:
keytool -genkeypair -alias flink -keyalg RSA \
-keystore keystore.jks -storepass changeit -validity 365keytool is the JDK's standard tool for creating certificates. In production, certificates are usually issued by an internal CA, not self-signed as in the example above.
security.ssl.enabled: true
security.ssl.rest.enabled: true
security.ssl.internal.enabled: true
security.ssl.keystore: /secrets/keystore.jks
security.ssl.keystore-password: ${KEYSTORE_PASSWORD}
security.ssl.truststore: /secrets/truststore.jks
security.ssl.truststore-password: ${TRUSTSTORE_PASSWORD}security.ssl.enabled turns on encryption, while rest and internal choose which paths are encrypted. Store passwords in a secret manager and inject them via environment variables, not hardcoded in the file.
In enterprise environments (especially Hadoop), Flink authenticates via Kerberos. The login component is configured per context:
security.kerberos.login.use-ticket-cache: true
security.kerberos.login.contexts: Client,KafkaClient
security.kerberos.login.keytab: /secrets/flink.keytab
security.kerberos.login.principal: flink@EXAMPLE.COMsecurity.kerberos.login.keytab points to the keytab file and principal sets the service identity. The Client context is used for Hadoop, KafkaClient for Kafka with SASL Kerberos.
Authentication answers "who are you"; authorization answers "what are you allowed to do". Flink enforces access control at several points: the REST API for submitting or cancelling jobs, and external systems like HDFS or Kafka that validate user permissions.
rest.bind-address: 0.0.0.0
rest.bind-port: 8081
jobmanager.rpc.address: flink-jm.internalBinding the REST API to an internal host and not exposing it to the internet is the simplest form of network authorization. For fine-grained control, combine it with a proxy that checks user identity before forwarding requests.
The web dashboard shows sensitive information: job graphs, metrics, and configuration. Best practices:
curl -sk https://localhost:8081/overviewcurl -sk calls the REST API with TLS but skips certificate verification — debugging only. In production, remove the -k flag and use a valid certificate.
Database, Kafka, and S3 credentials are a primary target for attackers. Some mandatory rules:
CREATE TABLE orders (
user_id STRING,
amount BIGINT
) WITH (
'connector' = 'kafka',
'properties.security.protocol' = 'SASL_SSL',
'properties.sasl.mechanism' = 'PLAIN',
'properties.sasl.jaas.config' =
'org.apache.kafka.common.security.plain.PlainLoginModule required username="flink" password="${KAFKA_PASSWORD}";'
);${KAFKA_PASSWORD} is an environment placeholder — the secret value stays outside the file. The same pattern applies to JDBC, S3, and all other connectors.
Episode 12 secured the Flink cluster from four sides: TLS for encrypting internal and REST paths, Kerberos for authentication in enterprise environments, access restrictions for the dashboard and API, and secure credential storage practices for all sources and sinks.
The key takeaways:
In the next episode, episode 13, we'll discuss data governance & observability — exposing metrics to Prometheus and Grafana, monitoring logging, job metrics, and backpressure, tracking audit events, lineage, and data quality, and tracing for latency analysis. You'll make your streaming system not just run, but be visible.