SlideShare a Scribd company logo
Jun Rao
Confluent, Inc
Securing	
  Apache	
  Ka/a	
  	
  
Outline
•  Kafka and security overview
•  Authentication
•  Identify the principal (user) associated with a connection
•  Authorization
•  What permission a principal has
•  Secure Zookeeper
•  Future stuff
What’s Apache Kafka
Distributed, high throughput pub/sub system
Kafka Usage
Security Overview
•  Support since 0.9.0
•  Wire encryption btw client and broker
•  For cross data center mirroring
•  Access control on resources such as topics
•  Enable sharing Kafka clusters
Authentication Overview
•  Broker support multiple ports
•  plain text (no wire encryption/authentication)
•  SSL (for wire encryption/authentication)
•  SASL (for Kerberos authentication)
•  SSL + SASL (SSL for wire encryption, SASL for authentication)
•  Clients choose which port to use
•  need to provide required credentials through configs
Why is SSL useful
•  1-way authentication
•  Secure wire transfer through encryption
•  2-way authentication
•  Broker knows the identity of client
•  Easy to get started
•  Just involve client and server
SSL handshake
Subsequent transfer over SSL
•  Data encrypted with agreed upon cipher suite
•  Encryption overhead
•  Losing zero-copy transfer in consumer
Performance impact with SSL
•  r3.xlarge
•  4 core, 30GB ram, 80GB ssd, moderate network (~90MB/s)
•  Most overhead from encryption
throughput	
  (MB/s)	
   CPU	
  on	
  client	
   CPU	
  on	
  broker	
  
producer	
  (plaintext)	
   83	
   12%	
   30%	
  
producer	
  (SSL)	
   69	
   28%	
   48%	
  
consumer	
  (plaintext)	
   83	
   8%	
   2%	
  
consumer	
  (SSL)	
   69	
   27%	
   24%	
  
Preparing SSL
1.  Generate certificate (X509) in broker key store
2.  Generate certificate authority (CA) for signing
3.  Sign broker certificate with CA
4.  Import signed certificate and CA to broker key store
5.  Import CA to client trust store
6.  2-way authentication: generate client certificate in a similar
way
Configuring SSL
ssl.keystore.location = /var/private/ssl/kafka.server.keystore.jks
ssl.keystore.password = test1234
ssl.key.password = test1234
ssl.truststore.location = /var/private/ssl/kafka.server.truststore.jks
ssl.truststore.password = test1234	
  
Client/Broker	
  
listeners = SSL://host.name:port
security.inter.broker.protocol = SSL
ssl.client.auth = required
security.protocol = SSL
Broker	
  
Client	
  
•  No client code change; just configuration change.
SSL Principal Name
•  By default, the distinguished name of the certificate
•  CN=host1.company.com,OU=organization
unit,O=organization,L=location,ST=state,C=country
•  Can be customized through principal.builder.class
•  Has access to X509Certificate
•  Make setting broker principal and application principal convenient
What is SASL
•  Simple Authentication and Security Layer
•  Challenge/response protocols
•  Server issues challenge and client sends response
•  Continue until server is satisfied
•  Different mechanisms
•  Plain: cleartext username/password
•  Digest MD5
•  GSSAPI: Kerberos
•  Kafka 0.9.0 only supports Kerberos
Why Kerberos
•  Secure single sign-on
•  An organization may provide multiple services
•  User just remember a single Kerberos password to use all services
•  More convenient when there are many users
•  Need Key Distribution Center (KDC)
•  Each service/user need a Kerberos principal in KDC
How Kerberos Works
•  Create service and client
principal in KDC
•  Client authenticate with AS
on startup
•  Client obtain service ticket
from TGS
•  Client authenticate with
service using service ticket
SASL handshake
Client Broker
ConnecHon	
  
Mechanism	
  list	
  
Selected	
  mechanism	
  &	
  sasl	
  data	
  
Evaluate	
  and	
  response	
  
Sasl	
  data	
  
Client	
  authenHcated	
  
Data transfer
•  SASL_PLAINTEXT
•  No wire encryption
•  SASL_SSL
•  Wire encryption over SSL
Preparing Kerberos
•  Create Kafka service principal in KDC
•  Create a keytab for Kafka principal
•  Keytab includes principal and encrypted Kerberos password
•  Allow authentication w/o typing password
•  Create an application principal for client KDC
•  Create a keytab for application principal
Configuring Kerberos
KafkaServer {
com.sun.security.auth.module.Krb5LoginModule required
useKeyTab=true
storeKey=true
keyTab="/etc/security/keytabs/kafka_server.keytab"
principal="kafka/kafka1.hostname.com@EXAMPLE.COM";
};
Broker	
  JAAS	
  file	
  
-Djava.security.auth.login.config=/etc/kafka/
kafka_server_jaas.conf
security.inter.broker.protocol=SASL_PLAINTEXT(SASL_SSL)
sasl.kerberos.service.name=kafka
Broker	
  JVM	
  
Broker	
  config	
  
•  No client code change; just configuration change.
KafkaClient {
com.sun.security.auth.module.Krb5LoginModule required
useKeyTab=true
storeKey=true
keyTab="/etc/security/keytabs/kafka_client.keytab"
principal="kafka-client-1@EXAMPLE.COM";
};
Client	
  JAAS	
  file	
  
-Djava.security.auth.login.config=/etc/kafka/
kafka_client_jaas.conf
security.protocol=SASL_PLAINTEXT(SASL_SSL)
sasl.kerberos.service.name=kafka
ClientJVM	
  
Client	
  config	
  
Kerberos principal name
•  Kerberos principal
•  Primary[/Instance]@REALM
•  kafka/kafka1.hostname.com@EXAMPLE.COM
•  kafka-client-1@EXAMPLE.COM
•  Primary extracted as the default principal name
•  Can customize principal name through
sasl.kerberos.principal.to.local.rules
Authentication Caveat
•  Authentication (SSL or SASL) happens once during socket
connection
•  No re-authentication
•  If a certificate needs to be revoked, use authorization to remove
permission
Authorization
•  Control which permission each authenticated principal has
•  Pluggable with a default implementation
ACL
Principal Permission Operation Resource Host
Alice Allow Read Topic:T1 Host1
Alice	
  is	
  Allowed	
  to	
  Read	
  from	
  topic	
  T1	
  from	
  Host1	
  
Operations and Resources
•  Operations
•  Read, Write, Create, Describe, ClusterAction, All
•  Resources
•  Topic, Cluster and ConsumerGroup
Opera;ons	
   Resources	
  
Read,	
  Write,	
  Describe	
  (Read,	
  Write	
  implies	
  
Describe)	
  
Topic	
  
Read	
   ConsumerGroup	
  
Create,	
  ClusterAcHon	
  (communicaHon	
  between	
  
controller	
  and	
  brokers)	
  
Cluster	
  
SimpleAclAuthorizer
•  Out of box authorizer implementation.
•  CLI tool for adding/removing acls
•  ACLs stored in zookeeper and propagated to brokers
asynchronously
•  ACL cache in broker for better performance.
Client	
   Broker	
   Authorizer	
   Zookeeper	
  
configure	
  
Read	
  ACLs	
  
Load	
  Cache	
  
Request	
  
authorize	
  
ACL	
  match	
  
Or	
  Super	
  User?	
  
Allowed/
Denied	
  
Authorizer Flow
Configure broker ACL
•  authorizer.class.name=kafka.security.auth.SimpleAclAuthorizer
•  Make Kafka principal super users
•  Or grant ClusterAction and Read all topics to Kafka principal
Configure client ACL
•  Producer
•  Grant Write on topic, Create on cluster (auto creation)
•  Or use --producer option in CLI
bin/kafka-acls --authorizer-properties zookeeper.connect=localhost:2181 
--add --allow-principal User:Bob --producer --topic t1
•  Consumer
•  Grant Read on topic, Read on consumer group
•  Or use --consumer option in CLI
bin/kafka-acls --authorizer-properties zookeeper.connect=localhost:2181 
--add --allow-principal User:Bob --consumer --topic t1 --group group1
Secure Zookeeper
•  Zookeeper stores
•  critical Kafka metadata
•  ACLs
•  Need to prevent untrusted users from modifying
Zookeeper Security Integration
•  ZK supports authentication through SASL
•  Kerberos or Digest MD5
•  Set zookeeper.set.acl to true on every broker
•  Configure ZK user through JAAS config file
•  Each ZK path writable by creator, readable by all
Migrating from non-secure to secure
Kafka
•  Configure brokers with multiple ports
•  listeners=PLAINTEXT://host.name:port,SSL://host.name:port
•  Gradually migrate clients to secure port
•  When done
•  Turn off PLAINTEXT port on brokers
Migrating from non-secure to secure
Zookeeper
•  http://kafka.apache.org/documentation.html#zk_authz_migration
Future work
•  More SASL options: plain password, md5 digest
•  Performance improvement
•  Integrate with admin api
Thank you
Jun Rao | jun@confluent.io | @junrao
Meet Confluent in booth
Confluent University ~ Kafka training ~ confluent.io/training
Download Apache Kafka & Confluent Platform: confluent.io/download

More Related Content

PPTX
Introduction to Apache Kafka
PPTX
Kafka and Avro with Confluent Schema Registry
PDF
Introduction to Kafka Streams
PDF
Getting Started with Confluent Schema Registry
PPTX
Kafka Tutorial - Introduction to Apache Kafka (Part 1)
PPTX
Kafka connect 101
PDF
Apache Kafka Architecture & Fundamentals Explained
PPTX
Envoy and Kafka
Introduction to Apache Kafka
Kafka and Avro with Confluent Schema Registry
Introduction to Kafka Streams
Getting Started with Confluent Schema Registry
Kafka Tutorial - Introduction to Apache Kafka (Part 1)
Kafka connect 101
Apache Kafka Architecture & Fundamentals Explained
Envoy and Kafka

What's hot (20)

PDF
Kafka Connect & Streams - the ecosystem around Kafka
PPTX
Kafka 101
PDF
Fundamentals of Apache Kafka
PPTX
Apache Kafka at LinkedIn
PDF
Kafka Security 101 and Real-World Tips
PPTX
How to Lock Down Apache Kafka and Keep Your Streams Safe
PDF
Kafka 101 and Developer Best Practices
PDF
Apache Kafka Fundamentals for Architects, Admins and Developers
PDF
How Apache Kafka® Works
PDF
PPTX
ODP
Stream processing using Kafka
PDF
Apache Kafka Introduction
PDF
Disaster Recovery with MirrorMaker 2.0 (Ryanne Dolan, Cloudera) Kafka Summit ...
PDF
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
PPTX
Apache Kafka Best Practices
ODP
Introduction to Kafka connect
PDF
Kappa vs Lambda Architectures and Technology Comparison
PDF
Architecture patterns for distributed, hybrid, edge and global Apache Kafka d...
PDF
Common issues with Apache Kafka® Producer
Kafka Connect & Streams - the ecosystem around Kafka
Kafka 101
Fundamentals of Apache Kafka
Apache Kafka at LinkedIn
Kafka Security 101 and Real-World Tips
How to Lock Down Apache Kafka and Keep Your Streams Safe
Kafka 101 and Developer Best Practices
Apache Kafka Fundamentals for Architects, Admins and Developers
How Apache Kafka® Works
Stream processing using Kafka
Apache Kafka Introduction
Disaster Recovery with MirrorMaker 2.0 (Ryanne Dolan, Cloudera) Kafka Summit ...
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Apache Kafka Best Practices
Introduction to Kafka connect
Kappa vs Lambda Architectures and Technology Comparison
Architecture patterns for distributed, hybrid, edge and global Apache Kafka d...
Common issues with Apache Kafka® Producer
Ad

Similar to Securing Kafka (20)

PPTX
PDF
Paris FOD meetup - kafka security 101
PPTX
Kafka Security
PPTX
Visualizing Kafka Security
PPTX
Apache Kafka Security
PDF
Apache Kafka® Security Overview
PDF
Flexible Authentication Strategies with SASL/OAUTHBEARER (Michael Kaminski, T...
PDF
TechEvent 2019: Wie sichere ich eigentlich Kafka ab?; Markus Bente - Trivadis
PPTX
Securing kafka with 500 billion messages a day
PPTX
Kafka Tutorial: Kafka Security
PDF
SSL Everywhere!
PDF
g4p-Kafka-SebastianZsolt.pdf
PDF
Chickens & Eggs: Managing secrets in AWS with Hashicorp Vault
PDF
WebLogic in Practice: SSL Configuration
PDF
Training Slides: 302 - Securing Your Cluster With SSL
PPTX
Kafka_authentication_using kerberose.pptx
PDF
Team Collaboration in Kafka Clusters With Maria Berinde-Tampanariu | Current ...
PPTX
Securing Your MongoDB Deployment
PDF
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
PDF
Vault
Paris FOD meetup - kafka security 101
Kafka Security
Visualizing Kafka Security
Apache Kafka Security
Apache Kafka® Security Overview
Flexible Authentication Strategies with SASL/OAUTHBEARER (Michael Kaminski, T...
TechEvent 2019: Wie sichere ich eigentlich Kafka ab?; Markus Bente - Trivadis
Securing kafka with 500 billion messages a day
Kafka Tutorial: Kafka Security
SSL Everywhere!
g4p-Kafka-SebastianZsolt.pdf
Chickens & Eggs: Managing secrets in AWS with Hashicorp Vault
WebLogic in Practice: SSL Configuration
Training Slides: 302 - Securing Your Cluster With SSL
Kafka_authentication_using kerberose.pptx
Team Collaboration in Kafka Clusters With Maria Berinde-Tampanariu | Current ...
Securing Your MongoDB Deployment
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
Vault
Ad

More from confluent (20)

PDF
Stream Processing Handson Workshop - Flink SQL Hands-on Workshop (Korean)
PPTX
Webinar Think Right - Shift Left - 19-03-2025.pptx
PDF
Migration, backup and restore made easy using Kannika
PDF
Five Things You Need to Know About Data Streaming in 2025
PDF
Data in Motion Tour Seoul 2024 - Keynote
PDF
Data in Motion Tour Seoul 2024 - Roadmap Demo
PDF
From Stream to Screen: Real-Time Data Streaming to Web Frontends with Conflue...
PDF
Confluent per il settore FSI: Accelerare l'Innovazione con il Data Streaming...
PDF
Data in Motion Tour 2024 Riyadh, Saudi Arabia
PDF
Build a Real-Time Decision Support Application for Financial Market Traders w...
PDF
Strumenti e Strategie di Stream Governance con Confluent Platform
PDF
Compose Gen-AI Apps With Real-Time Data - In Minutes, Not Weeks
PDF
Building Real-Time Gen AI Applications with SingleStore and Confluent
PDF
Unlocking value with event-driven architecture by Confluent
PDF
Il Data Streaming per un’AI real-time di nuova generazione
PDF
Unleashing the Future: Building a Scalable and Up-to-Date GenAI Chatbot with ...
PDF
Break data silos with real-time connectivity using Confluent Cloud Connectors
PDF
Building API data products on top of your real-time data infrastructure
PDF
Speed Wins: From Kafka to APIs in Minutes
PDF
Evolving Data Governance for the Real-time Streaming and AI Era
Stream Processing Handson Workshop - Flink SQL Hands-on Workshop (Korean)
Webinar Think Right - Shift Left - 19-03-2025.pptx
Migration, backup and restore made easy using Kannika
Five Things You Need to Know About Data Streaming in 2025
Data in Motion Tour Seoul 2024 - Keynote
Data in Motion Tour Seoul 2024 - Roadmap Demo
From Stream to Screen: Real-Time Data Streaming to Web Frontends with Conflue...
Confluent per il settore FSI: Accelerare l'Innovazione con il Data Streaming...
Data in Motion Tour 2024 Riyadh, Saudi Arabia
Build a Real-Time Decision Support Application for Financial Market Traders w...
Strumenti e Strategie di Stream Governance con Confluent Platform
Compose Gen-AI Apps With Real-Time Data - In Minutes, Not Weeks
Building Real-Time Gen AI Applications with SingleStore and Confluent
Unlocking value with event-driven architecture by Confluent
Il Data Streaming per un’AI real-time di nuova generazione
Unleashing the Future: Building a Scalable and Up-to-Date GenAI Chatbot with ...
Break data silos with real-time connectivity using Confluent Cloud Connectors
Building API data products on top of your real-time data infrastructure
Speed Wins: From Kafka to APIs in Minutes
Evolving Data Governance for the Real-time Streaming and AI Era

Recently uploaded (20)

PPT
Project quality management in manufacturing
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
Digital Logic Computer Design lecture notes
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Well-logging-methods_new................
PPTX
Geodesy 1.pptx...............................................
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPT
Drone Technology Electronics components_1
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
MET 305 MODULE 1 KTU 2019 SCHEME 25.pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
composite construction of structures.pdf
DOCX
573137875-Attendance-Management-System-original
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Sustainable Sites - Green Building Construction
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPT
Mechanical Engineering MATERIALS Selection
Project quality management in manufacturing
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Digital Logic Computer Design lecture notes
CYBER-CRIMES AND SECURITY A guide to understanding
Well-logging-methods_new................
Geodesy 1.pptx...............................................
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Drone Technology Electronics components_1
Arduino robotics embedded978-1-4302-3184-4.pdf
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
MET 305 MODULE 1 KTU 2019 SCHEME 25.pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
composite construction of structures.pdf
573137875-Attendance-Management-System-original
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Sustainable Sites - Green Building Construction
Model Code of Practice - Construction Work - 21102022 .pdf
Mechanical Engineering MATERIALS Selection

Securing Kafka

  • 1. Jun Rao Confluent, Inc Securing  Apache  Ka/a    
  • 2. Outline •  Kafka and security overview •  Authentication •  Identify the principal (user) associated with a connection •  Authorization •  What permission a principal has •  Secure Zookeeper •  Future stuff
  • 3. What’s Apache Kafka Distributed, high throughput pub/sub system
  • 5. Security Overview •  Support since 0.9.0 •  Wire encryption btw client and broker •  For cross data center mirroring •  Access control on resources such as topics •  Enable sharing Kafka clusters
  • 6. Authentication Overview •  Broker support multiple ports •  plain text (no wire encryption/authentication) •  SSL (for wire encryption/authentication) •  SASL (for Kerberos authentication) •  SSL + SASL (SSL for wire encryption, SASL for authentication) •  Clients choose which port to use •  need to provide required credentials through configs
  • 7. Why is SSL useful •  1-way authentication •  Secure wire transfer through encryption •  2-way authentication •  Broker knows the identity of client •  Easy to get started •  Just involve client and server
  • 9. Subsequent transfer over SSL •  Data encrypted with agreed upon cipher suite •  Encryption overhead •  Losing zero-copy transfer in consumer
  • 10. Performance impact with SSL •  r3.xlarge •  4 core, 30GB ram, 80GB ssd, moderate network (~90MB/s) •  Most overhead from encryption throughput  (MB/s)   CPU  on  client   CPU  on  broker   producer  (plaintext)   83   12%   30%   producer  (SSL)   69   28%   48%   consumer  (plaintext)   83   8%   2%   consumer  (SSL)   69   27%   24%  
  • 11. Preparing SSL 1.  Generate certificate (X509) in broker key store 2.  Generate certificate authority (CA) for signing 3.  Sign broker certificate with CA 4.  Import signed certificate and CA to broker key store 5.  Import CA to client trust store 6.  2-way authentication: generate client certificate in a similar way
  • 12. Configuring SSL ssl.keystore.location = /var/private/ssl/kafka.server.keystore.jks ssl.keystore.password = test1234 ssl.key.password = test1234 ssl.truststore.location = /var/private/ssl/kafka.server.truststore.jks ssl.truststore.password = test1234   Client/Broker   listeners = SSL://host.name:port security.inter.broker.protocol = SSL ssl.client.auth = required security.protocol = SSL Broker   Client   •  No client code change; just configuration change.
  • 13. SSL Principal Name •  By default, the distinguished name of the certificate •  CN=host1.company.com,OU=organization unit,O=organization,L=location,ST=state,C=country •  Can be customized through principal.builder.class •  Has access to X509Certificate •  Make setting broker principal and application principal convenient
  • 14. What is SASL •  Simple Authentication and Security Layer •  Challenge/response protocols •  Server issues challenge and client sends response •  Continue until server is satisfied •  Different mechanisms •  Plain: cleartext username/password •  Digest MD5 •  GSSAPI: Kerberos •  Kafka 0.9.0 only supports Kerberos
  • 15. Why Kerberos •  Secure single sign-on •  An organization may provide multiple services •  User just remember a single Kerberos password to use all services •  More convenient when there are many users •  Need Key Distribution Center (KDC) •  Each service/user need a Kerberos principal in KDC
  • 16. How Kerberos Works •  Create service and client principal in KDC •  Client authenticate with AS on startup •  Client obtain service ticket from TGS •  Client authenticate with service using service ticket
  • 17. SASL handshake Client Broker ConnecHon   Mechanism  list   Selected  mechanism  &  sasl  data   Evaluate  and  response   Sasl  data   Client  authenHcated  
  • 18. Data transfer •  SASL_PLAINTEXT •  No wire encryption •  SASL_SSL •  Wire encryption over SSL
  • 19. Preparing Kerberos •  Create Kafka service principal in KDC •  Create a keytab for Kafka principal •  Keytab includes principal and encrypted Kerberos password •  Allow authentication w/o typing password •  Create an application principal for client KDC •  Create a keytab for application principal
  • 20. Configuring Kerberos KafkaServer { com.sun.security.auth.module.Krb5LoginModule required useKeyTab=true storeKey=true keyTab="/etc/security/keytabs/kafka_server.keytab" principal="kafka/kafka1.hostname.com@EXAMPLE.COM"; }; Broker  JAAS  file   -Djava.security.auth.login.config=/etc/kafka/ kafka_server_jaas.conf security.inter.broker.protocol=SASL_PLAINTEXT(SASL_SSL) sasl.kerberos.service.name=kafka Broker  JVM   Broker  config   •  No client code change; just configuration change. KafkaClient { com.sun.security.auth.module.Krb5LoginModule required useKeyTab=true storeKey=true keyTab="/etc/security/keytabs/kafka_client.keytab" principal="kafka-client-1@EXAMPLE.COM"; }; Client  JAAS  file   -Djava.security.auth.login.config=/etc/kafka/ kafka_client_jaas.conf security.protocol=SASL_PLAINTEXT(SASL_SSL) sasl.kerberos.service.name=kafka ClientJVM   Client  config  
  • 21. Kerberos principal name •  Kerberos principal •  Primary[/Instance]@REALM •  kafka/kafka1.hostname.com@EXAMPLE.COM •  kafka-client-1@EXAMPLE.COM •  Primary extracted as the default principal name •  Can customize principal name through sasl.kerberos.principal.to.local.rules
  • 22. Authentication Caveat •  Authentication (SSL or SASL) happens once during socket connection •  No re-authentication •  If a certificate needs to be revoked, use authorization to remove permission
  • 23. Authorization •  Control which permission each authenticated principal has •  Pluggable with a default implementation
  • 24. ACL Principal Permission Operation Resource Host Alice Allow Read Topic:T1 Host1 Alice  is  Allowed  to  Read  from  topic  T1  from  Host1  
  • 25. Operations and Resources •  Operations •  Read, Write, Create, Describe, ClusterAction, All •  Resources •  Topic, Cluster and ConsumerGroup Opera;ons   Resources   Read,  Write,  Describe  (Read,  Write  implies   Describe)   Topic   Read   ConsumerGroup   Create,  ClusterAcHon  (communicaHon  between   controller  and  brokers)   Cluster  
  • 26. SimpleAclAuthorizer •  Out of box authorizer implementation. •  CLI tool for adding/removing acls •  ACLs stored in zookeeper and propagated to brokers asynchronously •  ACL cache in broker for better performance.
  • 27. Client   Broker   Authorizer   Zookeeper   configure   Read  ACLs   Load  Cache   Request   authorize   ACL  match   Or  Super  User?   Allowed/ Denied   Authorizer Flow
  • 28. Configure broker ACL •  authorizer.class.name=kafka.security.auth.SimpleAclAuthorizer •  Make Kafka principal super users •  Or grant ClusterAction and Read all topics to Kafka principal
  • 29. Configure client ACL •  Producer •  Grant Write on topic, Create on cluster (auto creation) •  Or use --producer option in CLI bin/kafka-acls --authorizer-properties zookeeper.connect=localhost:2181 --add --allow-principal User:Bob --producer --topic t1 •  Consumer •  Grant Read on topic, Read on consumer group •  Or use --consumer option in CLI bin/kafka-acls --authorizer-properties zookeeper.connect=localhost:2181 --add --allow-principal User:Bob --consumer --topic t1 --group group1
  • 30. Secure Zookeeper •  Zookeeper stores •  critical Kafka metadata •  ACLs •  Need to prevent untrusted users from modifying
  • 31. Zookeeper Security Integration •  ZK supports authentication through SASL •  Kerberos or Digest MD5 •  Set zookeeper.set.acl to true on every broker •  Configure ZK user through JAAS config file •  Each ZK path writable by creator, readable by all
  • 32. Migrating from non-secure to secure Kafka •  Configure brokers with multiple ports •  listeners=PLAINTEXT://host.name:port,SSL://host.name:port •  Gradually migrate clients to secure port •  When done •  Turn off PLAINTEXT port on brokers
  • 33. Migrating from non-secure to secure Zookeeper •  http://kafka.apache.org/documentation.html#zk_authz_migration
  • 34. Future work •  More SASL options: plain password, md5 digest •  Performance improvement •  Integrate with admin api
  • 35. Thank you Jun Rao | jun@confluent.io | @junrao Meet Confluent in booth Confluent University ~ Kafka training ~ confluent.io/training Download Apache Kafka & Confluent Platform: confluent.io/download