by falcolas · 10y ago · 0 comments
However, where is image signing? Where is pulling images by their hash instead of mutable tags? Where is restricting what images run according to their hashes? Where is Docker not running a daemon as root? How about Docker doing more hardening releases and fewer feature releases?
There's a lot of low hanging, security related fruit which haven't been picked. Why not?
Process isolation is a fantastic. There just really needs to be more, in my opinion.
The coolest bit here is to be able to do threshold signing. Essentially k-of-n signing for containers and verification gates that only allow containers with enough signatures in order to deploy. For some more background check out the blogpost here: https://blog.docker.com/2016/08/securing-enterprise-software...
Disclaimer: I manage security at Docker.
> "Secure by default" is a great philosophy to have. I hope Docker continues to push into this direction.
Thank you. We will absolutely keep pushing.
> However, where is image signing?
Docker supports image signing out-of-the-box. It's based on TUF which is the state if the art in secure content distribution. Along the way we open-sourced our underlying TUF implementation so thaf others can reuse it: https://github.com/docker/notary
> Where is pulling images by their hash instead of mutable tags?
That's also available out of the box: "docker pull NAME@DIGEST"
> Where is restricting what images run according to their hashes?
That's not available out of the box, but a popular way to implement it is to funnel images through a trusted private registry, only allow pulls from that registry, and then controlling what you push to it.
Another possibility is to use the new auth plugin system, although I haven't tried.
> Where is Docker not running a daemon as root?
Docker runs unprivileged by default, but only on relatively recent kernels with user namespace support (it drops itself to "fake root" so it can still create containers without actually having uid0).
On older systems (or if you don't trust user namespaces) I agree we could break up some parts of the daemon (for example push/pull) to drop privileges further. That requires serious refactoring which we have been working on gradually for some time.
> How about Docker doing more hardening releases and fewer feature releases?
We follow the linux methodology: every release includes many hardening improvements, as well as whatever features have been deemed stable enough to merge. We don't control what pull requests the community sends, but we work hard to maintain a high quality bar and encourage quality-oriented contributions. The Docker core engineering team invests more time on hardening than features.
> There's a lot of low hanging, security related fruit which haven't been picked. Why not?
I'm sure there are :) Security is a process, we will never be done. The important thing for us is to take it seriously, invest appropriately (Docker core team employs 6 full time security engineers and funds various third-party security efforts), and make sure we are perpetually improving.
On top of that, Docker is known for making powerful technology more accessible to more people. We want to use that "superpower" to make security more usable by non-experts. We think that contributes to making everyone more secure.
> Process isolation is a fantastic. There just really needs to be more, in my opinion.
Docker security is about much, much more than process isolation.
Thanks for the feedback. We hope to see you on the github repo, we value bug reports :)
Sounds great in theory, but there hasn't been much traction on that project, at least from their own website, for over 6 months. Not much in terms of peer review of their method, or practical audits of their technology. Even your own audit is over a year old now, despite constant changes to the codebase.
That said, I do recall now when this was announced originally, and I'm glad that it at least exists. That it has skipped my memory makes me wonder why there has been little to no press about it since then. How broadly adopted has this been? Can we get signed images for, say, Ubuntu from docker hub?
> docker pull NAME@DIGEST
A great feature to have. Can you point me at the digest for the ubuntu repo on docker hub?
> serious refactoring which we have been working on
Good to hear. Also, interesting to note that runc still requires root access to make cgroups; I was not aware of this restriction.
> The Docker core engineering team invests more time on hardening than features.
I find this to be an interesting position to take, considering that a core component of docker has been historically re-written with every other release: registry in 1.6, disk plugins in 1.7, networking in 1.9, runc in 1.11. IIRC, networking was re-written again in 1.12, to support yet another version of clustered networking. That's a lot of churn for less than a year and a half worth of time.
> We hope to see you on the github repo, we value bug reports
That hasn't gone well for me in the past.
devicemapper errors in ubuntu 14.04, prior to dynamic linking: not our problem.
devicemapper dropping mounts sporadically: move to overlayfs.
Low level mutexes being shared between containers: that's nodejs' problem.
It's frankly become easier to create and use workarounds like spam-unmounting orphaned devicemapper mounts, or custom-compiling and distributing docker, or disabling docker-managed networking, and so on.
I feel bad for ragging on Docker like this, especially since I do end up using it frequently; but as a system administrator Docker is a nearly daily headache. Our developers love it, but the rest of us... not so much. I guess it's one of those "technologies everyone complains about" vs "technologies nobody uses" things. It's just really frustrating.
export DOCKER_CONTENT_TRUST=1
docker pull ubuntuHowever, there's some usability problems here that I'd like to bring to your attention:
- There is no indication that the pull is different; no output from trust verification that it is indeed signed. This means I have to trust that Docker did the right thing, with no means of verification.
- Inspecting the image after pulling gives no indication that the image is signed, and gives me no way to do my own signature validation on the image.
- It does fail properly when pulling an unsigned image. Yay!
- Docker run initiates a connection back to notary, and fails if it can not connect. This makes me uneasy - it makes me wonder what data is passed, how it's being used, what changes are being made according to the response, and so forth.
- Using trust is a per-command decision, instead of a daemon setting.
- There's no clear method to revoke a signing key if identified to be malicious.
- This seems like a good candidate for "secure by default" once some of the usability issues are resolved.
To be fair, runC was its own project for quite some time. Docker just switched from importing the runC code to actually running the binaries through containerd as a proxy in 1.11 (a design decision I'm still trying to wrap my brain around, but that's a separate issue).
> Docker runs unprivileged by default, but only on relatively recent kernels with user namespace support (it drops itself to "fake root" so it can still create containers without actually having uid0).
Is that right? As far as I'm aware, runC doesn't have support for anything like that (and Linux's method of handling network namespaces under an unprivileged user namespace doesn't allow you to even have a network connection to the outside world). Sure, in runC we're working on rootless containers, but that's a while away from being done and Docker might not ever be able to support rootless containers completely (since it needs to handle networking and some other things that still need some quite significant kernel work to complete).