SlideShare una empresa de Scribd logo
1 de 17
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)

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Kafka Tutorial: Kafka Security
Kafka Tutorial: Kafka SecurityKafka Tutorial: Kafka Security
Kafka Tutorial: Kafka Security
 
Stream processing using Kafka
Stream processing using KafkaStream processing using Kafka
Stream processing using Kafka
 
Apache Kafka® Security Overview
Apache Kafka® Security OverviewApache Kafka® Security Overview
Apache Kafka® Security Overview
 
Dynamically Scaling Data Streams across Multiple Kafka Clusters with Zero Fli...
Dynamically Scaling Data Streams across Multiple Kafka Clusters with Zero Fli...Dynamically Scaling Data Streams across Multiple Kafka Clusters with Zero Fli...
Dynamically Scaling Data Streams across Multiple Kafka Clusters with Zero Fli...
 
Kafka 101
Kafka 101Kafka 101
Kafka 101
 
Disaster Recovery and High Availability with Kafka, SRM and MM2
Disaster Recovery and High Availability with Kafka, SRM and MM2Disaster Recovery and High Availability with Kafka, SRM and MM2
Disaster Recovery and High Availability with Kafka, SRM and MM2
 
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
 
From Zero to Hero with Kafka Connect
From Zero to Hero with Kafka ConnectFrom Zero to Hero with Kafka Connect
From Zero to Hero with Kafka Connect
 
Kafka Tutorial: Advanced Producers
Kafka Tutorial: Advanced ProducersKafka Tutorial: Advanced Producers
Kafka Tutorial: Advanced Producers
 
Streaming all over the world Real life use cases with Kafka Streams
Streaming all over the world  Real life use cases with Kafka StreamsStreaming all over the world  Real life use cases with Kafka Streams
Streaming all over the world Real life use cases with Kafka Streams
 
Kafka Tutorial - Introduction to Apache Kafka (Part 1)
Kafka Tutorial - Introduction to Apache Kafka (Part 1)Kafka Tutorial - Introduction to Apache Kafka (Part 1)
Kafka Tutorial - Introduction to Apache Kafka (Part 1)
 
Kafka presentation
Kafka presentationKafka presentation
Kafka presentation
 
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...
 
Introduction to Kafka Streams
Introduction to Kafka StreamsIntroduction to Kafka Streams
Introduction to Kafka Streams
 
Fundamentals of Apache Kafka
Fundamentals of Apache KafkaFundamentals of Apache Kafka
Fundamentals of Apache Kafka
 
Kubernetes - Security Journey
Kubernetes - Security JourneyKubernetes - Security Journey
Kubernetes - Security Journey
 
Envoy and Kafka
Envoy and KafkaEnvoy and Kafka
Envoy and Kafka
 
Kafka Tutorial - basics of the Kafka streaming platform
Kafka Tutorial - basics of the Kafka streaming platformKafka Tutorial - basics of the Kafka streaming platform
Kafka Tutorial - basics of the Kafka streaming platform
 
Kafka 101 and Developer Best Practices
Kafka 101 and Developer Best PracticesKafka 101 and Developer Best Practices
Kafka 101 and Developer Best Practices
 
Monitoring and Resiliency Testing our Apache Kafka Clusters at Goldman Sachs ...
Monitoring and Resiliency Testing our Apache Kafka Clusters at Goldman Sachs ...Monitoring and Resiliency Testing our Apache Kafka Clusters at Goldman Sachs ...
Monitoring and Resiliency Testing our Apache Kafka Clusters at Goldman Sachs ...
 

Similar a 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 a 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
 
Apache Kafka Security
Apache Kafka Security Apache Kafka Security
Apache 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
 
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
 
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
 
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...
 

Más de 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
 

Más de 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
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

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)

Notas del editor

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