Repository navigation
aws_request_signing: Don't sign x-envoy headers - #18729
wbertelsen wants to merge 1 commit into
Conversation
Envoy often modifies x-envoy headers ie in https://github.com/envoyproxy/envoy/blob/0fae697/source/common/router/retry_state_impl.cc#L35. This change also makes them non-canonical and excludes them from request signing. This is an initial fix for envoyproxy#18695 Signed-off-by: Will Bertelsen <[email protected]>
|
Hi @wbertelsen, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
|
/assign rgs1 |
rgs1
left a comment
There was a problem hiding this comment.
Thanks!
Mind adding a line in docs/root/version_history/current.rst about the change?
@marcomagdy mind taking a look as well?
| if (key == Http::Headers::get().ForwardedFor.get() || | ||
| key == Http::Headers::get().ForwardedProto.get() || key == "x-amzn-trace-id") { | ||
| key == Http::Headers::get().ForwardedProto.get() || key == "x-amzn-trace-id" || | ||
| absl::StartsWith(key, "x-envoy")) { |
There was a problem hiding this comment.
ThreadSafeSingleton<Http::PrefixValue>::get().prefix() instead of x-envoy
|
Ideally we should be adding an option to the signing filter API to control what headers (besides the required ones for sigv4: |
Yeah you are right, the current approach is not sustainable. @wbertelsen: do you mind changing the approach to extending the signer's API to pass excluded headers (or which ones should be included)? @lavignes should we do excluded headers instead of included though? Sounds easier to maintain/use. |
|
@rgs1 Id prefer including headers. But excluding headers via a (probably a list of) StringMatcher would also work pretty well. |
|
I agree making this configurable is the right thing long term, but making that fix is outside the scope of what I'm going to be able to reliably contribute. I'll close this PR and leave the issue up. |
Commit Message:
Envoy often modifies x-envoy headers ie in https://github.com/envoyproxy/envoy/blob/0fae697/source/common/router/retry_state_impl.cc#L35.
This change also makes them non-canonical and excludes them from request signing.
This is an initial fix for #18695
Signed-off-by: Will Bertelsen [email protected]
Additional Description: N/A
Risk Level: Low
Testing: Tested manually against repo case. Also built and deployed it to own infra.
Docs Changes: None
Release Notes: None
Platform Specific Features: None
Fixes: #18695