moby / moby/buildkit

Proposal: document Dockerfile building security promises

Open
#4,822 10 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/security exp/intermediate kind/docs
Dominant language
Go
Stars
10.3k
Forks
1.5k
Avg merge
1d 23h
Merged PRs (30d)
48

Description

Currently it seems very hard to find any documentation on what kind of security is promised by Dockerfile execution, especially if building Dockerfiles from untrusted sources.

As far as I can gather, the security is as follows:

  • context directory contents are available, but there is no access to files outside it
  • full access to network is available as if running an untrusted docker image
  • escalating access to host is prevented with the same strength as normal untrusted docker images
  • resource constraints are given in docker build command line

This means that if these limitations are acceptable, it is possible to allow building Dockerfiles from untrusted sources without creating a separate VM or similar to contain the build.

I assume something like this is already done by Docker Hub when builds are submitted to it, as it probably does not use a separate VM for each build, so the priviledge separation probably has been tested quite rigorously.

Is my assessment correct? Should this be explicitly documented somewhere?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing documentation and Dockerfile execution security model, then verify the listed context, network, host-access, and resource-constraint claims. Done means the security promises for untrusted Dockerfile builds are confirmed and documented in an appropriate location.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, dockerfile
Domain
documentation, security
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.