uhv: header validators for H1 and H2 codecs#22537
uhv: header validators for H1 and H2 codecs#22537yanavlasov merged 51 commits intoenvoyproxy:mainfrom
Conversation
Signed-off-by: Adam Meily <adam.meily@trailofbits.com>
Moving the call to validateHeaders fixes a segfault when validation fails. Prior to this change, the stream would be reset after the local reply was sent, which caused a crash. Now, the request is marked as completed prior to sending the local reply when UHV fails. Signed-off-by: Adam Meily <adam.meily@trailofbits.com>
Signed-off-by: Adam Meily <adam.meily@trailofbits.com>
Signed-off-by: Adam Meily <adam.meily@trailofbits.com>
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
|
/wait on CI |
Signed-off-by: Adam Meily <adam.meily@trailofbits.com>
Signed-off-by: Adam Meily <adam.meily@trailofbits.com>
Signed-off-by: Adam Meily <adam.meily@trailofbits.com>
|
@alyssawilk Can you rerun the failed CI job? CI is passing for me locally and I think the current failure is because a package couldn't be downloaded. |
|
you should be able to yourself with |
|
Retrying Azure Pipelines: |
|
/assign-from @envoyproxy/api-shepherds |
|
@envoyproxy/api-shepherds assignee is @markdroth |
source/extensions/http/header_validators/envoy_default/character_tables.h
Outdated
Show resolved
Hide resolved
source/extensions/http/header_validators/envoy_default/header_validator.cc
Outdated
Show resolved
Hide resolved
source/extensions/http/header_validators/envoy_default/header_validator_factory.cc
Outdated
Show resolved
Hide resolved
source/extensions/http/header_validators/envoy_default/http1_header_validator.cc
Show resolved
Hide resolved
source/extensions/http/header_validators/envoy_default/http2_header_validator.cc
Show resolved
Hide resolved
source/extensions/http/header_validators/envoy_default/http2_header_validator.cc
Show resolved
Hide resolved
source/extensions/http/header_validators/envoy_default/http2_header_validator.cc
Outdated
Show resolved
Hide resolved
source/extensions/http/header_validators/envoy_default/header_validator_factory.cc
Show resolved
Hide resolved
Signed-off-by: Adam Meily <adam.meily@trailofbits.com>
Signed-off-by: Adam Meily <adam.meily@trailofbits.com>
|
@yanavlasov @adisuissa this looks ready for another round of review. |
|
@lizan could you give this an API stamp for the docs update? |
alyssawilk
left a comment
There was a problem hiding this comment.
Looking great! Sorry for the delay
/wait
source/extensions/http/header_validators/envoy_default/header_validator.cc
Outdated
Show resolved
Hide resolved
source/extensions/http/header_validators/envoy_default/header_validator.cc
Outdated
Show resolved
Hide resolved
source/extensions/http/header_validators/envoy_default/header_validator.cc
Outdated
Show resolved
Hide resolved
source/extensions/http/header_validators/envoy_default/header_validator.cc
Show resolved
Hide resolved
source/extensions/http/header_validators/envoy_default/header_validator.h
Outdated
Show resolved
Hide resolved
source/extensions/http/header_validators/envoy_default/http1_header_validator.cc
Show resolved
Hide resolved
source/extensions/http/header_validators/envoy_default/http2_header_validator.cc
Show resolved
Hide resolved
source/extensions/http/header_validators/envoy_default/http2_header_validator.cc
Show resolved
Hide resolved
source/extensions/http/header_validators/envoy_default/http2_header_validator.cc
Show resolved
Hide resolved
source/extensions/http/header_validators/envoy_default/http2_header_validator.cc
Outdated
Show resolved
Hide resolved
Signed-off-by: Adam Meily <adam.meily@trailofbits.com>
Signed-off-by: Adam Meily <adam.meily@trailofbits.com>
source/extensions/http/header_validators/envoy_default/header_validator.cc
Outdated
Show resolved
Hide resolved
source/extensions/http/header_validators/envoy_default/header_validator.cc
Show resolved
Hide resolved
source/extensions/http/header_validators/envoy_default/header_validator.h
Outdated
Show resolved
Hide resolved
source/extensions/http/header_validators/envoy_default/http1_header_validator.cc
Show resolved
Hide resolved
test/extensions/filters/http/grpc_json_transcoder/grpc_json_transcoder_integration_test.cc
Outdated
Show resolved
Hide resolved
Signed-off-by: Adam Meily <adam.meily@trailofbits.com>
Signed-off-by: Adam Meily <adam.meily@trailofbits.com>
Signed-off-by: Adam Meily <adam.meily@trailofbits.com>
alyssawilk
left a comment
There was a problem hiding this comment.
Awesome. Thanks for the fantastic addition and all your patience with the review
|
@envoyproxy/api-shepherds - This optional validator (default, not enabled) has been approved by Yan, but who is willing to review this for an api stamp of approval? |
|
I'm submitting this PR so we can proceed with follow-up work. If you have any more comments, please open Issues. |
adisuissa
left a comment
There was a problem hiding this comment.
Thanks, left some API comments.
api/envoy/extensions/http/header_validators/envoy_default/v3/header_validator.proto
Outdated
Show resolved
Hide resolved
|
|
||
| // Action to take when a client request with a header name containing underscore characters is received. | ||
| // If this setting is not specified, the value defaults to ALLOW. | ||
| HeadersWithUnderscoresAction headers_with_underscores_action = 4; |
There was a problem hiding this comment.
High-level question: do you think there may be a need in the future for action-specific-settings.
For example, will there be something like "REPLACE_UNDERSCORE" that will need the replacement string.
If so, I would suggest using a oneof, and messages for each option.
There was a problem hiding this comment.
All these settings are for existing behavior. In the future if people want to modify it, they can add a new extension with their own config.
|
|
||
| // Action to take when a client request with a header name containing underscore characters is received. | ||
| // If this setting is not specified, the value defaults to ALLOW. | ||
| HeadersWithUnderscoresAction headers_with_underscores_action = 4; |
There was a problem hiding this comment.
Does this field need an Envoy build with uhv=enabled to take effect? If so please document.
There was a problem hiding this comment.
UHV is enabled in HCM
which is currently marked as hidden.
The uhv=enabled is really a temporary build flag to safely transition to the new verification code. Do you think we need to document it? It will not be added into the generated documentation anyway because of the hidden flag.
api/envoy/extensions/http/header_validators/envoy_default/v3/header_validator.proto
Outdated
Show resolved
Hide resolved
api/envoy/extensions/http/header_validators/envoy_default/v3/header_validator.proto
Outdated
Show resolved
Hide resolved
Signed-off-by: Adam Meily <adam.meily@trailofbits.com>
|
Looks like all comments were addressed. If we missed anything, please file an Issue and we will address in a followup PR. |
Signed-off-by: Adam Meily <adam.meily@trailofbits.com> Signed-off-by: Adam Meily <ameily@users.noreply.github.com> Signed-off-by: Ryan Northey <ryan@synca.io>
Commit Message: uhv: header validators for H1 and H2 codecs
Additional Description: This PR builds off the foundation laid in #21974 to add validators for H1 and H2. H3 and path normalization are intentionally out of scope for this PR and will be completed later.
Risk Level: Low
Testing: Build Envoy with
--define uhv=enabled, configure a service with UHV enabled, and then test a valid and invalid request.Fixes #19753
Docs Changes:
Release Notes:
Platform Specific Features: