-
Notifications
You must be signed in to change notification settings - Fork 148
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
Mask secrets in CommandInvokedEvent and Command logger #25307
base: master
Are you sure you want to change the base?
Mask secrets in CommandInvokedEvent and Command logger #25307
Conversation
subject); | ||
eventService.getCommandInvokedTopic() | ||
.publish(event); | ||
} | ||
|
||
private ParameterMap maskSecretParameters(ParameterMap parameters) { |
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.
Could it be static
and have unit test?
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.
OK. I will add this specific case into the CommandLoggerTest tests.
@@ -1642,12 +1643,22 @@ public void executeFromCheckpoint(JobManager.Checkpoint checkpoint, boolean reve | |||
private void publishCommandInvokedEvent(ExecutionContext invocation, Subject subject) { | |||
final CommandInvokedEvent event = new CommandInvokedEvent( | |||
invocation.name(), | |||
invocation.parameters(), | |||
maskSecretParameters(invocation.parameters()), |
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.
The current failures suggest (to me), that invocation.parameters()
can be null
.
Extracted ExecutionContext inner class to package-private class CommandRunnerExecutionContext. Was too big and deserved a file on its own. Moved mask method to ParameterMap and added unit tests.
A test to verfiy that the command logger doesn't log passwords
This fixes a security issue in the Command Logger feature, which allowed to expose passwords used in some admin commands. This fix replaces passwords in the logged messages by "******".