IBX-11181: Trusted Proxies is not set on Ibexa Cloud #699
+2
−33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



Related PRs:
Description:
Trusted proxies are not set on Ibexa Cloud when using Fastly. We document (via Upsun,) that user must disable
TRUSTED_PROXIES: "REMOTE_ADDR"in.platform.app.yaml(which is correct), but we don’t say or specify how to configureTRUSTED_PROXIEScorrectly.And frankly, it is not easy/possible to do via static config given how the Upsun router behaves:
Upsun router behavior:
X-FORWARD-FORsent by malicious clientX-FORWARD-FOR, appending header if already set ( "1.1.1.1" => "1.1.1.1, 2.2.2.2")X-Client-IPheader ( value is IP of client). Value is also end-user's IP if request is received via Fastly ( doc )fastlySo there is no static IP or IP range you can set as trusted proxies when using Fastly on Upsun. For instance, setting trusted hosts to Fasty's public IP list will not do any good. Thus, Ibexa DXP should automatically detect on Ibexa Cloud if request is received via Fastly
Next, I really doesn't understand the original purpose of
TrustedHeaderClientIpEventSubscriber. It basically does this:X_FORWARDED_FORwill be set (value will be copied from theX-Client-IPrequest header) andX_FORWARDED_FORwill be set astrusted_headerstrusted_proxiescorrectly.X-Client-IPas sourceMy next doubt is why there was some need for this in relation to IBX-4046
FYI : Original PR : https://github.com/ibexa/core/pull/165/files
As the Upsun router anyway sets the X-Forward-For header, and devs still needed to set
trusted_proxiesin config ( which IMO is impossible), the old implementation inTrustedHeaderClientIpEventSubscriberis void.But it certainly may be that I am missing something important....?
What the new implementation of
TrustedHeaderClientIpEventSubscriberdoes:For QA:
Maybe do sanity checks with "create Applications for Customer portal" feature, as original implementation of
TrustedHeaderClientIpEventSubscriberwas implemented in relation to that.Documentation: