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

Add ability to pass ENV to command #25

Open
viranch opened this issue Oct 23, 2018 · 0 comments
Open

Add ability to pass ENV to command #25

viranch opened this issue Oct 23, 2018 · 0 comments

Comments

@viranch
Copy link

viranch commented Oct 23, 2018

This is a feature request to add a new configuration option that controls inheriting environment variables to the command. This is particularly useful for passing secrets via the environment variables to the exec script/command (using command => "script.sh $SECRET" will cause the secret to show up in ps aux).

It could be a simple switch like:

exec {
    command => "bash some_script.sh"
    inherit_environment => true
}

and then simply pass ENV to IO.popen call:

if @inherit_environment
    @io = IO.popen(ENV, @command)
else
    @io = IO.popen(@command)
end

When LS is run with the SECRET environment variable set, the command will also inherit it and available for use.

viranch added a commit to viranch/logstash-input-exec that referenced this issue Nov 6, 2018
viranch added a commit to viranch/logstash-input-exec that referenced this issue Nov 6, 2018
viranch added a commit to viranch/logstash-input-exec that referenced this issue Nov 7, 2018
viranch added a commit to viranch/logstash-input-exec that referenced this issue Nov 7, 2018
viranch added a commit to viranch/logstash-input-exec that referenced this issue Nov 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants