Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable PROXY protocol for specific IPs in HAProxy #711

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

Dariquest
Copy link

@Dariquest Dariquest commented Sep 9, 2024

Proxy protocol is required for IPv6 on AWS. We are facing the loss of source client IP in HA Proxy. AWS Load Balancer's property preserve_client_ip only works for disabled proxy protocol.
The global flag accept_proxy, which is false by default, is not suitable to solve the problem, since it would break the outgoing traffic.

This PR introduces a new property expect_proxy, which accepts a list of CIDR ranges for which to expect the PROXY protocol. This property should contain a list of private IPs/CIDRs of the load balancers, for which a transparent proxing will be turned off. The property is mutually exclusive with the accept_proxy and will lead to validation failure if both are set to true.

@Dariquest Dariquest requested review from CFN-CI and a team as code owners September 9, 2024 09:16
@Dariquest Dariquest marked this pull request as draft September 9, 2024 09:16
jobs/haproxy/spec Outdated Show resolved Hide resolved
jobs/haproxy/spec Outdated Show resolved Hide resolved
jobs/haproxy/spec Outdated Show resolved Hide resolved
Copy link
Contributor

@peanball peanball left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some WIP comments. I know this is not ready yet.

jobs/haproxy/templates/haproxy.config.erb Outdated Show resolved Hide resolved
spec/haproxy/templates/proxies_cidrs.txt_spec.rb Outdated Show resolved Hide resolved
}, time.Minute, time.Second).Should(Equal("running"))

By("Sending a request with Proxy Protocol Header to HAProxy traffic port")
err := performProxyProtocolRequest(haproxyInfo.PublicIP, 80, "/")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in addition, we could have a test here that a regular (i.e. non-proxy-protocol) request fails, because HAProxy was in fact expecting proxy protocol.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peanball Thanks

Co-authored-by: Rizwan <m.rizwan.shaik@sap.com>
Co-Authored-by: Alexander Lais <alexander.lais@sap.com>
Co-Authored-by: Daria Anton <daria.anton@sap.com>
Dariquest and others added 4 commits September 13, 2024 11:45
Co-authored-by: Rizwan <m.rizwan.shaik@sap.com>
Co-authored-by: Rizwan <m.rizwan.shaik@sap.com>
Co-authored-by: Rizwan <m.rizwan.shaik@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants