Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

SSL keystore/truststore dirs and configuration values #3

Closed
rnpridgeon opened this issue Jun 30, 2016 · 6 comments
Closed

SSL keystore/truststore dirs and configuration values #3

rnpridgeon opened this issue Jun 30, 2016 · 6 comments

Comments

@rnpridgeon
Copy link
Contributor

We should manage most of the SSL configuration and directories within the base image. This makes life easier in the long run.

ENV:
-ssl.keystore.location
-ssl.keystore.password
-ssl.key.password

-ssl.truststore.location
-ssl.truststore.password

BASH:
mkdir -p /ssl/keys /ssl/trusts

My understanding is that each containers has it's own layer isolating it from other containers. If this is correct each will still have their own keystore/truststore so key conflicts should not arise.

@rnpridgeon
Copy link
Contributor Author

We should actually build a base jinja template which includes all shared configuration values such as ZOOKEEPER_CONNECT. Then each service can simply extend this speeding up initial setup of a service within the docker repo.

@arrawatia
Copy link
Member

arrawatia commented Jul 1, 2016

In general, it is not recommended to use ENV vars for secrets in docker. There is lot of discussion on the issue of managing secrets in docker. I have summarized it below

TL;DR

Passing secrets in env vars is bad. The best way for making secrets available to the container is using volumes (Kubernetes does it this way). The basic idea is that you create a mount point for secrets, something like /etc/secrets and the provisioning system puts the secrets in a volume and maps it to the docker container. So, if you are doing it manually for Kafka, you would create a directory on the host, add JKS file and credentials (in a file) and map this directory to /etc/secrets. The configure script will read this dir and add the credentials to the config.

There are various ways of storing secrets and mounting them on a volume for the container, some of which are linked in "Secret management in Docker" section below.

Why ENV vars are bad for runtime secrets ?

General discussion on "Secrets in docker"

Secret management in Kubernetes:

Secret management in Docker

@arrawatia
Copy link
Member

@theduderog what's your take on this ?

@theduderog
Copy link
Member

I agreed that ENV vars are not a good way to pass secrets to containers b/c they're easy to leak. It seems like managing secrets in Docker is similar to "service discovery" in that there is no standard way to do it. Perhaps our default could be to expect a volume to be mounted with the secrets present but we need to allow people to plugin arbitrary code to get their secrets. I guess they can do it by overriding the "configure" step?

@rnpridgeon
Copy link
Contributor Author

Makes sense to me

@arrawatia
Copy link
Member

Implemented in #11.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants