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

Merged

Conversation

teluq-pbrideau
Copy link
Contributor

Pull Request (PR) description

The environment option does not support sensitive value. I would like to put http_proxy=http://user:[email protected]: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:[email protected]: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
@teluq-pbrideau teluq-pbrideau force-pushed the feat/sensitive_environment branch from 6624507 to 6b7f251 Compare October 26, 2022 14:18
@teluq-pbrideau teluq-pbrideau marked this pull request as ready for review October 26, 2022 14:32
@teluq-pbrideau
Copy link
Contributor Author

@bastelfreak Would it be something wanted if I work further on this PR? Or should I abandon this completely? I don’t want to work on something that will be discarded…

@bastelfreak
Copy link
Member

@teluq-pbrideau hi! Sorry this PR got a bit lost under the radar. I think it's still very useful. Could you rebase it against our latest HEAD branch? And you can always ping us on slack or IRC and then we can take a look at the PR. We've #voxpupuli on the Libera IRC network and also #voxpupuli on https://slack.puppet.com/

@teluq-pbrideau teluq-pbrideau force-pushed the feat/sensitive_environment branch from 6b7f251 to 62f161c Compare July 10, 2024 13:11
@bastelfreak
Copy link
Member

thanks a lot for updating it! I will do a minor release in #140 and afterward merge your PR.

@bastelfreak bastelfreak merged commit 6e5296c into voxpupuli:master Jul 10, 2024
11 checks passed
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.

2 participants