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

Support for sensitive environment variables #111

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

teluq-pbrideau
Copy link

Pull Request (PR) description

The environment option does not support sensitive value. I would like to put http_proxy=http://user:password@example.com:3128 in an environment variable, but the content is displayed in cleartext in the log.

This PR allow to define an environment content as sensitive as followed:

cron::job { 'example' :
  environment => [
    Sensitive('http_proxy=http://user:password@example.com:3128'),
    'PATH=/usr/bin',
  ],
  command     => 'sleep 10',
}

same for cron::job::multiple

There was validation in the erb template about the environment variables, and funky .join(\n).split(\n) but I think it is no longer necessary. The content is validated by puppet directly on the call to cron::job. Is this behavior a remnant of old puppet when there was no types?

I also removed the environment variable in the cron::job::multiple::jobs array, as it was not defined in the old erb, and kept the same behavior for the epp.

Feel free to raise concern if you think my assumptions were wrong

This Pull Request (PR) fixes the following issues

@teluq-pbrideau teluq-pbrideau marked this pull request as draft October 26, 2022 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants