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

Feature: Make it possible to reference secrets from other projects #32

Closed
vmatsiiako opened this issue Nov 25, 2022 · 5 comments
Closed
Labels
🚀 feature request New feature or request

Comments

@vmatsiiako
Copy link
Contributor

Describe the feature

It would be nice to reference secrets from other projects

Additional context

Not sure how it would work if other people are not part of a certain project

@vmatsiiako vmatsiiako added the 🚀 feature request New feature or request label Nov 25, 2022
@vmatsiiako
Copy link
Contributor Author

@Icaruk what would you say is the main use case for this? Why do you usually need to reference secrets from other projects?

@Icaruk
Copy link

Icaruk commented Nov 25, 2022

@Icaruk what would you say is the main use case for this? Why do you usually need to reference secrets from other projects?

email_secrets:

  • EMAIL_USER: ****
  • EMAIL_PASS: ****

api_secrets:

  • EMAIL_USER: ${email_secrets.EMAIL_USER}
  • EMAIL_PASS: ${email_secrets.EMAIL_PASS}

worker_secrets:

  • EMAIL_USER: ${email_secrets.EMAIL_USER}
  • EMAIL_PASS: ${email_secrets.EMAIL_PASS}

Easy to change or rotate shared passwords, tokens, etc...

@Icaruk
Copy link

Icaruk commented Nov 25, 2022

Not sure how it would work if other people are not part of a certain project

Maybe just allow to reference projects you have access to.

@Grraahaam
Copy link
Contributor

Here's an explanation about some use cases I've made in DM on Slack :

Allowing us to edit one secret in a "global" project and child project will automatically point to that new value
Here's how "global" project works (at least how I'm using it) :

# global project (dev config, rbac to only admin/authorized members)
API_STRIPE_URL=https://api.stripe.com/v1
API_STRIPE_KEY=xxxxxxxxxx-xxxxx-xxxxxxxx
PROJECT_CONFIG=dev

# A project (env names can be different, as long as the reference points to the correct secret)
STRIPE_URL=${global.dev.API_STRIPE_URL}
STRIPE_SECRET=${global.dev.API_STRIPE_KEY}
OHTER_VAR=foobar

# B project
API_URL=${global.dev.API_STRIPE_URL}
API_SECRET=${global.dev.API_STRIPE_KEY}
APP_ENV=${global.dev.PROJECT_CONFIG}
OHTER_VAR=foobar

Not tested yet on Doppler. Scoping developers' permissions to only given configs/environments secrets, so we could grant them read-only access to given config/environment to only fetch referenced secrets from projects where they're authorized (read-only).

Suggestion, user Bob have read-only permission on the "global" project but only for the dev config/environment :

# global project (dev config, rbac to only admin/authorized members)
# bob : read-only
API_STRIPE_URL=https://api.stripe.com/v1
API_STRIPE_KEY=dev-xxxxxxx-xxxxx-xxxxxxxx
PROJECT_CONFIG=dev

# global project (stg config, rbac to only admin/authorized members)
# bob : no permissions
API_STRIPE_URL=https://api.stripe.com/v1
API_STRIPE_KEY=stg-xxxxxxx-xxxxx-xxxxxxxx
PROJECT_CONFIG=stg

# A project (dev config)
# bob : can fetch the referenced secrets and override those values locally if needed
STRIPE_URL=${global.dev.API_STRIPE_URL}
STRIPE_SECRET=${global.dev.API_STRIPE_KEY}
OHTER_VAR=foobar

# A project (dev config, if bob wants to try to get the stg/prd secrets)
# bob : can't fetch the referenced secrets but can still override those values locally if needed
STRIPE_URL=${global.stg.API_STRIPE_URL} # empty (can't access)
STRIPE_SECRET=${global.stg.API_STRIPE_KEY} # empty (can't access)
OHTER_VAR=foobar # can access

I hope those text schema are clear enough, let me know if you'd prefer a visual diagram ✌️

@akhilmhdh
Copy link
Member

akhilmhdh commented Aug 6, 2023

With release of Secret Reference You can now reference secret from same environment or another environment and another folder.

Closing this issue as its now been resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 feature request New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants