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

Use the FD provider to facilitate root:root ownership of the secrets file #1172

Merged
merged 11 commits into from
Mar 24, 2017

Conversation

stevendanna
Copy link
Contributor

@stevendanna stevendanna commented Mar 23, 2017

The FD provider from veil/chef-secrets expects that the application has been passed a file descriptor containing the secrets it needs. This file descriptor can be owned by the supervisor before we drop permissions, allowing us to keep the secrets store owned as root.

oc-id was the most problematic application to move to this method since ruby's exec method closes all file handles by default.

<srenatus> Update Since it'd be a bigger change to get opscode-expander to use the FD method, it's still using the env provider. This allows us to keep the secrets file owned by root:root, but leaks the secret into procfs. However, that (synthetic) file only contains the one password expander needs, and is only readable by opscode, so from a security perspective, this leaves us in a much better place than having the complete secrets file readable by opscode. </srenatus>

stevendanna and others added 10 commits March 24, 2017 01:22
We now depend on file handles being passed between processes, and it
is nice to be able to test this in the shell, so we use this magical
option.

Signed-off-by: Steven Danna <[email protected]>
To use the FD provider in Veil, we need to be able to pass open file
descriptors to processes `dvm` starts.

Signed-off-by: Steven Danna <[email protected]>
We no longer need this owned by opscode:opscode becuase all
applications now use either the FD provider or the Env provider to
access secrets.

Signed-off-by: Steven Danna <[email protected]>
opscode-erchef's veil-env-helper _requires_ this, so it better be there.
For some reason, I didn't have it, and it feels like this could be easily
avoided like this.

Signed-off-by: Stephan Renatus <[email protected]>
Signed-off-by: Steven Danna <[email protected]>
@stevendanna stevendanna force-pushed the use-env branch 2 times, most recently from e4759a9 to 689278f Compare March 24, 2017 03:03
@stevendanna
Copy link
Contributor Author

Depends on chef/chef_secrets#20

Copy link
Contributor

@srenatus srenatus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update that Gemfile. LGTM.

@@ -7,7 +7,17 @@ def self.get(group, name)
end

def initialize
@veil = Veil::CredentialCollection.from_config(provider: 'chef-secrets-fd')
# TODO(ssd) 2017-03-24: This should maybe go in chef-secrets itself
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I agree, but this is ok for now

We've been hitting a problem with the FD provider in travis even
though it works locally on OS X and locally in an Ubuntu VM on the
same version of ruby being used in travis.

To avoid this for now, we use the environment provider.

Signed-off-by: Steven Danna <[email protected]>
@srenatus srenatus merged commit 8561c32 into master Mar 24, 2017
@srenatus srenatus deleted the use-env branch March 24, 2017 11:14
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.

3 participants