Skip to content
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

Merged
merged 3 commits into from
May 26, 2017

Conversation

mururu
Copy link
Member

@mururu mururu commented May 22, 2017

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.

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.
@mururu mururu requested a review from repeatedly May 22, 2017 09:27
@mururu
Copy link
Member Author

mururu commented May 22, 2017

The config.dump API don't mask secret parameters regardless of worker section. I'll fix that after this PR is merged.

run_configure
Fluent::Engine.dry_run_mode = false
rescue Fluent::ConfigError => e
$log.error "config error", file: @config_path, error: e
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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.

change_privilege
init_engine
run_configure
Fluent::Engine.dry_run_mode = false
Copy link
Member

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?

@mururu
Copy link
Member Author

mururu commented May 26, 2017

Updated.

@repeatedly repeatedly merged commit 817691e into fluent:master May 26, 2017
@mururu mururu deleted the fix-1553 branch May 26, 2017 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants