Repository navigation
API definition for scrubbing request headers sending from ext_proc filter to ext_proc server - #27333
Conversation
…lter to ext_proc server. Signed-off-by: Yanjun Xiang <[email protected]>
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
Signed-off-by: Yanjun Xiang <[email protected]>
| bool disable_clear_route_cache = 11; | ||
|
|
||
| // Disallow headers to be forwarded to the ext_proc server based on this regular expression. | ||
| type.matcher.v3.RegexMatcher disallow_header_to_forward = 12; |
There was a problem hiding this comment.
@htuch @rshriram @tyxia
To have ext_proc filter support header scrubbing in the direction from envoy to ext_proc server, we need to add this regex expression configuration. Thus ext_proc filter can remove headers based on this config.
On the reverse direction, Envoy has this configure for this purpose:
The question I have is that is it enough to just add this disallow_header_to_forward regex expression? Do we need to add something like:
config.common.mutation_rules.v3.HeaderMutationRules outbound_mutation_rules = 12;
similar to the reverse direction:
which has a lot of other capabilities. We don't use some of them for now, but may be needed in the future?
In my opinion, just have disallow_header_to_forward regular expression is simple and clear for now. But not sure whether this is all we need.
There was a problem hiding this comment.
IMHO, a wrapper seems to be better. it will be flexible and extensible with more feature/control and without compatibility concern (e.g., move this field into wrapper) or add more fields scatteredly
HeaderMutationRules in mutation_rules.proto is specific to mutation by external processing server as all the code comment suggests. Since we don't need all those sub fields there and our purpose here is different (i.e., forward not mutation), I think it will be clear that we introduce a new wrapper e.g., HeaderForwardingRules and this can be used for callout in general (not just ext_proc). It is fine that we just have single field (or two list pending on our internal discussion) for now.
WDYT?
There was a problem hiding this comment.
We need an allowlist. Like headers_to_forward. Its a simple list of headers. This will be specified by the end user. Disallow may be too cumbersome.
There was a problem hiding this comment.
+1. It should be an allow list. My preference TBH is to make this a repeated Regex. I don't see a lot of value in forcing all users to form a compound regex to express the common case of a list of headers. Internally we can still turn it into one large regex if we want to for efficiency or the like.
There was a problem hiding this comment.
Good ideas for all the comments! Just updated the PR based on them.
tyxia
left a comment
There was a problem hiding this comment.
Thanks for working on it!
Started with a high-level comment. Also, do you want to include the implementation in this PR(along with doc and release note). Otherwise, you will need to have not_implemented_hide.
| bool disable_clear_route_cache = 11; | ||
|
|
||
| // Disallow headers to be forwarded to the ext_proc server based on this regular expression. | ||
| type.matcher.v3.RegexMatcher disallow_header_to_forward = 12; |
There was a problem hiding this comment.
IMHO, a wrapper seems to be better. it will be flexible and extensible with more feature/control and without compatibility concern (e.g., move this field into wrapper) or add more fields scatteredly
HeaderMutationRules in mutation_rules.proto is specific to mutation by external processing server as all the code comment suggests. Since we don't need all those sub fields there and our purpose here is different (i.e., forward not mutation), I think it will be clear that we introduce a new wrapper e.g., HeaderForwardingRules and this can be used for callout in general (not just ext_proc). It is fine that we just have single field (or two list pending on our internal discussion) for now.
WDYT?
Signed-off-by: Yanjun Xiang <[email protected]>
…r_to_forward Signed-off-by: Yanjun Xiang <[email protected]>
Signed-off-by: Yanjun Xiang <[email protected]>
tyxia
left a comment
There was a problem hiding this comment.
LGTM, modulo comment nits.
Thanks!
Signed-off-by: Yanjun Xiang <[email protected]>
Signed-off-by: Yanjun Xiang <[email protected]>
Signed-off-by: Yanjun Xiang <[email protected]>
|
@adisuissa any last comments? |
May consider a small renaming s/forwarding/filtering/ but don't feel strongly about this. |
|
/retest |
|
Retrying Azure Pipelines: |
|
/retest |
|
Retrying Azure Pipelines: |
I think the goal of the proto is to define what header to be forwarded, not what header to be filtered. Thus I would recommend stay with forwarding. But I don't have strong opinion either way. |
|
/docs |
|
Docs for this Pull Request will be rendered here: The docs are (re-)rendered each time the CI |
adisuissa
left a comment
There was a problem hiding this comment.
Thanks!
Small nit, and good to go.
|
Kind ping! |
…lter to ext_proc server (envoyproxy#27333) API definition for scrubbing request headers sending from ext_proc filter to ext_proc server Signed-off-by: Yanjun Xiang <[email protected]> Signed-off-by: Ryan Eskin <[email protected]>
API definition for scrubbing request headers sending from ext_proc filter to ext_proc server
Commit Message:
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]