-
Notifications
You must be signed in to change notification settings - Fork 468
Use container secrets securely #2270
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
Comments
Hi! I like the symlink approach and I'm curious how @jdoss and others on the team feel about it. We just have to be aware of backward compatibility here, but it sounds like the symlink approach would not change any of the behavior outside of the init functionality. The CA would still read from |
A symlink seemed like the least intrusive approach & shouldn't break anything. Also I thought leave (so you can just add a note to Docker Hub that |
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples * fixes: smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples * fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* increases the default password length from 40 to 256 characters * adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
* adds a new ENV variable DOCKER_STEPCA_PASSWORD_FILE so the password file location can be changed * adds set_password_files() to entrypoint.sh so /home/step/secrets/password becomes a symlink in containers pointing to DOCKER_STEPCA_INIT_PASSWORD_FILE & also DOCKER_STEPCA_PASSWORD_FILE so file permissions are retained * adds podman example quadlet / run command with a 378,000 character secret * small update to README.md for new podman examples / docker examples Fixes smallstep#2270
Hello!
Issue details
When running a container with
DOCKER_STEPCA_INIT_PASSWORD_FILE
set the Dockerentrypoint.sh
cat
's the password file to/home/step/secrets/password
& the file is world readable:Why is this needed?
For containers at least, a
symlink
is a better solution (which also works perfectly) - as thesecret
will usually be mounted in the container under/run/secrets/xxx
with explicit permissions (possible in bothdocker
&podman
). This will work with the Dockerfile expecting to find the hardcoded/home/step/secrets/password
& a containersecret
named anything.Moving the symlink creation out of
init
to run every timeDOCKER_STEPCA_INIT_PASSWORD_FILE
is set is probably also recommended for cases where the container is run with a different password file location.Am willing to make a PR if you agree with this approach.
Running
stepca
with a378,000
charpodman
secret works ok - example.I can also add to the PR a podman
quadlet
example.container
file &run
command.The text was updated successfully, but these errors were encountered: