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

allow environment to be at beginning of secrets_full_storage_key #17

Open
fortman opened this issue Mar 13, 2018 · 1 comment
Open

allow environment to be at beginning of secrets_full_storage_key #17

fortman opened this issue Mar 13, 2018 · 1 comment

Comments

@fortman
Copy link

fortman commented Mar 13, 2018

It is a lot easier to silo off environments from each other when the environment is at the beginning of the secret path. This is due to the fact that policies allow splats '*', but only at the end of the path (see https://www.vaultproject.io/docs/concepts/policies.html). We want to give some developers access to update the dev environment as they need. It is a lot easier to write a policy like this
read/write etc... '/secret/dev/*'
as opposed to multiple definitions for each application
read/write etc... '/secret/(app1)/dev/*'
read/write etc... '/secret/(app2)/dev/*'
read/write etc... '/secret/(app3)/dev/*'
read/write etc... '/secret/(app4)/dev/*'

This could get messy real quick.

This should be fairly easy to support. In the file 'lib/secrets_cli/vault/base.rb', instead of hard coding
def secrets_full_storage_key
File.join(secrets_storage_key, config.environment)
end
there could be a Proc (https://ruby-doc.org/core-2.2.0/Proc.html) that defaults to the current File.join command. Maybe I can do a PR for it.

@d4be4st
Copy link
Contributor

d4be4st commented Oct 30, 2018

you are very welcome to do a PR to support this :)

@d4be4st d4be4st changed the title enhancement: allow environment to be at beginning of secrets_full_storage_key allow environment to be at beginning of secrets_full_storage_key Oct 30, 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