Skip to content

Declaratively Trust CA Certificates #2142

Closed as not planned
Closed as not planned

Description

@aluzzardi

Declaratively Trust CA Certificates

  • 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.

Originally posted by @qjcg in #2052 (comment)

Activity

  1. 4x0v7 commented on Apr 12, 2022

    @4x0v7

    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

  2. dubo-dubon-duponey commented on Apr 21, 2022

    @dubo-dubon-duponey
    Contributor

    Just thought I would land some thinking here about TLS overall.

    Use cases:

    1. 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

    This 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).

    1. 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).

    [registry."registry.local"]
      http = true
      insecure = true
      ca=["/etc/config/myca.pem"]
      [[registry."registry.local".keypair]]
        key="/etc/config/key.pem"
        cert="/etc/config/cert.pem"
    

    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

    Hope that helps :)

  3. dubo-dubon-duponey commented on Apr 21, 2022

    @dubo-dubon-duponey
    Contributor

    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.

  4. dubo-dubon-duponey commented on Apr 21, 2022

    @dubo-dubon-duponey
    Contributor

    Tagging @grouville (since he has been working on BUILDKIT_CA_CERTS)

  5. sigwinch28 commented on Nov 19, 2022

    @sigwinch28

    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.

  6. added
    area/engine
    and removed on Dec 5, 2022
  7. shykes commented on Dec 21, 2022

    @shykes
    Contributor

    @sipsma can we close this as duplicate of #4217 ?

  8. sipsma commented on Dec 21, 2022

    @sipsma
    Contributor

    @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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/enginekind/user-request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions