[7.x] Secure password for monitoring HTTP exporter #51775
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds reloadable SECURE_AUTH_PASSWORD to allow keystore entries in the form xpack.monitoring.exporters.*.secure_auth_password to securely supply passwords for monitoring exporters. Deprecates the insecure AUTH_PASSWORD setting.
It would have been ideal to include validation that only one of either the AUTH_PASSWORD or SECURE_AUTH_PASSWORD were set but the settings validation framework does not support secure settings. Additionally, the validation on the AUTH_USERNAME setting that required a password to be set if the username was set had to be removed because the password can now be set via a secure setting that the validation framework cannot see. It might be possible to extend the validation framework to handle secure settings, but if so, that would definitely be a separate work effort.
Making the SECURE_AUTH_PASSWORD setting reloadable meant that the Monitoring plugin had to be able to trigger a reload of any HTTP exporters when the cluster received a _nodes/reload_secure_settings request. This necessitated (unless I missed a cleaner approach) the addition of a reference to Exporters within the Monitoring class.
Fixes #50197.
Backport of #50919.