TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Introducing Docker Secrets Management

264 pointsby ferrantimover 8 years ago

10 comments

diogomonicaptover 8 years ago
I think with this release things have come full circle for me. I was part of the team that 5 years ago built Keywhiz at Square, starting the whole &quot;secrets should be files exposed as an in-memory filesystem&quot; thing.<p>Building it a second time was interesting. One of the biggest reasons why Keywhiz didn&#x27;t go anywhere was the fact that it is incredibly hard to setup, and requires you to bring your own PKI. This time we didn&#x27;t make that mistake and integrated directly into Swarm, which is the right place for it to live, and turns setting up your own PKI into a one-liner.<p>Anyway, AMA.<p>Disclosure: I work on the Docker Security team
评论 #13609869 未加载
评论 #13608983 未加载
评论 #13608800 未加载
评论 #13608896 未加载
评论 #13608965 未加载
评论 #13609352 未加载
评论 #13612677 未加载
评论 #13610310 未加载
评论 #13608750 未加载
评论 #13608751 未加载
评论 #13609318 未加载
unpythonicover 8 years ago
This looks amazing. Solving secret distribution across containers will be very useful. Being able to see via `docker secret` exactly which services are using which secrets is an unexpected treat.<p>I&#x27;m a little worried about two aspects of what has been shown. From the article it shows:<p><pre><code> $ docker exec $(docker ps --filter name=redis -q) ls -l &#x2F;run&#x2F;secrets total 4 -r--r--r-- 1 root root 17 Dec 13 22:48 my_secret_data </code></pre> From this we can tell exactly how long the secret is. If the secret service didn&#x27;t do it for us, I&#x27;d like for the secrets to be null-padded to a uniform 2-4K of bytes.<p>I&#x27;m also a bit worried that the default protection on the file has it set to world-readable. Since it appears that secret distribution is independent of the container setup itself, there doesn&#x27;t appear to be any way of setting ownership and permissions on this file. That is, if one were able to chmod&#x2F;chown the file in the Dockerfile, running a `docker service update --secret-rm` and `docker service update --secret-add` would reset such &#x27;fixes&#x27;.<p>A great start, and I can&#x27;t wait to start using it.
评论 #13609387 未加载
heroprotagonistover 8 years ago
This is interesting, but in my opinion, it&#x27;s not quite as universally useful as some of the secret management in other security tools because you have to explicitly manage the secret within your application by reading that in-memory filesystem.<p>I&#x27;d much prefer passing a secret as an environment variable if that can be done securely. It&#x27;s possible with some tools, but not out of the box with Docker itself.<p>eg, with one tool, you can do:<p># docker run --rm -e PASSWORD={supersecret_password} someimage:latest program<p>Then &#x27;{supersecret_password}&#x27; gets replaced in the container at runtime with the value stored in the tool or from an integration with a separate dedicated secret management tool like HashiCorp Vault, and value gets masked external to the container such as when running &#x27;docker inspect&#x27; command.<p>The benefit is that you don&#x27;t need to modify or maintain a lot of pre-packaged applications that read environment variables instead of looking to the contents of a file on the disk, so it just works out the box.<p>However, under ordinary circumstances, you may not want to pass secrets as environment variables in docker (or at least be careful about it). A &#x27;docker inspect&#x27; command can show any docker user the environment variable and its value, if you don&#x27;t have a tool to encrypt the contents.
评论 #13609285 未加载
评论 #13609301 未加载
评论 #13610162 未加载
doublerebelover 8 years ago
Comparing this to Vault (with which I have been very satisfied):<p>The article mentions a single master key for cluster encryption. Are there any plans to split this as in Shamir&#x27;s Secret Sharing?<p>How do secrets and secret authorizations renew and expire?<p>Any plans for limited-use tokens&#x2F;secrets?
justincormackover 8 years ago
Comparison of this with other secretes management frameworks here <a href="https:&#x2F;&#x2F;medium.com&#x2F;on-docker&#x2F;secrets-and-lie-abilities-the-state-of-modern-secret-management-2017-c82ec9136a3d#.ur0pnuirw" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;on-docker&#x2F;secrets-and-lie-abilities-the-s...</a>
评论 #13610706 未加载
simplehumanover 8 years ago
This is really nice. What is the equivalent in the kubernetes world?
评论 #13609146 未加载
mnm1over 8 years ago
Is there a way to manage secrets during the build process itself without specifying them on the command line &#x2F; docker compose files?
tlrobinsonover 8 years ago
It would be neat if you could inject secrets as environment variables. Something like:<p><pre><code> --secret=&quot;my_secret:MY_SECRET&quot; </code></pre> Obviously you could have a script that does<p><pre><code> MY_SECRET=$(cat &#x2F;run&#x2F;secrets&#x2F;my_secret) .&#x2F;whatever </code></pre> but a lot of existing containers can be configured via environment variables.
评论 #13609599 未加载
daveguyover 8 years ago
Not sure if anyone from docker is watching, but the images are cut off at the side on mobile.
评论 #13610690 未加载
lyschoeningover 8 years ago
Will we be able to use this on Docker Cloud soon?
评论 #13614120 未加载