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

Secret Management #1269

Closed
will-chan opened this issue Jun 18, 2015 · 28 comments
Closed

Secret Management #1269

will-chan opened this issue Jun 18, 2015 · 28 comments
Assignees
Labels
kind/feature Issues that represent larger new pieces of functionality, not enhancements to existing functionality
Milestone

Comments

@will-chan
Copy link
Contributor

will-chan commented Jun 18, 2015

Rancher needs to be able to support a way to store secrets securely (db passwords, api credentials, etc.) and then let it be made available to containers and services.

Revised: 8/26/2016

  • Rancher will support secrets as a first class object within an environment.
  • Rancher will delegate encryption/decryption to a remote service that can use multiple backends. (ie. None, Local and Vault Transit)

Flow will look something like:

  1. User creates a secret via CLI something like:
    rancher secret create name [—from-file file ] [plaintext]
    creating a secret scoped to a Rancher environment.
  2. User deploys application requesting secrets via labels on FlexVols or top level fields for Cattle.
  3. The FlexVolume implementation will call out to the Rancher secrets API to fetch the required secrets. These will be passed as metadata to the volume.
  4. When FlexVolume requests secrets they will be encrypted with host level key that is shared(because it has been created by Rancher).
  5. The FlexVolume driver will use its private key on the host to decrypt the data received from the secrets API.
  6. The application can consume the secrets from a file on disk. This can be defined via label and/or field, and could be backed by a volume provided by either Docker or K8s.
@will-chan will-chan added the kind/enhancement Issues that improve or augment existing functionality label Jun 18, 2015
@will-chan will-chan added this to the Release 1.0 Features milestone Jun 18, 2015
@deniseschannon deniseschannon added release/v1.0.0 kind/feature Issues that represent larger new pieces of functionality, not enhancements to existing functionality and removed kind/enhancement Issues that improve or augment existing functionality labels Jul 7, 2015
@blaggacao
Copy link

Maybe I'm late to drop in, but I'm stuck with exactly this. I hope this is the right issue to comment on out of: #2060 #1971 #186 #744

From a Docker perspective, its on the radar: moby/moby#13490

Having had a closer look at http://square.github.io/keywhiz/ and https://vaultproject.io I would suggest vault as it excels in UI over the other, also we have seen good stuff from hashicorp in the past.

I'm not so much into the Rancher System Docker Daemon yet, so this might seem silly, anyhow, I'll copy for reference a minimal configuration of a vault server. This could go into the rancherOS istself, while using the excisting rancher distributed storage mechanisms...

backend "consul" {
  address = "127.0.0.1:8500"
  path = "vault"
}

listener "tcp" {
 address = "127.0.0.1:8200"
 tls_disable = 1
}

See also for docker-specifics: hashicorp/vault#165

And how to deploy: https://vaultproject.io/intro/getting-started/deploy.html

@boedy
Copy link

boedy commented Jan 5, 2016

What is rancher current stance on Secret Management? Where do I put my my access tokens, database passwords?

@kaos
Copy link

kaos commented Jan 7, 2016

+1, this needs to be addressed. :)

@dmzaytsev
Copy link

+1 I guess 1.0 will be released not soon
but Secret Management is an important feature

@caussourd
Copy link

+1 definitely need this feature

@raphink
Copy link

raphink commented Jan 26, 2016

👍

3 similar comments
@rvion
Copy link

rvion commented Jan 26, 2016

+1

@taketnoi
Copy link

+1

@fbrbovic
Copy link

+1

@will-chan will-chan removed this from the Release 1.0 milestone Mar 5, 2016
@bluemalkin
Copy link

+1

@markw01
Copy link

markw01 commented Apr 22, 2016

+1

@frekele
Copy link

frekele commented May 12, 2016

+1

@jmls
Copy link

jmls commented Jun 10, 2016

any news on this ?

@maxnoe
Copy link

maxnoe commented Jun 13, 2016

+1

1 similar comment
@jtsaito
Copy link

jtsaito commented Jun 20, 2016

+1

@jandragsbaek
Copy link

+1

@fmorency
Copy link

+1

@cpoole
Copy link

cpoole commented Oct 11, 2016

FlexVols are nice but that requires an init script in the container that will fetch the secrets from the vol and inject them as environment variables before starting the actual program. This makes using community images from docker hub almost impossible.

It would be nice if the secrets bridge could inject a secret into a container at run time. For example you give rancher the two files

docker-compose

web:
  image: mywebserver:0.0.1
  environment:
    - DATABASE_ADDRESS=mydatabase.mysite.com

rancher-compose

web:
  scale: 1
  environment_secrets:
    - DATABASE_PASSWORD= secrets.backend_type.secret_name

Then before executing that docker compose file rancher would add in the full value of the DATABASE_PASSWORD, generating:

web:
  image: mywebserver:0.0.1
  environment:
    - DATABASE_ADDRESS=mydatabase.mysite.com
    - DATABASE_PASSWORD=asddfjasldfkjsdfsdf

In the ui, when you click to see the docker and rancher compose files you would see the un-interpolated versions.

Finally rancher would know which stacks are allowed to access which paths because when you created them with the command rancher secret create name [—from-file file ] [plaintext] you could add the stack name to keep it scoped: rancher secret create -environment=environment_name -secret_name=name -stack=mywebsite [—from-file file ] [plaintext]

Is there some major security loophole this would introduce that I am not seeing?

@Austriker
Copy link

+1

@theinrichs
Copy link

Maybe this is interesting for this topic: moby/moby#27794

@ekristen
Copy link

I have a few recommendations ...

  • I would really like to see vault as the secrets management backend, but +1 to a modular secrets management setup.
  • I would really like to see the ability to interpolate environment variables from the secret backend(s)
    • IE MYSQL_DATABASE={{secret.vault.path-to-secret}}
  • I would really like to see the ability to use a template system to write secrets to a file inside the container, something like golang templates would work great.
    • the reason for this is that there are different way configuration files are loaded and being able to adapt to already existing formats without having to write special code in applications to allow for a unique format that only rancher does would be awesome, it'll also give admins better control of how and where secrets are placed.

@yeta-io-ceo
Copy link

+1

@deniseschannon
Copy link

We are targeting to have an experimental version of secrets management available in 1.4.0.

@deniseschannon
Copy link

@galal-hussein Can you test with the next rancher RC v1.4.0-rc4?

@sangeethah
Copy link
Contributor

#7607

@galal-hussein
Copy link
Contributor

Rancher version 1.4.0-rc8, tested secret management workflow for both localkey and vault backends, all test cases passed successfully.

@cryptiklemur
Copy link

Multiple requests for being able to automatically inject these secrets into the environment...

Did that request see any progress?

@tnaduc
Copy link

tnaduc commented Mar 21, 2020

+1
I would like to have a feature to add secret file such as google cloud service account json key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Issues that represent larger new pieces of functionality, not enhancements to existing functionality
Projects
None yet
Development

No branches or pull requests