-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: receiving central config with
sanitize_field_names
would crash (…
…#3249) The crash was with init of config.sanitizeFieldNamesRegExp in the central-config code path. I've fixed that. Other updates: - Updated config normalization of this var -- and similar config vars that set a `${name}RegExp` array var -- initialize the RegExp array to empty before populating it. - Updated the tests to ensure we always add to "central-config-enabled.test.js" whenever a new supported central config var is added. - Updated central-config handling to try/catch and log.error instead of *crashing* if there is an unexpected exception. Partially applied central config isn't great, but it is better than having a DoS avenue where central config can crash agents. For example: {"log.level":"error",...,"remoteConf":{"sanitize_field_names":"password, pass*"},"error":{"type":"TypeError","message":"Cannot read properties of undefined (reading 'push')","stack_trace":"..."},"message":"Central config error: exception while applying changes"} Fixes: #3247
- Loading branch information
Showing
3 changed files
with
85 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters