SlideShare a Scribd company logo
1 of 39
Download to read offline
Apache Kafka
SASL/OAUTHBEARER
Ron Dagostino Mike Kaminski
Kafka Authn/Encryption Summary
Security Protocol Authentication Encryption
PLAINTEXT NO NO
SSL NO YES
SSL
ssl.client.auth=required
Client Cert YES
SASL_PLAINTEXT SASL Mechanism NO
SASL_SSL SASL Mechanism YES
SASL Mechanisms in Kafka, late 2017
• PLAIN (username/password authentication)
• SCRAM-related (Salted Challenge Response Authentication Mechanism)
• SCRAM-SHA-256
• SCRAM-SHA-512
• GSSAPI (Kerberos)
KIP-255: OAuth Authentication via SASL/OAUTHBEARER
1. Define when a client will retrieve credentials
2. Define how a client will retrieve credentials
3. Define the transfer of the client’s credentials from JAAS to SASL
4. Define how a broker will validate the client’s credentials
KIP-86: Configurable SASL Callback
Handlers
OAUTHBEARER and KIP-86 (1: When)
OAUTHBEARER and KIP-86 (2: How)
sasl.login.callback.handler.class=com.example.MyCbHandler
listener.name.sasl_ssl.oauthbearer.sasl.login.callback.handler.class=...
Unsecured JWS (RFC 7515)
● Example JAAS config:
KafkaClient {
o.a.k.common.security.oauthbearer.OAuthBearerLoginModule Required
unsecuredLoginStringClaim_sub=”admin”;
};
● JOSE Header: {”alg”:”none”}
● JWT Claims: {”sub”:”admin”,”iat”:<nowSecs>,”exp”:<nowSecs+3600>}
● Token:
eyJhbGciOiJub25lIn0.eyJzdWIiOiJhZG1pbiIsImlhdCI6IDE1NTEyMDQwMTYsImV4cCI6IDE1NTEyMDc2MTZ9.
SASL/OAUTHBEARER: PROD Token Retrieval
public class MySaslLoginCbHandler implements
o.a.k.common.security.auth.AuthenticateCallbackHandler {
public void handle(Callback[] callbacks) throws ... {
for (Callback callback : callbacks) {
/*
* For callback of type OAuthBearerTokenCallback,
* must retrieve token and ultimately invoke
* ((OAuthBearerTokenCallback)callback)
* .token(theRetrievedOAuthBearerToken)
*/
See OAuthBearerUnsecuredLoginCallbackHandler for guidance
OAUTHBEARER and KIP-86 (3: Transfer)
OAUTHBEARER and KIP-86 (4: Validate)
listener.name.sasl_ssl.oauthbearer.sasl.server.callback.handler.class=...
SASL/OAUTHBEARER: PROD Token
Validation
public void handle(Callback[] callbacks) throws ... {
for (Callback callback : callbacks) {
/*
* For callback of type OAuthBearerValidatorCallback,
* must retrieve token value via .token()
* and ultimately invoke
* ((OAuthBearerValidatorCallback)callback)
* .token(theValidatedOAuthBearerToken)
*/
Non-JVM Clients
• librdkafka: https://github.com/edenhill/librdkafka/pull/2189
• Adds C/C++ support in next release after current v1.0 release (v1.0.1?)
• Go (https://github.com/confluentinc/confluent-kafka-go/pull/300/)
• Python, .NET Support
• Shopify/sarama -- Go client (Mike)
• zendesk/ruby-kafka
Long-Lived Kafka Connections
● OAuth tokens have a fixed lifetime
● What if we want to use the token contents for authz?
○ (OAUTHBEARER.token negotiated property)
● Need to also remove ACLs when disabling an identity
KIP-368: SASL Client Re-Authentication
● Released in v2.2.0
● Adds connections.max.reauth.ms broker property
(optional prefix: listener.name.sasl_[plaintext|ssl].<mechanism>.)
● Opt-in
KIP-368: SASL Client Re-Authentication
● Broker tells clients when they must re-authenticate by
● v2.2.0+ Java clients “understand”
○ will transparently re-authenticate
● Broker closes the connection when used if not properly re-
authenticated
○ clients that don’t understand: disconnected
○ will re-connect (forcing a new authentication)
The KIP Process
● Governance
○ Create the KIP, discuss over email
○ Maybe include a pull request
○ Vote after discussion completes
● Want: “Yes, this is a good feature to add!”
● Stay focused
● Don’t be defensive
○ “Hmm... The PR looks quite a lot different from what I hoped we would do...”
○ “lol. Yeah, I'm not surprised to get this feedback... this feedback is excellent.
Let me try to unpack/address it, and let’s see where we end up.”
SASL/OAUTHBEARER
+
1. How we use Kafka.
2. Authentication challenges.
3. Reimagining the on-boarding experience.
4. SASL/OAUTHBEARER to the rescue!
All news content published from
1851-today is stored in a single-
partition Kafka topic called the
monolog.
The source of truth
The source of truth
From the monolog, consumers...
• create purpose-built data
stores
• take action upon publication
of new events
Pipeline Architecture
The Publishing Pipeline team
operates Kafka as a service for
internal teams on the consumer
side.
Pipeline Architecture
• Multiple regional clusters
running on Google Compute
Engine
• v0.10.2 (2017-2019)
• v2.x.x (2019)
1. How we use Kafka.
2. Authentication challenges.
3. Reimagining the on-boarding experience.
4. SASL/OAUTHBEARER to the rescue!
Sources of Development Friction
• Existing Kafka auth features—SASL/{GSSAPI, PLAIN, SCAM}, SSL—
did not fit with GCP auth model employed by other Pipeline
microservices.
• Onboarding a new team often involved 1:1 assistance.
• Users were discouraged from prototyping apps.
• In general, developers preferred Google Cloud Pub/Sub because it
was easier to set up than a monolog Kafka consumer.
1. How we use Kafka.
2. Authentication challenges.
3. Reimagining the on-boarding experience.
4. SASL/OAUTHBEARER to the rescue!
Setting up authentication is often a developer’s first experience with
Kafka.
It’s important to make client on-boarding simple.
Goal: Make creating a Kafka consumer as easy as creating a Cloud
Pub/Sub client.
Overhauling authentication
★ Self-service
★ Leverage Google Cloud Platform auth infrastructure
★ Provide solid documentation and examples
1. How we use Kafka.
2. Authentication challenges.
3. Reimagining the on-boarding experience.
4. SASL/OAUTHBEARER to the rescue!
Why SASL/OAUTHBEARER?
Flexibility!
NYT Kafka client landscape
• Primarily Java and Golang
(Sarama) clients.
• Only the Java client
supported SASL/O.B.
• Keep legacy support for
unsupported clients (Node.js,
etc).
• Write helper libraries to
abstract away client configs
try (Consumer <String, Event> consumer = ConsumerBuilder.newInstance()
.authWithComputeEngine()
.consumerId("my-service-name")
.defaultStartAtEnd()
.environment(Config.Environment.ORIGIN_PRD_CENTRAL)
.buildMonologConsumer()) {
while (true) {
for (ConsumerRecord < String, Event > record: kafkaConsumer.poll(100)) {
// ...do something with the message
}
kafkaConsumer.commitAsync();
}
}
Rollout Process
1. Upgrade to Kafka 2.x.x, run in production for a few weeks.
2. Enable SASL/OAUTHBEARER using a custom callback handler that
leverages the same library the other Publishing Pipeline services use
for authentication.
3. Slowly enable SASL/O.B. on core Pipeline services with option to roll
back by flipping a feature flag.
4. Guide teams through migration process.
So far, so good...
• We’ve cut lots of red tape by helping developers focus on delivering
great products instead of wrangling credentials.
$ pubp consume monolog | jq .
{ "publish": {
"movie": {
"publicationProperties": {
"uri": "nyt://movie/a57bc6f7-5922-593a-bac5-f3ca780d5121",
"type": "movie",
"firstPublished": "2019-03-04T19:46:00.841Z",
"lastModified": "2019-03-04T19:46:00.841Z",
"source": "CMS-1",
"sourceApplication": "pub-app-1",
"eventId": "pubp://event/90590558-0187-430f-b1b7-edb0a51955f1"
},
"imdbId": "tt8268916",
"title": "90 Ml",
"year": 2019
}
}
}
Individual users can tail the log
from a CLI utility using their G-
Suite credentials—big win for
productivity!
Easy to grant ACL access via service account email:
kafka-acls 
--authorizer-properties zookeeper.connect=localhost:2181 
--add 
--allow-principal User:"000000-
compute@developer.gserviceaccount.com" 
--consumer 
--topic topic-name 
--group *
So far, so good...
• We’ve cut lots of red tape by helping developers focus on delivering
great products instead of wrangling credentials.
• Much work remains on nailing down documentation and helper
libraries for additional languages.
• Confluent Cloud support?
Thank you!
Ron Dagostino <rndgstn@gmail.com>
Mike Kaminski <michael.kaminski@nytimes.com>

More Related Content

What's hot

Introducing Kafka's Streams API
Introducing Kafka's Streams APIIntroducing Kafka's Streams API
Introducing Kafka's Streams API
confluent
 

What's hot (20)

Securing Kafka
Securing Kafka Securing Kafka
Securing Kafka
 
Introducing Kafka's Streams API
Introducing Kafka's Streams APIIntroducing Kafka's Streams API
Introducing Kafka's Streams API
 
Integrating Apache Kafka Into Your Environment
Integrating Apache Kafka Into Your EnvironmentIntegrating Apache Kafka Into Your Environment
Integrating Apache Kafka Into Your Environment
 
kafka
kafkakafka
kafka
 
ksqlDB: A Stream-Relational Database System
ksqlDB: A Stream-Relational Database SystemksqlDB: A Stream-Relational Database System
ksqlDB: A Stream-Relational Database System
 
Kafka presentation
Kafka presentationKafka presentation
Kafka presentation
 
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)
 
Bringing Kafka Without Zookeeper Into Production with Colin McCabe | Kafka Su...
Bringing Kafka Without Zookeeper Into Production with Colin McCabe | Kafka Su...Bringing Kafka Without Zookeeper Into Production with Colin McCabe | Kafka Su...
Bringing Kafka Without Zookeeper Into Production with Colin McCabe | Kafka Su...
 
Visualizing Kafka Security
Visualizing Kafka SecurityVisualizing Kafka Security
Visualizing Kafka Security
 
Moving Gigantic Files Into and Out of the Alfresco Repository
Moving Gigantic Files Into and Out of the Alfresco RepositoryMoving Gigantic Files Into and Out of the Alfresco Repository
Moving Gigantic Files Into and Out of the Alfresco Repository
 
Etl is Dead; Long Live Streams
Etl is Dead; Long Live StreamsEtl is Dead; Long Live Streams
Etl is Dead; Long Live Streams
 
Kafka Tutorial: Kafka Security
Kafka Tutorial: Kafka SecurityKafka Tutorial: Kafka Security
Kafka Tutorial: Kafka Security
 
Benefits of Stream Processing and Apache Kafka Use Cases
Benefits of Stream Processing and Apache Kafka Use CasesBenefits of Stream Processing and Apache Kafka Use Cases
Benefits of Stream Processing and Apache Kafka Use Cases
 
Hashicorp Vault ppt
Hashicorp Vault pptHashicorp Vault ppt
Hashicorp Vault ppt
 
Introduction to Kafka Cruise Control
Introduction to Kafka Cruise ControlIntroduction to Kafka Cruise Control
Introduction to Kafka Cruise Control
 
Kafka at Peak Performance
Kafka at Peak PerformanceKafka at Peak Performance
Kafka at Peak Performance
 
Grafana optimization for Prometheus
Grafana optimization for PrometheusGrafana optimization for Prometheus
Grafana optimization for Prometheus
 
Kafka 101
Kafka 101Kafka 101
Kafka 101
 
KSQL-ops! Running ksqlDB in the Wild (Simon Aubury, ThoughtWorks) Kafka Summi...
KSQL-ops! Running ksqlDB in the Wild (Simon Aubury, ThoughtWorks) Kafka Summi...KSQL-ops! Running ksqlDB in the Wild (Simon Aubury, ThoughtWorks) Kafka Summi...
KSQL-ops! Running ksqlDB in the Wild (Simon Aubury, ThoughtWorks) Kafka Summi...
 
Getting Started with Confluent Schema Registry
Getting Started with Confluent Schema RegistryGetting Started with Confluent Schema Registry
Getting Started with Confluent Schema Registry
 

Similar to Flexible Authentication Strategies with SASL/OAUTHBEARER (Michael Kaminski, The New York Times; Ron Dagostino, State Street Corp.) Kafka Summit NYC 2019

Team Collaboration in Kafka Clusters With Maria Berinde-Tampanariu | Current ...
Team Collaboration in Kafka Clusters With Maria Berinde-Tampanariu | Current ...Team Collaboration in Kafka Clusters With Maria Berinde-Tampanariu | Current ...
Team Collaboration in Kafka Clusters With Maria Berinde-Tampanariu | Current ...
HostedbyConfluent
 

Similar to Flexible Authentication Strategies with SASL/OAUTHBEARER (Michael Kaminski, The New York Times; Ron Dagostino, State Street Corp.) Kafka Summit NYC 2019 (20)

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 Summit SF 2017 - Kafka Stream Processing for Everyone with KSQL
Kafka Summit SF 2017 - Kafka Stream Processing for Everyone with KSQLKafka Summit SF 2017 - Kafka Stream Processing for Everyone with KSQL
Kafka Summit SF 2017 - Kafka Stream Processing for Everyone with KSQL
 
Team Collaboration in Kafka Clusters With Maria Berinde-Tampanariu | Current ...
Team Collaboration in Kafka Clusters With Maria Berinde-Tampanariu | Current ...Team Collaboration in Kafka Clusters With Maria Berinde-Tampanariu | Current ...
Team Collaboration in Kafka Clusters With Maria Berinde-Tampanariu | Current ...
 
Apache Kafka - Scalable Message Processing and more!
Apache Kafka - Scalable Message Processing and more!Apache Kafka - Scalable Message Processing and more!
Apache Kafka - Scalable Message Processing and more!
 
Deploying and Operating KSQL
Deploying and Operating KSQLDeploying and Operating KSQL
Deploying and Operating KSQL
 
Sergii Bielskyi "Using Kafka and Azure Event hub together for streaming Big d...
Sergii Bielskyi "Using Kafka and Azure Event hub together for streaming Big d...Sergii Bielskyi "Using Kafka and Azure Event hub together for streaming Big d...
Sergii Bielskyi "Using Kafka and Azure Event hub together for streaming Big d...
 
Running Kafka On Kubernetes With Strimzi For Real-Time Streaming Applications
Running Kafka On Kubernetes With Strimzi For Real-Time Streaming ApplicationsRunning Kafka On Kubernetes With Strimzi For Real-Time Streaming Applications
Running Kafka On Kubernetes With Strimzi For Real-Time Streaming Applications
 
Cloud Platform Symantec Meetup Nov 2014
Cloud Platform Symantec Meetup Nov 2014Cloud Platform Symantec Meetup Nov 2014
Cloud Platform Symantec Meetup Nov 2014
 
Confluent Tech Talk Korea
Confluent Tech Talk KoreaConfluent Tech Talk Korea
Confluent Tech Talk Korea
 
New Features in Confluent Platform 6.0 / Apache Kafka 2.6
New Features in Confluent Platform 6.0 / Apache Kafka 2.6New Features in Confluent Platform 6.0 / Apache Kafka 2.6
New Features in Confluent Platform 6.0 / Apache Kafka 2.6
 
DevOps, Microservices and Serverless Architecture
DevOps, Microservices and Serverless ArchitectureDevOps, Microservices and Serverless Architecture
DevOps, Microservices and Serverless Architecture
 
App fabric introduction
App fabric introductionApp fabric introduction
App fabric introduction
 
Paris FOD meetup - kafka security 101
Paris FOD meetup - kafka security 101Paris FOD meetup - kafka security 101
Paris FOD meetup - kafka security 101
 
Chti jug - 2018-06-26
Chti jug - 2018-06-26Chti jug - 2018-06-26
Chti jug - 2018-06-26
 
Knock Knock, Who’s There? With Justin Chen and Dhruv Jauhar | Current 2022
Knock Knock, Who’s There? With Justin Chen and Dhruv Jauhar | Current 2022Knock Knock, Who’s There? With Justin Chen and Dhruv Jauhar | Current 2022
Knock Knock, Who’s There? With Justin Chen and Dhruv Jauhar | Current 2022
 
Kafka Explainaton
Kafka ExplainatonKafka Explainaton
Kafka Explainaton
 
Powering Remote Developers with Amazon Workspaces
Powering Remote Developers with Amazon WorkspacesPowering Remote Developers with Amazon Workspaces
Powering Remote Developers with Amazon Workspaces
 
Distributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and ScalaDistributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and Scala
 
All Streams Ahead! ksqlDB Workshop ANZ
All Streams Ahead! ksqlDB Workshop ANZAll Streams Ahead! ksqlDB Workshop ANZ
All Streams Ahead! ksqlDB Workshop ANZ
 
Elastically Scaling Kafka Using Confluent
Elastically Scaling Kafka Using ConfluentElastically Scaling Kafka Using Confluent
Elastically Scaling Kafka Using Confluent
 

More from confluent

More from confluent (20)

Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
Evolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI EraEvolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI Era
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Santander Stream Processing with Apache Flink
Santander Stream Processing with Apache FlinkSantander Stream Processing with Apache Flink
Santander Stream Processing with Apache Flink
 
Unlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insightsUnlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insights
 
Workshop híbrido: Stream Processing con Flink
Workshop híbrido: Stream Processing con FlinkWorkshop híbrido: Stream Processing con Flink
Workshop híbrido: Stream Processing con Flink
 
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
 
AWS Immersion Day Mapfre - Confluent
AWS Immersion Day Mapfre   -   ConfluentAWS Immersion Day Mapfre   -   Confluent
AWS Immersion Day Mapfre - Confluent
 
Eventos y Microservicios - Santander TechTalk
Eventos y Microservicios - Santander TechTalkEventos y Microservicios - Santander TechTalk
Eventos y Microservicios - Santander TechTalk
 
Q&A with Confluent Experts: Navigating Networking in Confluent Cloud
Q&A with Confluent Experts: Navigating Networking in Confluent CloudQ&A with Confluent Experts: Navigating Networking in Confluent Cloud
Q&A with Confluent Experts: Navigating Networking in Confluent Cloud
 
Citi TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep DiveCiti TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep Dive
 
Build real-time streaming data pipelines to AWS with Confluent
Build real-time streaming data pipelines to AWS with ConfluentBuild real-time streaming data pipelines to AWS with Confluent
Build real-time streaming data pipelines to AWS with Confluent
 
Q&A with Confluent Professional Services: Confluent Service Mesh
Q&A with Confluent Professional Services: Confluent Service MeshQ&A with Confluent Professional Services: Confluent Service Mesh
Q&A with Confluent Professional Services: Confluent Service Mesh
 
Citi Tech Talk: Event Driven Kafka Microservices
Citi Tech Talk: Event Driven Kafka MicroservicesCiti Tech Talk: Event Driven Kafka Microservices
Citi Tech Talk: Event Driven Kafka Microservices
 
Confluent & GSI Webinars series - Session 3
Confluent & GSI Webinars series - Session 3Confluent & GSI Webinars series - Session 3
Confluent & GSI Webinars series - Session 3
 
Citi Tech Talk: Messaging Modernization
Citi Tech Talk: Messaging ModernizationCiti Tech Talk: Messaging Modernization
Citi Tech Talk: Messaging Modernization
 
Citi Tech Talk: Data Governance for streaming and real time data
Citi Tech Talk: Data Governance for streaming and real time dataCiti Tech Talk: Data Governance for streaming and real time data
Citi Tech Talk: Data Governance for streaming and real time data
 
Confluent & GSI Webinars series: Session 2
Confluent & GSI Webinars series: Session 2Confluent & GSI Webinars series: Session 2
Confluent & GSI Webinars series: Session 2
 
Data In Motion Paris 2023
Data In Motion Paris 2023Data In Motion Paris 2023
Data In Motion Paris 2023
 
Confluent Partner Tech Talk with Synthesis
Confluent Partner Tech Talk with SynthesisConfluent Partner Tech Talk with Synthesis
Confluent Partner Tech Talk with Synthesis
 

Recently uploaded

Recently uploaded (20)

Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
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
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
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
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
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
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
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
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Connecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKConnecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAK
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 

Flexible Authentication Strategies with SASL/OAUTHBEARER (Michael Kaminski, The New York Times; Ron Dagostino, State Street Corp.) Kafka Summit NYC 2019

  • 2. Kafka Authn/Encryption Summary Security Protocol Authentication Encryption PLAINTEXT NO NO SSL NO YES SSL ssl.client.auth=required Client Cert YES SASL_PLAINTEXT SASL Mechanism NO SASL_SSL SASL Mechanism YES
  • 3. SASL Mechanisms in Kafka, late 2017 • PLAIN (username/password authentication) • SCRAM-related (Salted Challenge Response Authentication Mechanism) • SCRAM-SHA-256 • SCRAM-SHA-512 • GSSAPI (Kerberos)
  • 4. KIP-255: OAuth Authentication via SASL/OAUTHBEARER
  • 5. 1. Define when a client will retrieve credentials 2. Define how a client will retrieve credentials 3. Define the transfer of the client’s credentials from JAAS to SASL 4. Define how a broker will validate the client’s credentials KIP-86: Configurable SASL Callback Handlers
  • 7. OAUTHBEARER and KIP-86 (2: How) sasl.login.callback.handler.class=com.example.MyCbHandler listener.name.sasl_ssl.oauthbearer.sasl.login.callback.handler.class=...
  • 8. Unsecured JWS (RFC 7515) ● Example JAAS config: KafkaClient { o.a.k.common.security.oauthbearer.OAuthBearerLoginModule Required unsecuredLoginStringClaim_sub=”admin”; }; ● JOSE Header: {”alg”:”none”} ● JWT Claims: {”sub”:”admin”,”iat”:<nowSecs>,”exp”:<nowSecs+3600>} ● Token: eyJhbGciOiJub25lIn0.eyJzdWIiOiJhZG1pbiIsImlhdCI6IDE1NTEyMDQwMTYsImV4cCI6IDE1NTEyMDc2MTZ9.
  • 9. SASL/OAUTHBEARER: PROD Token Retrieval public class MySaslLoginCbHandler implements o.a.k.common.security.auth.AuthenticateCallbackHandler { public void handle(Callback[] callbacks) throws ... { for (Callback callback : callbacks) { /* * For callback of type OAuthBearerTokenCallback, * must retrieve token and ultimately invoke * ((OAuthBearerTokenCallback)callback) * .token(theRetrievedOAuthBearerToken) */ See OAuthBearerUnsecuredLoginCallbackHandler for guidance
  • 10. OAUTHBEARER and KIP-86 (3: Transfer)
  • 11. OAUTHBEARER and KIP-86 (4: Validate) listener.name.sasl_ssl.oauthbearer.sasl.server.callback.handler.class=...
  • 12. SASL/OAUTHBEARER: PROD Token Validation public void handle(Callback[] callbacks) throws ... { for (Callback callback : callbacks) { /* * For callback of type OAuthBearerValidatorCallback, * must retrieve token value via .token() * and ultimately invoke * ((OAuthBearerValidatorCallback)callback) * .token(theValidatedOAuthBearerToken) */
  • 13. Non-JVM Clients • librdkafka: https://github.com/edenhill/librdkafka/pull/2189 • Adds C/C++ support in next release after current v1.0 release (v1.0.1?) • Go (https://github.com/confluentinc/confluent-kafka-go/pull/300/) • Python, .NET Support • Shopify/sarama -- Go client (Mike) • zendesk/ruby-kafka
  • 14. Long-Lived Kafka Connections ● OAuth tokens have a fixed lifetime ● What if we want to use the token contents for authz? ○ (OAUTHBEARER.token negotiated property) ● Need to also remove ACLs when disabling an identity
  • 15. KIP-368: SASL Client Re-Authentication ● Released in v2.2.0 ● Adds connections.max.reauth.ms broker property (optional prefix: listener.name.sasl_[plaintext|ssl].<mechanism>.) ● Opt-in
  • 16. KIP-368: SASL Client Re-Authentication ● Broker tells clients when they must re-authenticate by ● v2.2.0+ Java clients “understand” ○ will transparently re-authenticate ● Broker closes the connection when used if not properly re- authenticated ○ clients that don’t understand: disconnected ○ will re-connect (forcing a new authentication)
  • 17. The KIP Process ● Governance ○ Create the KIP, discuss over email ○ Maybe include a pull request ○ Vote after discussion completes ● Want: “Yes, this is a good feature to add!” ● Stay focused ● Don’t be defensive ○ “Hmm... The PR looks quite a lot different from what I hoped we would do...” ○ “lol. Yeah, I'm not surprised to get this feedback... this feedback is excellent. Let me try to unpack/address it, and let’s see where we end up.”
  • 19. 1. How we use Kafka. 2. Authentication challenges. 3. Reimagining the on-boarding experience. 4. SASL/OAUTHBEARER to the rescue!
  • 20. All news content published from 1851-today is stored in a single- partition Kafka topic called the monolog. The source of truth
  • 21. The source of truth From the monolog, consumers... • create purpose-built data stores • take action upon publication of new events
  • 22. Pipeline Architecture The Publishing Pipeline team operates Kafka as a service for internal teams on the consumer side.
  • 23. Pipeline Architecture • Multiple regional clusters running on Google Compute Engine • v0.10.2 (2017-2019) • v2.x.x (2019)
  • 24. 1. How we use Kafka. 2. Authentication challenges. 3. Reimagining the on-boarding experience. 4. SASL/OAUTHBEARER to the rescue!
  • 25. Sources of Development Friction • Existing Kafka auth features—SASL/{GSSAPI, PLAIN, SCAM}, SSL— did not fit with GCP auth model employed by other Pipeline microservices. • Onboarding a new team often involved 1:1 assistance. • Users were discouraged from prototyping apps. • In general, developers preferred Google Cloud Pub/Sub because it was easier to set up than a monolog Kafka consumer.
  • 26. 1. How we use Kafka. 2. Authentication challenges. 3. Reimagining the on-boarding experience. 4. SASL/OAUTHBEARER to the rescue!
  • 27. Setting up authentication is often a developer’s first experience with Kafka. It’s important to make client on-boarding simple.
  • 28. Goal: Make creating a Kafka consumer as easy as creating a Cloud Pub/Sub client.
  • 29. Overhauling authentication ★ Self-service ★ Leverage Google Cloud Platform auth infrastructure ★ Provide solid documentation and examples
  • 30. 1. How we use Kafka. 2. Authentication challenges. 3. Reimagining the on-boarding experience. 4. SASL/OAUTHBEARER to the rescue!
  • 32. NYT Kafka client landscape • Primarily Java and Golang (Sarama) clients. • Only the Java client supported SASL/O.B. • Keep legacy support for unsupported clients (Node.js, etc). • Write helper libraries to abstract away client configs
  • 33. try (Consumer <String, Event> consumer = ConsumerBuilder.newInstance() .authWithComputeEngine() .consumerId("my-service-name") .defaultStartAtEnd() .environment(Config.Environment.ORIGIN_PRD_CENTRAL) .buildMonologConsumer()) { while (true) { for (ConsumerRecord < String, Event > record: kafkaConsumer.poll(100)) { // ...do something with the message } kafkaConsumer.commitAsync(); } }
  • 34. Rollout Process 1. Upgrade to Kafka 2.x.x, run in production for a few weeks. 2. Enable SASL/OAUTHBEARER using a custom callback handler that leverages the same library the other Publishing Pipeline services use for authentication. 3. Slowly enable SASL/O.B. on core Pipeline services with option to roll back by flipping a feature flag. 4. Guide teams through migration process.
  • 35. So far, so good... • We’ve cut lots of red tape by helping developers focus on delivering great products instead of wrangling credentials.
  • 36. $ pubp consume monolog | jq . { "publish": { "movie": { "publicationProperties": { "uri": "nyt://movie/a57bc6f7-5922-593a-bac5-f3ca780d5121", "type": "movie", "firstPublished": "2019-03-04T19:46:00.841Z", "lastModified": "2019-03-04T19:46:00.841Z", "source": "CMS-1", "sourceApplication": "pub-app-1", "eventId": "pubp://event/90590558-0187-430f-b1b7-edb0a51955f1" }, "imdbId": "tt8268916", "title": "90 Ml", "year": 2019 } } } Individual users can tail the log from a CLI utility using their G- Suite credentials—big win for productivity!
  • 37. Easy to grant ACL access via service account email: kafka-acls --authorizer-properties zookeeper.connect=localhost:2181 --add --allow-principal User:"000000- compute@developer.gserviceaccount.com" --consumer --topic topic-name --group *
  • 38. So far, so good... • We’ve cut lots of red tape by helping developers focus on delivering great products instead of wrangling credentials. • Much work remains on nailing down documentation and helper libraries for additional languages. • Confluent Cloud support?
  • 39. Thank you! Ron Dagostino <rndgstn@gmail.com> Mike Kaminski <michael.kaminski@nytimes.com>