Discuss strategies for ensuring data security in Kafka, from encryption to access control.

Instruction: Outline comprehensive security measures for safeguarding data in transit and at rest, including client authentication and authorization.

Context: This question assesses the candidate's knowledge of Kafka's security features and their ability to design a secure messaging system.

Updated

Official answer

Protect each path: client-to-broker, inter-broker, controller, administrative, monitoring and backup access. Use TLS with certificate and hostname verification where confidentiality and endpoint authenticity are required. Choose mutual TLS or an appropriate SASL mechanism for client identity; PLAIN and SCRAM need protected transport.

Authentication identifies a principal. Authorization decides which operations it may perform. In KRaft deployments, configure StandardAuthorizer on the relevant broker/controller nodes and grant only required topic, group, transactional-ID and administrative permissions. A consumer typically needs permissions on its topic and group; a topic Read grant alone is not a complete group-consumer authorization recipe.

Use the current kafka-acls.sh administration path through --bootstrap-server with a secured --command-config, or the Admin API. Do not use a ZooKeeper authorizer-properties command for Kafka 4.x. Keep application principals separate from administrators and avoid broad super-user/wildcard grants.

For data at rest, protect the storage volume, backups and keys using the deployment's storage controls. Disk encryption does not hide records from an authorized running broker. Client-side encryption has a separate key, schema, replay and query/processing contract. Remove secrets or unnecessary personal data before ingestion.

Restrict Connect/management endpoints and remote JMX, protect configuration files, and rotate credentials/certificates with a tested rollback path. Test allowed reads/writes and denied cross-topic/group operations, expired certificates and revoked identities. Audit changes and alert on failures; configuration descriptions alone do not establish effective enforcement or compliance.

ACL administration, SASL, TLS

Related Questions