chapter ten

10 Protecting Kafka

 

This chapter covers:

  • Setting up SSL between our cluster and our clients
  • Looking at SASL with Kerberos
  • Using quotas
  • Configuring Access Control Lists (ACLs)

This chapter will focus on keeping our data locked down to only those that need to read or write to it. Since security is a huge area to cover, we will talk about some basic concepts to get a general background on the options we have in Kafka. This will not be an exhaustive guide of security in general, but with that foundation, we will try to discuss some of the practical actions you would take in your setup. We will have client impacts as well as brokers and ZooKeeper to make our cluster more secure.

Of course, your data might not need some of the protections we discuss. If you are not tracking anything of a secure nature, i.e. personal information or financial data, then you might not even need this protections. Knowing your data is key to deciding if you need the tradeoffs of managing access. For a quick example, if you are handling any thing related to personal information like date of birth or credit card numbers, you will mostly like want to look at most of the security options discussed in this chapter. However, if you are only handling generic information such as the number of web clicks on a series of marketing campaigns, your cluster might not need to introduce features like SSL that might slow down your throughput while at the same time increasing you CPU needs.

10.1  Security Basics

10.1.1  Encryption with SSL

10.1.2  SSL Between Brokers and Clients

10.1.3  SSL Between Brokers

10.2  Simple Authentication and Security Layer (SASL)

10.2.1 Kerberos

10.2.2  HTTP Basic Auth

10.3  Authorization in Kafka

10.3.1  Access Control Lists

10.3.2  Role-based access control

10.4  ZooKeeper

10.4.1  Kerberos Setup

10.5  Quotas

10.5.1  Network Bandwidth Quota

10.5.2  Request Rate Quotas

10.6  Data at Rest

10.6.1  Managed Options

10.7  Summary