Skip to content

Conversation

@viktorerlingsson
Copy link
Member

@viktorerlingsson viktorerlingsson commented Jan 9, 2026

Summary

  • Add proxy_protocol_trusted_sources config option to specify trusted proxy IPs
  • Only parse PROXY protocol headers from connections originating from trusted sources
  • Connections from untrusted sources have their PROXY headers ignored (uses actual socket IP)
  • Logs warning if proxy protocol enabled without trusted sources configured

This follows the HAProxy proxy protocol specification recommendation to verify that proxy protocol traffic comes from trusted sources, preventing IP spoofing attacks.

Configuration

[amqp]
tcp_proxy_protocol = 1
proxy_protocol_trusted_sources = 10.0.0.1, 10.0.0.2

🤖 Generated with Claude Code

Only parse PROXY protocol headers from connections originating from
configured trusted source IPs. Connections from untrusted sources
have their PROXY headers ignored and use the actual socket IP.

This follows the HAProxy proxy protocol specification recommendation
to verify that proxy protocol traffic comes from trusted sources.

Configuration:
  [amqp]
  tcp_proxy_protocol = 1
  proxy_protocol_trusted_sources = 10.0.0.1, 10.0.0.2

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@viktorerlingsson viktorerlingsson marked this pull request as ready for review January 9, 2026 14:43
@viktorerlingsson viktorerlingsson requested a review from a team as a code owner January 9, 2026 14:43
Extends proxy_protocol_trusted_sources config to support CIDR notation (e.g., 192.168.0.0/24, 2001:db8::/32) alongside exact IP addresses. Creates IPMatcher struct optimized for the common case of exact IP matching while supporting flexible network range specifications.

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants