-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 all secret parameters in worker section, fix #1553 #1580
Conversation
Secrete parameters are masked when configuring the plugin instances, but fluentd worker processes don't create and configure the instances of plugins under worker sections for other workers. And config dump is performed on a worker process (worker0). So the secret parameters under worker section are not masked except for worker0. This patch makes supervisor process create and configure instances of plugins for all workers before spawning worker processes and config_dump performed on supervisor process. This method is the same with dry_run.
The config.dump API don't mask secret parameters regardless of worker section. I'll fix that after this PR is merged. |
lib/fluent/supervisor.rb
Outdated
run_configure | ||
Fluent::Engine.dry_run_mode = false | ||
rescue Fluent::ConfigError => e | ||
$log.error "config error", file: @config_path, error: e |
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.
should re-raise an error?
It seems --dry-run returns 0 exit status even if configuration error happen.
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.
Right. Then, exit!(1)
is better to keep consistency with current behaviour?
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.
Yes because exit value is used for error detection.
lib/fluent/supervisor.rb
Outdated
change_privilege | ||
init_engine | ||
run_configure | ||
Fluent::Engine.dry_run_mode = false |
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.
To safety, should be in ensure
?
Updated. |
Secrete parameters are masked when configuring the plugin instances, but fluentd worker processes don't create and configure the instances of plugins under worker sections for other workers. And config dump is performed on a worker process(worker0). So the secret parameters under worker section are not masked except for worker0.
This patch makes supervisor process create and configure instances of plugins for all workers before spawning worker processes and config_dump performed on supervisor process. This method is the same with dry_run.