You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a developer, I'd love it if I could declaratively tell dagger/buildkit that I want to trust my organization's private CA cert, so that, for example, actions like docker.#Pull and docker.#Push work with our internal registry.
Currently, a buildkit instance must be created manually with the private CA cert(s) mounted into it.
E.g. docker run --net=host -d --restart always -v $PWD/myCA-cert.pem:/etc/ssl/certs/myCA-cert.pem --name dagger-buildkitd --privileged moby/buildkit:v0.10.0
It would be an awesome DX improvement if we could just provide this as a config setting, e.g. in an environment variable like DAGGER_TRUSTED_CA_CERTS=/path/to/myCA-cert.pem
I think this could integrate nicely with step-ca, perhaps even build a dagger-ca into dagger itself. Also allow users to use their existing private CA to sign dagger-ca, and automate mTLS everywhere
Just thought I would land some thinking here about TLS overall.
Use cases:
communication between dagger and a given buildkitd
a. Similarly to what buildctl does, it would be desirable for dagger to let the user specify (the client side part of things):
* CA to trust (--tlscacert)
* client cert (--tlscert)
* client key (--tlskey)
--tlscacert is useful if you are not able to trust the cert at the host level
b. Note that buildkitd in that case would still have to be started outside of dagger so that the operator can configure TLS for buildkitd appropriately (possibly using alternative setups like ghosttunnel w. step certs).
communication between buildkitd and specific registries
Per-registry, the ability to specify
CA to trust
client cert
client key
AFAIK this is best done using the buildkit toml config file (and mounting the certs in the container).
People are asking (#2016) for a subset of the above (and this ticket here as well).
I personally do not like the proposed approach here:
the name DAGGER_TRUSTED_CA_CERTS is unclear and does not convey what type of communication this is covering (1. or 2. or both) - furthermore, people might even think this would also cover communication from inside #Exec - which none of this will
this only allows for a limited amount of configuration (cannot specify client certs, neither in 1. nor 2.)
Alternatively, what about the following proposal?
a. add support for a single DAGGER_BUILDKITD_MOUNT_FOLDER variable (or any better name), that if pointing to a folder would get mounted in the buildkitd container under (say) /config. buildkitd would then be started with --config /config/buildkitd.toml, letting the user pass a custom config and any other supporting file (eg: certificates).
This would settle once and for all the question of letting users configure specific aspects of buildkitd (including per registry client certs).
b. add --bk-tlscacert--bk-tlscert--bk-tlskey support to dagger (or env variables), to address specifically use case 1
None of the above of course would address the need (3.) to trust additional CA inside of #Exec, or provide client certs for communication with other services (again, inside #Exec), though I would argue that the ability to mount buildkit secrets with #Exec should be enough, given how specialized the use-case is for these.
I'm an early adopter of the Node.JS SDK (thank you, by the way) and support for additional CA certs is something I'm really looking forward to.
I use private image registries with not-widely-trusted CAs (e.g. internal organization CAs) and I need a way to get dagger's buildkit to trust these. I can't seem to find an escape hatch at the moment.
Activity
4x0v7 commentedon Apr 12, 2022
I think this could integrate nicely with step-ca, perhaps even build a
dagger-cainto dagger itself. Also allow users to use their existing private CA to signdagger-ca, and automate mTLS everywheredubo-dubon-duponey commentedon Apr 21, 2022
Just thought I would land some thinking here about TLS overall.
Use cases:
a. Similarly to what buildctl does, it would be desirable for dagger to let the user specify (the client side part of things):
* CA to trust (--tlscacert)
* client cert (--tlscert)
* client key (--tlskey)
--tlscacertis useful if you are not able to trust the cert at the host levelThis is what #2227 is about.
b. Note that buildkitd in that case would still have to be started outside of dagger so that the operator can configure TLS for buildkitd appropriately (possibly using alternative setups like ghosttunnel w. step certs).
Per-registry, the ability to specify
AFAIK this is best done using the buildkit toml config file (and mounting the certs in the container).
People are asking (#2016) for a subset of the above (and this ticket here as well).
I personally do not like the proposed approach here:
DAGGER_TRUSTED_CA_CERTSis unclear and does not convey what type of communication this is covering (1. or 2. or both) - furthermore, people might even think this would also cover communication from inside #Exec - which none of this willAlternatively, what about the following proposal?
a. add support for a single
DAGGER_BUILDKITD_MOUNT_FOLDERvariable (or any better name), that if pointing to a folder would get mounted in the buildkitd container under (say)/config.buildkitdwould then be started with--config /config/buildkitd.toml, letting the user pass a custom config and any other supporting file (eg: certificates).This would settle once and for all the question of letting users configure specific aspects of buildkitd (including per registry client certs).
b. add
--bk-tlscacert--bk-tlscert--bk-tlskeysupport to dagger (or env variables), to address specifically use case 1Hope that helps :)
dubo-dubon-duponey commentedon Apr 21, 2022
None of the above of course would address the need (3.) to trust additional CA inside of
#Exec, or provide client certs for communication with other services (again, inside#Exec), though I would argue that the ability to mount buildkit secrets with#Execshould be enough, given how specialized the use-case is for these.dubo-dubon-duponey commentedon Apr 21, 2022
Tagging @grouville (since he has been working on
BUILDKIT_CA_CERTS)sigwinch28 commentedon Nov 19, 2022
I'm an early adopter of the Node.JS SDK (thank you, by the way) and support for additional CA certs is something I'm really looking forward to.
I use private image registries with not-widely-trusted CAs (e.g. internal organization CAs) and I need a way to get dagger's buildkit to trust these. I can't seem to find an escape hatch at the moment.
shykes commentedon Dec 21, 2022
@sipsma can we close this as duplicate of #4217 ?
sipsma commentedon Dec 21, 2022
@shykes Yes good call, #4217 is the more "modern" 0.3 incantation of the same underlying issue, makes sense to track there now. Closing this one