Skip to content

Kafka API - Add support for Proxy Protocol v1 and v2  #10589

@c4milo

Description

@c4milo

Who is this for and what problem do they have today?

When Kafka clients access Redpanda clusters from behind a NAT, Redpanda does not receive the client IPs but that of the NAT box. So configuring connection rate limits per source IP becomes unfair as a single misbehaving client will cause Redpanda to rate limit all client connections. This NAT scenario is also common in Cloud providers when people use GCP's Private Service Connect, AWS Private Links or Azure Private Links to access Redpanda clusters since all these services are implemented with NAT.

Cloud providers support the proxy protocol either in the network load balancer (AWS) or directly in the private link implementation (Azure), or they can also start up an additional service such as a target proxy in GCP. So, they will forward the information to Redpanda and Redpanda will need to learn to decode it.

What are the success criteria?

  • Redpanda is able to retrieve the client's source IP when clients connect from behind NATs boxes adding proxy protocol headers.
  • Redpanda correctly applies connection rate limiting per client

Why is solving this problem impactful?

Using private links in Cloud is the most secure way to expose Redpanda clusters to their users, especially when the clusters are managed by platform or shared services teams. They are more secure than VPC peerings and Transit Gateway Attachments (AWS) because the access is unidirectional, connections between two or more VPCs can only be initiated by clients. They also work across VPCs with overlapping CIDRs, unlike peerings, which is hard to avoid at scale when using IPv4. Additionally, Redpanda's ACL host filtering won't work either.

Some initial requirements

  • Redpanda MUST only accept the PROXY protocol if configured to do so.
  • Redpanda MUST only accept the PROXY protocol header from trusted proxies.
  • Redpanda MUST not try to guess whether the PROXY protocol header is present or not.
  • Every intermediary proxy may add its own header, so Redpanda should support decoding multiple headers

References

JIRA Link: CORE-1296

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions