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

Lack of control of file permissions of rendered secrets #136

Closed
mrproper opened this issue May 20, 2020 · 2 comments · Fixed by #277
Closed

Lack of control of file permissions of rendered secrets #136

mrproper opened this issue May 20, 2020 · 2 comments · Fixed by #277
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mrproper
Copy link

out of the box, vault injector renders secrets as:
uid: 100 gid: 1000 file mode: 0644
These are pretty ordinary defaults.

Consider that many applications that use lets say a cert key etc expect permissions of 0400
The uid/gid control is already handled in the unreleased commits for using:

        vault.hashicorp.com/agent-run-as-user: "1000"
        vault.hashicorp.com/agent-run-as-group: "1000"

The only work around i managed for permissions of the rendered files is the following:

        vault.hashicorp.com/agent-inject-command-${secret}: "chmod 400 ${secret_volume_path}/${secret}

Proposal:
Just with many of the other annotations:

  1. set a default render file permission in the agent (ie not in annotations)
  2. allow annotations to set a default file permission
  3. allow per secret to set a file permission

Cheers!

@jasonodonnell jasonodonnell added enhancement New feature or request good first issue Good for newcomers labels Jun 4, 2020
@jasonodonnell
Copy link
Contributor

This would be pretty easy to add. Consul Template supports perms for rendered templates, so we'll just need to add an annotation for it.

@lawliet89
Copy link
Contributor

lawliet89 commented Aug 5, 2021

May I chime in to add my support for this feature please. Some applications refuse to even contemplate loading a private key that is not 0600, for good reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
3 participants