blog by OSO

Protecting Kafka Cluster: Kafka before client – Putting the guardrails in place for Apache Kafka clients

Sion Smith 23 June 2023
kafka clusters

In this article, we will discuss the importance of protecting Kafka cluster from bad actors and the benefits it brings to your organisation. We will explore the three stages of safeguarding, the challenges faced in each stage, and the ultimate goal of proactive automation. Additionally, we will examine the different approaches to implementing safeguarding measures and the role they play in ensuring a resilient Kafka infrastructure.

Protecting Kafka Cluster?

There are several reasons why safeguarding Kafka cluster is crucial. Firstly, it helps minimise outages and reduces the associated costs. Outages can be expensive, both in terms of monetary losses and the impact on your organisation’s reputation. By implementing protective measures, you can mitigate the risk of downtime and ensure the smooth operation of your Kafka infrastructure.

Secondly, safeguarding Kafka allows you to respond gracefully to change. In a complex organisation with multiple domains and conflicting priorities, the ability to adapt quickly and limit the impact of changes is essential. By reducing friction and enabling efficient collaboration, safeguarding promotes velocity and helps you achieve your goals faster.

Defining Safeguarding Kafka

Safeguarding is the practice of protecting your data and infrastructure from intentional and unintentional threats, both internal and external. It involves implementing measures to ensure the security and resilience of your Kafka system. Safeguarding sits at the intersection of data governance and technical best practices, providing an efficient and reliable system for your Kafka cluster.

After speaking with numerous customers, we have identified three main stages that organisations tend to be in when it comes to safeguarding their Kafka clusters. These stages are complementary to each other and represent different levels of maturity in safeguarding practices.

The Three Stages of Safeguarding Kafka Clusters

Stage One: Safeguarding by Habit

In this stage, safeguarding measures are loosely defined and negotiable. Best practices and efficiency goals are documented in Google Docs or wikis. The business generally agrees to abide by these rules, but enforcement is limited to human interaction. This stage often involves the use of Production Readiness checks, which suffer from relevance and timeliness issues.

Stage Two: Reactive Automation

In this stage, safeguarding measures are implemented through reactive automation. The Kafka cluster generates metrics and monitoring information, which are used to set thresholds and alerts. When issues arise, the right people are notified, and temporary solutions are implemented. However, these temporary solutions can become permanent, resulting in technical debt and a decrease in velocity.

Stage Three: Proactive Automation (The Gold Standard)

The ultimate goal of safeguarding is proactive automation. This stage involves applying checks and balances at the earliest possible point in the Kafka ecosystem, which is at the client level. Proactive automation prevents common mistakes automatically and alerts the appropriate individuals for more complex issues. By enforcing safeguarding measures at the earliest point, you can achieve efficiency and best practices throughout your Kafka infrastructure.

The Importance of Proactive Safeguarding Kafka Clusters

Proactive safeguarding not only prevents outages but also resets the perception of efficiency and best practice within your Kafka infrastructure. It ensures that common mistakes are automatically addressed and more complex issues are preemptively stopped. This encourages developers and application teams to think about the overall efficiency of the system and implement best practices in their software.

Enforcing Inter-domain Contracts

Proactive safeguarding is achieved through the enforcement of inter-domain contracts. These contracts are essentially the interceptor controls that ensure the adherence to safeguarding rules. By having these controls in place, your organisation can react gracefully to change and achieve broader technical goals without the need for lengthy meetings and policies.

Implementing Safeguarding Measures

When it comes to implementing safeguarding measures, there are different approaches to consider. One option is to use client plugins, which would require at least one plugin per application. However, this solution can be difficult to manage and doesn’t fully address the problem, as bad actors can bypass the plugin and go directly to Kafka.

Another option is to use broker plugins, but they also have their limitations and constraints. The preferred solution is to use a proxy, which would sit in the middle and speak the Kafka wire protocol. However, building a proxy that meets the requirements can be a significant technical investment.

A more practical approach is to rely on a platform that takes care of the low-level production aspects and allows you to implement safeguarding rules. This platform would provide the necessary infrastructure and automation to enforce safeguarding measures effectively.

Conclusion

In conclusion, safeguarding your Apache Kafka cluster is essential for protecting your data and infrastructure from threats. It helps minimise outages, enables efficient collaboration, and promotes velocity in achieving your goals. By implementing proactive automation and enforcing inter-domain contracts, you can ensure the resilience and security of your Kafka infrastructure. Remember that proactive safeguarding is not a replacement for data governance and best practice policies but rather a way to enforce these policies in the right place. It also minimises

 reliance on reactive solutions for common issues, allowing you to focus on more complex problems.

To achieve proactive safeguarding, it is important to implement measures at the earliest possible point in the Kafka ecosystem, which is at the client level. By doing so, you can automatically prevent common mistakes and alert the appropriate individuals for more complex issues. This not only prevents outages but also resets the perception of efficiency and best practice within your Kafka infrastructure.

Enforcing inter-domain contracts is key to proactive safeguarding. These contracts act as the interceptor controls that ensure adherence to safeguarding rules. By having these controls in place, your organisation can react gracefully to change and achieve broader technical goals without the need for lengthy meetings and policies.

When it comes to implementing safeguarding measures, there are different approaches to consider. Client plugins, broker plugins, and proxies are all options, but each has its limitations and constraints. A practical approach is to rely on a platform that takes care of the low-level production aspects and allows you to implement safeguarding rules effectively.

In summary, safeguarding your Kafka cluster is crucial for protecting your data and infrastructure. By implementing proactive automation and enforcing inter-domain contracts, you can ensure the resilience and security of your Kafka infrastructure. This not only prevents outages but also promotes efficiency and best practices within your organisation. Remember that proactive safeguarding is not a replacement for data governance and best practice policies, but rather a way to enforce these policies in the right place.


For more content:

How to take your Kafka projects to the next level with a Confluent preferred partner

Event driven Architecture: A Simple Guide

Watch Our Kafka Summit Talk: Offering Kafka as a Service in Your Organisation

Successfully Reduce AWS Costs: 4 Powerful Ways

Understanding Apache Kafka

Get started with OSO professional services for Apache Kafka

Have a conversation with a Kafka expert to discover how we help your adopt of Apache Kafka in your business.

Contact Us