moby / buildkit

concurrent, cache-efficient, and Dockerfile-agnostic builder toolkit
https://github.com/moby/moby/issues/34227
Apache License 2.0
7.89k stars 1.09k forks source link

Feature proposal: token-based authorization mechanism for buildkitd #1658

Open rberrelleza opened 3 years ago

rberrelleza commented 3 years ago

Currently, buildkit only supports authorization using certificates. This is very useful, but it doesn't scale well beyond a small number of users. For Okteto, we run a shared buildkitd service that can be shared with multiple users in an organization. It would be very useful if buildkitd supported a token-based authorization mechanism.

This could work as follows:

This initial idea is just a go/no-go type of authorization. In the future this could be extended to also include quotas, rate limits, or even an 'identity context' across more bulidkit operations. A PoC of this is available here https://github.com/okteto/buildkit/commit/7c82ae09ec87471a981607106cdf68fc767b1dec

AkihiroSuda commented 3 years ago

NACK. This is weak against spoofing (unless it is used together with TLS).

rberrelleza commented 3 years ago

@AkihiroSuda yes, this should be used in addition to TLS. The way I'm thinking about it, TLS is used to guarantee the caller is talking to the expected buildkit instance, and the caller presents a token so the buildkit server can verify that the caller should have access to it.

AkihiroSuda commented 3 years ago

sgtm