-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
filter: add capability to selectively dump request/response state on crash #37816
base: main
Are you sure you want to change the base?
Conversation
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
/assign @phlax |
95f7ed7
to
44c74e9
Compare
…crash Signed-off-by: Rohit Agrawal <[email protected]>
44c74e9
to
2c23dfd
Compare
message DumpStateConfig { | ||
// Configuration for controlling what state gets dumped when the ``dumpState()`` function is called. This allows | ||
// selectively enabling/disabling certain types of information from being included in state dumps, which can be useful | ||
// for security or performance reasons. | ||
message DumpConfig { | ||
// Configures how this type of state should be dumped. | ||
oneof config { | ||
option (validate.required) = true; | ||
|
||
// When set to ``true``, completely disables dumping of this type of state information. This provides a simple way | ||
// to completely exclude certain data from dumps. | ||
bool disabled = 1; | ||
|
||
// Provides an allow-list of specific headers that should be included in dumps. Only headers in this list will be | ||
// dumped and the remaining will be excluded. This provides granular control over exactly which headers appear in | ||
// the dumps. | ||
HeaderList allowed_headers = 2; | ||
} | ||
|
||
// List of specific headers that should be included in dumps when using an allow-list. | ||
message HeaderList { | ||
// The list of header names that should be included in the dumps. Any headers not in this list will be excluded | ||
// from dumps. Header names should match the exact header key. | ||
repeated string headers = 1; | ||
} | ||
} | ||
|
||
// Controls dumping of HTTP request headers. When not specified, all request headers will be dumped. | ||
// Can be disabled entirely or limited to specific headers via allow-list. | ||
DumpConfig request_headers = 1; | ||
|
||
// Controls dumping of HTTP request trailers. When not specified, all request trailers will be dumped. | ||
// Can be disabled entirely or limited to specific trailers via allow-list. | ||
DumpConfig request_trailers = 2; | ||
|
||
// Controls dumping of HTTP response headers. When not specified, all response headers will be dumped. | ||
// Can be disabled entirely or limited to specific headers via allow-list. | ||
DumpConfig response_headers = 3; | ||
|
||
// Controls dumping of HTTP response trailers. When not specified, all response trailers will be dumped. | ||
// Can be disabled entirely or limited to specific trailers via allow-list. | ||
DumpConfig response_trailers = 4; | ||
|
||
// Controls dumping of stream info state. When not specified, all stream info will be dumped. | ||
DumpConfig stream_info = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather then to do this with a big change, I will prefer do this gradually. (like only handle request headers first).
And considering the acutal scenario and back compatibility, what we want is an ability to hide some state if user explicitly set the configuration, not a reverse way.
oneof config { | ||
option (validate.required) = true; | ||
|
||
// When set to ``true``, completely disables dumping of this type of state information. This provides a simple way | ||
// to completely exclude certain data from dumps. | ||
bool disabled = 1; | ||
|
||
// Provides an allow-list of specific headers that should be included in dumps. Only headers in this list will be | ||
// dumped and the remaining will be excluded. This provides granular control over exactly which headers appear in | ||
// the dumps. | ||
HeaderList allowed_headers = 2; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We not recomment oneof now. And I think what we want may only a repeated string sanitize_request_headers
Description
Added a new configuration option in the Bootstrap to control whether headers and trailers should be included in the state dump during crashes. This feature allows more secure debugging by redacting sensitive information from logs.
Fixes #37793
Commit Message: filter: add capability to selectively dump request/response state on crash
Additional Description: Add new config in Bootstrap to control whether the headers/trailers should be dumped during the crash.
Risk Level: Low
Testing: Added Unit tests
Docs Changes: Added
Release Notes: Added