SlideShare a Scribd company logo
1 © Hortonworks Inc. 2011–2018. All rights reserved.
Visualizing Security in Apache Kafka
Vipin Rathor
Sr. Product Specialist (Security)
@VipinRathor46
2 © Hortonworks Inc. 2011–2018. All rights reserved.
$whoami
• Currently work for Hortonworks as Security SME
• Areas of Interest: Security & Governance, CyberSecurity, Streaming
• Contributor to MIT Kerberos, IBM Kerberos, Core Hadoop, Apache Zeppelin & more
• Implemented SPKM (a GSSAPI mechanism) RFC
• Hold 03 US Patents in Computer Security et. al.
• Authored IBM Redbook® on IBM Websphere® + Kerberos
3 © Hortonworks Inc. 2011–2018. All rights reserved.
Agenda
• Apache Kafka Security Models
• PLAINTEXT
• SSL
• SASL_PLAINTEXT
• SASL_SSL
• Apache Kafka Security Models - A Ready Reckoner
• How to Troubleshoot security issues
• Most Common Errors
• Apache Kafka Security - Dos and Don’ts
4 © Hortonworks Inc. 2011–2018. All rights reserved.
• End-user Authentication (Is user who he/she claims to be?)
• User Authorization (Does authenticated user have access to this resource?)
• In-flight data i.e. Communication between
• Kafka Broker <--> Kafka Clients (Consumer/Producers)
• Kafka Broker <--> Kafka Broker
• Kafka Broker <--> Zookeeper
What Are We Securing?
• Data persisted on-disk, e.g. security through data encryption
What Are We NOT Securing?
5 © Hortonworks Inc. 2011–2018. All rights reserved.
• No Authentication / No Authorization / insecure channel => ZERO security
• Default security method
• To be used only for Proof-of-Concept
• Absolutely NOT recommended for use in Dev/Test/Prod environment
PLAINTEXT
Apache Kafka Security Models
6 © Hortonworks Inc. 2011–2018. All rights reserved.
• X.509 Certificate based model - only secures the HTTP channel
• Performs certificate based host authorization
• No User Authentication / Authorization
• How to configure
• Setup per-node certificate truststore/keystore for brokers & clients
SSL
Apache Kafka Security Models
Broker-side: Client-side:
listeners=SSL://127.0.0.1:6667 security.protocol = SSL
inter.broker.protocol=SSL
7 © Hortonworks Inc. 2011–2018. All rights reserved.
• Supports user authentication via
• Username / Password
• GSSAPI (Kerberos Ticket)
• SCRAM (Salted Password)
• Supports User authorization via Kafka ACLs or Apache Ranger
• Sends secrets & data over the wire in "Plain" format
• How to configure
• Pre-configure authentication mechanism
SASL_PLAINTEXT (or PLAINTEXTSASL in older version)
Apache Kafka Security Models
Broker-side: Client-side:
listeners=SASL_PLAINTEXT://127.0.0.1:6667 security.protocol = SASL_PLAINTEXT
inter.broker.protocol=SASL_PLAINTEXT
sasl.enabled.mechanism=PLAIN | GSSAPI | SCRAM
sasl.mechanism = PLAIN | GSSAPI | SCRAM-SHA-
256 | SCRAM-SHA-512
8 © Hortonworks Inc. 2011–2018. All rights reserved.
• Supports user authentication via
• Username / Password
• GSSAPI (Kerberos Ticket)
• SCRAM (Salted Password)
• Supports User authorization via Kafka ACLs or Apache Ranger
• Sends secrets & data over the wire in "Plain" Encrypted format
• How to configure
• Pre-configure authentication mechanism
• Setup per-node certificate truststore/keystore for broker(s) & client(s)
SASL_SSL
Apache Kafka Security Models
Broker-side: Client-side:
listeners=SASL_SSL://127.0.0.1:6667 security.protocol = SASL_SSL
inter.broker.protocol=SASL_SSL
sasl.enabled.mechanism=PLAIN | GSSAPI | SCRAM
sasl.mechanism = PLAIN | GSSAPI | SCRAM-SHA-
256 | SCRAM-SHA-512
9 © Hortonworks Inc. 2011–2018. All rights reserved.
Apache Kafka Security Models - A Ready Reckoner
security.protocol
User
Authentication
Authorization
Encryption
Over Wire
PLAINTEXT ✗ ✗ ✗
SSL ✗
Host Based (via
SSL certificates) ✓
SASL_PLAINTEXT
PLAIN | KRB5 |
SCRAM
Kafka ACLs /
Ranger ✗
SASL_SSL
PLAIN | KRB5 |
SCRAM
Kafka ACLs /
Ranger ✓
* Available in Apache Kafka 0.9.0 and above
10 © Hortonworks Inc. 2011–2018. All rights reserved.
• Enable Krb debug for SASL clients (consumer/producer)
• export KAFKA_OPTS="-Dsun.security.krb5.debug=true"
• Enable SSL debug for clients
• export KAFKA_OPTS="-Djavax.net.debug=ssl"
• Enable Krb / SSL debug for Kafka Broker (AMBARI-24151)
• Enable this in console as 'kafka' user & start the Broker from command line:
• export KAFKA_KERBEROS_PARAMS="$KAFKA_KERBEROS_PARAMS
-Dsun.security.krb5.debug=true -Djavax.net.debug=ssl"
• /usr/hdp/current/kafka-broker/bin/kafka-server-start.sh -daemon
/etc/kafka/conf/server.properties
How to troubleshoot security issues?
* Disable debug properties once you are done with troubleshooting, otherwise it’s going to bloat the log files
11 © Hortonworks Inc. 2011–2018. All rights reserved.
• Enable Kafka Broker log4j debug
• Set log4j.logger.kafka=DEBUG, kafkaAppender in /etc/kafka/conf/log4j.properties
• Enable Kafka Ranger log4j debug
• Set log4j.logger.org.apache.ranger=DEBUG, rangerAppender in /etc/kafka/conf/log4j.properties
• Enable Kafka Client debug
• Set log4j.rootLogger=DEBUG, stderr in /etc/kafka/conf/tools-log4j.properties
How to troubleshoot security issues?
* Disable debug properties once you are done with troubleshooting, otherwise it’s going to bloat the log files
12 © Hortonworks Inc. 2011–2018. All rights reserved.
How does Kerberos debug messages look like in Apache Kafka logs
13 © Hortonworks Inc. 2011–2018. All rights reserved.
• Create a Kafka topic
• Should be run only on Kafka Broker node as 'kafka' user (why?)
• /usr/hdp/current/kafka-broker/bin/kafka-topics.sh --create --topic testvr46 --zookeeper
bali3.openstacklocal:2181 --partitions 1 --replication-factor 1
• Use Kafka Console Producer to write messages to above Kafka topic
• Can be run from any Kafka client node as any user
• Make sure that authentication token is acquired and user has permission to 'Describe' & 'Publish'
• /usr/hdp/current/kafka-broker/bin/kafka-console-producer.sh --broker-list
bali2.openstacklocal:6667 --topic testvr46 --security-protocol PLAINTEXTSASL
• Use Kafka Console Consumer to read messages from the Kafka topic
• Can be run from another or same Kafka client as the same or different user
• Make sure that authentication token is acquired and user has permission to 'Consume'
• /usr/hdp/current/kafka-broker/bin/kafka-console-consumer.sh –bootstrap-server
bali2.openstacklocal:6667 --topic testvr46 --security-protocol PLAINTEXTSASL --from-beginning
Troubleshoot Using Kafka Console Consumer/Producer
14 © Hortonworks Inc. 2011–2018. All rights reserved.
• javax.security.auth.login.LoginException
• Check JAAS configuration
• Could not login: the client is being asked for a password
• Again, issue with JAAS configuration - either Ticket not found or Bad / inaccessible user keytab
• PKIX path building failed - unable to find valid certification path to requested target
• Issue with SSL truststore; most likely truststore not present or readable
• No User Authentication / Authorization
Most Common Errors
15 © Hortonworks Inc. 2011–2018. All rights reserved.
• No Kerberos = No Security
• All the pain is well worth it !
• Enabling SSL is only half the story
• Having SSL without Authentication is meaningless
• Using any SASL (i.e. Authentication) without SSL is dangerous
• Use Apache Ranger for large deployments with many users
Apache Kafka Security - Dos and Don'ts
16 © Hortonworks Inc. 2011–2018. All rights reserved.
Questions?
17 © Hortonworks Inc. 2011–2018. All rights reserved.
Thank you
Acknowledgements:
- Hugo Da Cruz Louro (Apache Storm Committer)
- Deepna Bains (Hortonworks)
- Kat Petre (Hortonworks)
- Jesus Alvarez (IBM DSX)

More Related Content

What's hot

Kafka Security 101 and Real-World Tips
Kafka Security 101 and Real-World Tips Kafka Security 101 and Real-World Tips
Kafka Security 101 and Real-World Tips
confluent
 

What's hot (20)

Using Vault to decouple MySQL Secrets
Using Vault to decouple MySQL SecretsUsing Vault to decouple MySQL Secrets
Using Vault to decouple MySQL Secrets
 
Introduction to Kafka Streams
Introduction to Kafka StreamsIntroduction to Kafka Streams
Introduction to Kafka Streams
 
Kafka Security 101 and Real-World Tips
Kafka Security 101 and Real-World Tips Kafka Security 101 and Real-World Tips
Kafka Security 101 and Real-World Tips
 
Apache Kafka Architecture & Fundamentals Explained
Apache Kafka Architecture & Fundamentals ExplainedApache Kafka Architecture & Fundamentals Explained
Apache Kafka Architecture & Fundamentals Explained
 
Adopting HashiCorp Vault
Adopting HashiCorp VaultAdopting HashiCorp Vault
Adopting HashiCorp Vault
 
Exactly-once Semantics in Apache Kafka
Exactly-once Semantics in Apache KafkaExactly-once Semantics in Apache Kafka
Exactly-once Semantics in Apache Kafka
 
Hashicorp Vault ppt
Hashicorp Vault pptHashicorp Vault ppt
Hashicorp Vault ppt
 
Fundamentals of Apache Kafka
Fundamentals of Apache KafkaFundamentals of Apache Kafka
Fundamentals of Apache Kafka
 
HashiCorp's Vault - The Examples
HashiCorp's Vault - The ExamplesHashiCorp's Vault - The Examples
HashiCorp's Vault - The Examples
 
Vault - Secret and Key Management
Vault - Secret and Key ManagementVault - Secret and Key Management
Vault - Secret and Key Management
 
Kafka presentation
Kafka presentationKafka presentation
Kafka presentation
 
EDB Postgres DBA Best Practices
EDB Postgres DBA Best PracticesEDB Postgres DBA Best Practices
EDB Postgres DBA Best Practices
 
Introducing Vault
Introducing VaultIntroducing Vault
Introducing Vault
 
Apache Kafka Best Practices
Apache Kafka Best PracticesApache Kafka Best Practices
Apache Kafka Best Practices
 
Benchmarking NGINX for Accuracy and Results
Benchmarking NGINX for Accuracy and ResultsBenchmarking NGINX for Accuracy and Results
Benchmarking NGINX for Accuracy and Results
 
Apache Kafka at LinkedIn
Apache Kafka at LinkedInApache Kafka at LinkedIn
Apache Kafka at LinkedIn
 
Apache Kafka Security
Apache Kafka Security Apache Kafka Security
Apache Kafka Security
 
Kafka’s New Control Plane: The Quorum Controller | Colin McCabe, Confluent
Kafka’s New Control Plane: The Quorum Controller | Colin McCabe, ConfluentKafka’s New Control Plane: The Quorum Controller | Colin McCabe, Confluent
Kafka’s New Control Plane: The Quorum Controller | Colin McCabe, Confluent
 
An introduction to SSH
An introduction to SSHAn introduction to SSH
An introduction to SSH
 
Vault 101
Vault 101Vault 101
Vault 101
 

Similar to Visualizing Kafka Security

Spark summit-east-dowling-feb2017-full
Spark summit-east-dowling-feb2017-fullSpark summit-east-dowling-feb2017-full
Spark summit-east-dowling-feb2017-full
Jim Dowling
 
Spark-Streaming-as-a-Service with Kafka and YARN: Spark Summit East talk by J...
Spark-Streaming-as-a-Service with Kafka and YARN: Spark Summit East talk by J...Spark-Streaming-as-a-Service with Kafka and YARN: Spark Summit East talk by J...
Spark-Streaming-as-a-Service with Kafka and YARN: Spark Summit East talk by J...
Spark Summit
 

Similar to Visualizing Kafka Security (20)

Paris FOD meetup - kafka security 101
Paris FOD meetup - kafka security 101Paris FOD meetup - kafka security 101
Paris FOD meetup - kafka security 101
 
Kafka 2018 - Securing Kafka the Right Way
Kafka 2018 - Securing Kafka the Right WayKafka 2018 - Securing Kafka the Right Way
Kafka 2018 - Securing Kafka the Right Way
 
Kafka Security
Kafka SecurityKafka Security
Kafka Security
 
Mysql user-camp-march-11th-2016
Mysql user-camp-march-11th-2016Mysql user-camp-march-11th-2016
Mysql user-camp-march-11th-2016
 
MariaDB Server & MySQL Security Essentials 2016
MariaDB Server & MySQL Security Essentials 2016MariaDB Server & MySQL Security Essentials 2016
MariaDB Server & MySQL Security Essentials 2016
 
Flexible Authentication Strategies with SASL/OAUTHBEARER (Michael Kaminski, T...
Flexible Authentication Strategies with SASL/OAUTHBEARER (Michael Kaminski, T...Flexible Authentication Strategies with SASL/OAUTHBEARER (Michael Kaminski, T...
Flexible Authentication Strategies with SASL/OAUTHBEARER (Michael Kaminski, T...
 
TechEvent 2019: Wie sichere ich eigentlich Kafka ab?; Markus Bente - Trivadis
TechEvent 2019: Wie sichere ich eigentlich Kafka ab?; Markus Bente - TrivadisTechEvent 2019: Wie sichere ich eigentlich Kafka ab?; Markus Bente - Trivadis
TechEvent 2019: Wie sichere ich eigentlich Kafka ab?; Markus Bente - Trivadis
 
Chickens & Eggs: Managing secrets in AWS with Hashicorp Vault
Chickens & Eggs: Managing secrets in AWS with Hashicorp VaultChickens & Eggs: Managing secrets in AWS with Hashicorp Vault
Chickens & Eggs: Managing secrets in AWS with Hashicorp Vault
 
Encrypt your volumes with barbican open stack 2018
Encrypt your volumes with barbican open stack 2018Encrypt your volumes with barbican open stack 2018
Encrypt your volumes with barbican open stack 2018
 
Securing Spark Applications
Securing Spark ApplicationsSecuring Spark Applications
Securing Spark Applications
 
Show Me Kafka Tools That Will Increase My Productivity! (Stephane Maarek, Dat...
Show Me Kafka Tools That Will Increase My Productivity! (Stephane Maarek, Dat...Show Me Kafka Tools That Will Increase My Productivity! (Stephane Maarek, Dat...
Show Me Kafka Tools That Will Increase My Productivity! (Stephane Maarek, Dat...
 
Adopting Modern SSL / TLS
Adopting Modern SSL / TLSAdopting Modern SSL / TLS
Adopting Modern SSL / TLS
 
Jim Dowling - Multi-tenant Flink-as-a-Service on YARN
Jim Dowling - Multi-tenant Flink-as-a-Service on YARN Jim Dowling - Multi-tenant Flink-as-a-Service on YARN
Jim Dowling - Multi-tenant Flink-as-a-Service on YARN
 
Multi-tenant Flink as-a-service with Kafka on Hopsworks
Multi-tenant Flink as-a-service with Kafka on HopsworksMulti-tenant Flink as-a-service with Kafka on Hopsworks
Multi-tenant Flink as-a-service with Kafka on Hopsworks
 
Apache Kafka - Strakin Technologies Pvt Ltd
Apache Kafka - Strakin Technologies Pvt LtdApache Kafka - Strakin Technologies Pvt Ltd
Apache Kafka - Strakin Technologies Pvt Ltd
 
Nikto
NiktoNikto
Nikto
 
Better encryption & security with MariaDB 10.1 & MySQL 5.7
Better encryption & security with MariaDB 10.1 & MySQL 5.7Better encryption & security with MariaDB 10.1 & MySQL 5.7
Better encryption & security with MariaDB 10.1 & MySQL 5.7
 
Spark summit-east-dowling-feb2017-full
Spark summit-east-dowling-feb2017-fullSpark summit-east-dowling-feb2017-full
Spark summit-east-dowling-feb2017-full
 
Spark-Streaming-as-a-Service with Kafka and YARN: Spark Summit East talk by J...
Spark-Streaming-as-a-Service with Kafka and YARN: Spark Summit East talk by J...Spark-Streaming-as-a-Service with Kafka and YARN: Spark Summit East talk by J...
Spark-Streaming-as-a-Service with Kafka and YARN: Spark Summit East talk by J...
 
Ten Commandments of Secure Coding - OWASP Top Ten Proactive Controls
Ten Commandments of Secure Coding - OWASP Top Ten Proactive ControlsTen Commandments of Secure Coding - OWASP Top Ten Proactive Controls
Ten Commandments of Secure Coding - OWASP Top Ten Proactive Controls
 

More from DataWorks Summit

HBase Global Indexing to support large-scale data ingestion at Uber
HBase Global Indexing to support large-scale data ingestion at UberHBase Global Indexing to support large-scale data ingestion at Uber
HBase Global Indexing to support large-scale data ingestion at Uber
DataWorks Summit
 
Security Framework for Multitenant Architecture
Security Framework for Multitenant ArchitectureSecurity Framework for Multitenant Architecture
Security Framework for Multitenant Architecture
DataWorks Summit
 
Computer Vision: Coming to a Store Near You
Computer Vision: Coming to a Store Near YouComputer Vision: Coming to a Store Near You
Computer Vision: Coming to a Store Near You
DataWorks Summit
 

More from DataWorks Summit (20)

Data Science Crash Course
Data Science Crash CourseData Science Crash Course
Data Science Crash Course
 
Floating on a RAFT: HBase Durability with Apache Ratis
Floating on a RAFT: HBase Durability with Apache RatisFloating on a RAFT: HBase Durability with Apache Ratis
Floating on a RAFT: HBase Durability with Apache Ratis
 
Tracking Crime as It Occurs with Apache Phoenix, Apache HBase and Apache NiFi
Tracking Crime as It Occurs with Apache Phoenix, Apache HBase and Apache NiFiTracking Crime as It Occurs with Apache Phoenix, Apache HBase and Apache NiFi
Tracking Crime as It Occurs with Apache Phoenix, Apache HBase and Apache NiFi
 
HBase Tales From the Trenches - Short stories about most common HBase operati...
HBase Tales From the Trenches - Short stories about most common HBase operati...HBase Tales From the Trenches - Short stories about most common HBase operati...
HBase Tales From the Trenches - Short stories about most common HBase operati...
 
Optimizing Geospatial Operations with Server-side Programming in HBase and Ac...
Optimizing Geospatial Operations with Server-side Programming in HBase and Ac...Optimizing Geospatial Operations with Server-side Programming in HBase and Ac...
Optimizing Geospatial Operations with Server-side Programming in HBase and Ac...
 
Managing the Dewey Decimal System
Managing the Dewey Decimal SystemManaging the Dewey Decimal System
Managing the Dewey Decimal System
 
Practical NoSQL: Accumulo's dirlist Example
Practical NoSQL: Accumulo's dirlist ExamplePractical NoSQL: Accumulo's dirlist Example
Practical NoSQL: Accumulo's dirlist Example
 
HBase Global Indexing to support large-scale data ingestion at Uber
HBase Global Indexing to support large-scale data ingestion at UberHBase Global Indexing to support large-scale data ingestion at Uber
HBase Global Indexing to support large-scale data ingestion at Uber
 
Scaling Cloud-Scale Translytics Workloads with Omid and Phoenix
Scaling Cloud-Scale Translytics Workloads with Omid and PhoenixScaling Cloud-Scale Translytics Workloads with Omid and Phoenix
Scaling Cloud-Scale Translytics Workloads with Omid and Phoenix
 
Building the High Speed Cybersecurity Data Pipeline Using Apache NiFi
Building the High Speed Cybersecurity Data Pipeline Using Apache NiFiBuilding the High Speed Cybersecurity Data Pipeline Using Apache NiFi
Building the High Speed Cybersecurity Data Pipeline Using Apache NiFi
 
Supporting Apache HBase : Troubleshooting and Supportability Improvements
Supporting Apache HBase : Troubleshooting and Supportability ImprovementsSupporting Apache HBase : Troubleshooting and Supportability Improvements
Supporting Apache HBase : Troubleshooting and Supportability Improvements
 
Security Framework for Multitenant Architecture
Security Framework for Multitenant ArchitectureSecurity Framework for Multitenant Architecture
Security Framework for Multitenant Architecture
 
Presto: Optimizing Performance of SQL-on-Anything Engine
Presto: Optimizing Performance of SQL-on-Anything EnginePresto: Optimizing Performance of SQL-on-Anything Engine
Presto: Optimizing Performance of SQL-on-Anything Engine
 
Introducing MlFlow: An Open Source Platform for the Machine Learning Lifecycl...
Introducing MlFlow: An Open Source Platform for the Machine Learning Lifecycl...Introducing MlFlow: An Open Source Platform for the Machine Learning Lifecycl...
Introducing MlFlow: An Open Source Platform for the Machine Learning Lifecycl...
 
Extending Twitter's Data Platform to Google Cloud
Extending Twitter's Data Platform to Google CloudExtending Twitter's Data Platform to Google Cloud
Extending Twitter's Data Platform to Google Cloud
 
Event-Driven Messaging and Actions using Apache Flink and Apache NiFi
Event-Driven Messaging and Actions using Apache Flink and Apache NiFiEvent-Driven Messaging and Actions using Apache Flink and Apache NiFi
Event-Driven Messaging and Actions using Apache Flink and Apache NiFi
 
Securing Data in Hybrid on-premise and Cloud Environments using Apache Ranger
Securing Data in Hybrid on-premise and Cloud Environments using Apache RangerSecuring Data in Hybrid on-premise and Cloud Environments using Apache Ranger
Securing Data in Hybrid on-premise and Cloud Environments using Apache Ranger
 
Big Data Meets NVM: Accelerating Big Data Processing with Non-Volatile Memory...
Big Data Meets NVM: Accelerating Big Data Processing with Non-Volatile Memory...Big Data Meets NVM: Accelerating Big Data Processing with Non-Volatile Memory...
Big Data Meets NVM: Accelerating Big Data Processing with Non-Volatile Memory...
 
Computer Vision: Coming to a Store Near You
Computer Vision: Coming to a Store Near YouComputer Vision: Coming to a Store Near You
Computer Vision: Coming to a Store Near You
 
Big Data Genomics: Clustering Billions of DNA Sequences with Apache Spark
Big Data Genomics: Clustering Billions of DNA Sequences with Apache SparkBig Data Genomics: Clustering Billions of DNA Sequences with Apache Spark
Big Data Genomics: Clustering Billions of DNA Sequences with Apache Spark
 

Recently uploaded

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Recently uploaded (20)

Transforming The New York Times: Empowering Evolution through UX
Transforming The New York Times: Empowering Evolution through UXTransforming The New York Times: Empowering Evolution through UX
Transforming The New York Times: Empowering Evolution through UX
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
The architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdfThe architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdf
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdf
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Enterprise Security Monitoring, And Log Management.
Enterprise Security Monitoring, And Log Management.Enterprise Security Monitoring, And Log Management.
Enterprise Security Monitoring, And Log Management.
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG Evaluation
 

Visualizing Kafka Security

  • 1. 1 © Hortonworks Inc. 2011–2018. All rights reserved. Visualizing Security in Apache Kafka Vipin Rathor Sr. Product Specialist (Security) @VipinRathor46
  • 2. 2 © Hortonworks Inc. 2011–2018. All rights reserved. $whoami • Currently work for Hortonworks as Security SME • Areas of Interest: Security & Governance, CyberSecurity, Streaming • Contributor to MIT Kerberos, IBM Kerberos, Core Hadoop, Apache Zeppelin & more • Implemented SPKM (a GSSAPI mechanism) RFC • Hold 03 US Patents in Computer Security et. al. • Authored IBM Redbook® on IBM Websphere® + Kerberos
  • 3. 3 © Hortonworks Inc. 2011–2018. All rights reserved. Agenda • Apache Kafka Security Models • PLAINTEXT • SSL • SASL_PLAINTEXT • SASL_SSL • Apache Kafka Security Models - A Ready Reckoner • How to Troubleshoot security issues • Most Common Errors • Apache Kafka Security - Dos and Don’ts
  • 4. 4 © Hortonworks Inc. 2011–2018. All rights reserved. • End-user Authentication (Is user who he/she claims to be?) • User Authorization (Does authenticated user have access to this resource?) • In-flight data i.e. Communication between • Kafka Broker <--> Kafka Clients (Consumer/Producers) • Kafka Broker <--> Kafka Broker • Kafka Broker <--> Zookeeper What Are We Securing? • Data persisted on-disk, e.g. security through data encryption What Are We NOT Securing?
  • 5. 5 © Hortonworks Inc. 2011–2018. All rights reserved. • No Authentication / No Authorization / insecure channel => ZERO security • Default security method • To be used only for Proof-of-Concept • Absolutely NOT recommended for use in Dev/Test/Prod environment PLAINTEXT Apache Kafka Security Models
  • 6. 6 © Hortonworks Inc. 2011–2018. All rights reserved. • X.509 Certificate based model - only secures the HTTP channel • Performs certificate based host authorization • No User Authentication / Authorization • How to configure • Setup per-node certificate truststore/keystore for brokers & clients SSL Apache Kafka Security Models Broker-side: Client-side: listeners=SSL://127.0.0.1:6667 security.protocol = SSL inter.broker.protocol=SSL
  • 7. 7 © Hortonworks Inc. 2011–2018. All rights reserved. • Supports user authentication via • Username / Password • GSSAPI (Kerberos Ticket) • SCRAM (Salted Password) • Supports User authorization via Kafka ACLs or Apache Ranger • Sends secrets & data over the wire in "Plain" format • How to configure • Pre-configure authentication mechanism SASL_PLAINTEXT (or PLAINTEXTSASL in older version) Apache Kafka Security Models Broker-side: Client-side: listeners=SASL_PLAINTEXT://127.0.0.1:6667 security.protocol = SASL_PLAINTEXT inter.broker.protocol=SASL_PLAINTEXT sasl.enabled.mechanism=PLAIN | GSSAPI | SCRAM sasl.mechanism = PLAIN | GSSAPI | SCRAM-SHA- 256 | SCRAM-SHA-512
  • 8. 8 © Hortonworks Inc. 2011–2018. All rights reserved. • Supports user authentication via • Username / Password • GSSAPI (Kerberos Ticket) • SCRAM (Salted Password) • Supports User authorization via Kafka ACLs or Apache Ranger • Sends secrets & data over the wire in "Plain" Encrypted format • How to configure • Pre-configure authentication mechanism • Setup per-node certificate truststore/keystore for broker(s) & client(s) SASL_SSL Apache Kafka Security Models Broker-side: Client-side: listeners=SASL_SSL://127.0.0.1:6667 security.protocol = SASL_SSL inter.broker.protocol=SASL_SSL sasl.enabled.mechanism=PLAIN | GSSAPI | SCRAM sasl.mechanism = PLAIN | GSSAPI | SCRAM-SHA- 256 | SCRAM-SHA-512
  • 9. 9 © Hortonworks Inc. 2011–2018. All rights reserved. Apache Kafka Security Models - A Ready Reckoner security.protocol User Authentication Authorization Encryption Over Wire PLAINTEXT ✗ ✗ ✗ SSL ✗ Host Based (via SSL certificates) ✓ SASL_PLAINTEXT PLAIN | KRB5 | SCRAM Kafka ACLs / Ranger ✗ SASL_SSL PLAIN | KRB5 | SCRAM Kafka ACLs / Ranger ✓ * Available in Apache Kafka 0.9.0 and above
  • 10. 10 © Hortonworks Inc. 2011–2018. All rights reserved. • Enable Krb debug for SASL clients (consumer/producer) • export KAFKA_OPTS="-Dsun.security.krb5.debug=true" • Enable SSL debug for clients • export KAFKA_OPTS="-Djavax.net.debug=ssl" • Enable Krb / SSL debug for Kafka Broker (AMBARI-24151) • Enable this in console as 'kafka' user & start the Broker from command line: • export KAFKA_KERBEROS_PARAMS="$KAFKA_KERBEROS_PARAMS -Dsun.security.krb5.debug=true -Djavax.net.debug=ssl" • /usr/hdp/current/kafka-broker/bin/kafka-server-start.sh -daemon /etc/kafka/conf/server.properties How to troubleshoot security issues? * Disable debug properties once you are done with troubleshooting, otherwise it’s going to bloat the log files
  • 11. 11 © Hortonworks Inc. 2011–2018. All rights reserved. • Enable Kafka Broker log4j debug • Set log4j.logger.kafka=DEBUG, kafkaAppender in /etc/kafka/conf/log4j.properties • Enable Kafka Ranger log4j debug • Set log4j.logger.org.apache.ranger=DEBUG, rangerAppender in /etc/kafka/conf/log4j.properties • Enable Kafka Client debug • Set log4j.rootLogger=DEBUG, stderr in /etc/kafka/conf/tools-log4j.properties How to troubleshoot security issues? * Disable debug properties once you are done with troubleshooting, otherwise it’s going to bloat the log files
  • 12. 12 © Hortonworks Inc. 2011–2018. All rights reserved. How does Kerberos debug messages look like in Apache Kafka logs
  • 13. 13 © Hortonworks Inc. 2011–2018. All rights reserved. • Create a Kafka topic • Should be run only on Kafka Broker node as 'kafka' user (why?) • /usr/hdp/current/kafka-broker/bin/kafka-topics.sh --create --topic testvr46 --zookeeper bali3.openstacklocal:2181 --partitions 1 --replication-factor 1 • Use Kafka Console Producer to write messages to above Kafka topic • Can be run from any Kafka client node as any user • Make sure that authentication token is acquired and user has permission to 'Describe' & 'Publish' • /usr/hdp/current/kafka-broker/bin/kafka-console-producer.sh --broker-list bali2.openstacklocal:6667 --topic testvr46 --security-protocol PLAINTEXTSASL • Use Kafka Console Consumer to read messages from the Kafka topic • Can be run from another or same Kafka client as the same or different user • Make sure that authentication token is acquired and user has permission to 'Consume' • /usr/hdp/current/kafka-broker/bin/kafka-console-consumer.sh –bootstrap-server bali2.openstacklocal:6667 --topic testvr46 --security-protocol PLAINTEXTSASL --from-beginning Troubleshoot Using Kafka Console Consumer/Producer
  • 14. 14 © Hortonworks Inc. 2011–2018. All rights reserved. • javax.security.auth.login.LoginException • Check JAAS configuration • Could not login: the client is being asked for a password • Again, issue with JAAS configuration - either Ticket not found or Bad / inaccessible user keytab • PKIX path building failed - unable to find valid certification path to requested target • Issue with SSL truststore; most likely truststore not present or readable • No User Authentication / Authorization Most Common Errors
  • 15. 15 © Hortonworks Inc. 2011–2018. All rights reserved. • No Kerberos = No Security • All the pain is well worth it ! • Enabling SSL is only half the story • Having SSL without Authentication is meaningless • Using any SASL (i.e. Authentication) without SSL is dangerous • Use Apache Ranger for large deployments with many users Apache Kafka Security - Dos and Don'ts
  • 16. 16 © Hortonworks Inc. 2011–2018. All rights reserved. Questions?
  • 17. 17 © Hortonworks Inc. 2011–2018. All rights reserved. Thank you Acknowledgements: - Hugo Da Cruz Louro (Apache Storm Committer) - Deepna Bains (Hortonworks) - Kat Petre (Hortonworks) - Jesus Alvarez (IBM DSX)

Editor's Notes

  1. TALK TRACK Hortonworks Powers the Future of Data: data-in-motion, data-at-rest, and Modern Data Applications. [NEXT SLIDE]