Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auth support for tls endpoint #164

Merged
merged 2 commits into from Sep 22, 2022
Merged

Conversation

crazy-max
Copy link
Member

@crazy-max crazy-max commented Sep 18, 2022

needs #163

Adds authentication support for tls:// endpoint (and docs to also set up SSH auth).

To ease the integration in a workflow, environment variables are used to avoid registered inputs in the action for each node (see #165). You need to add the following environment variables to set up TLS authentication with the BuildKit client certificates:

  • BUILDER_NODE_<idx>_AUTH_TLS_CACERT
  • BUILDER_NODE_<idx>_AUTH_TLS_CERT
  • BUILDER_NODE_<idx>_AUTH_TLS_KEY

Where <idx> is the position of the node in the list of nodes. The index should always be 0 at the moment as we don't support (yet) appending new nodes with this action.

Copy link
Member

@jedevc jedevc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 🎉

Not so sure about the env scheme, especially since we support other arguments using with - is there a reason we couldn't put node authentication details there, using a nodes field? It feels a little inconsistent to have to track multiple arguments over different fields.

Potentially we could use that for specifying platforms per node as well? I think I'm imagining something that's like the refactoring of output in #162, but for the inputs instead.

@@ -0,0 +1,101 @@
# Authentication to a remote node
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the page title, since the remote driver works without authentication - we probably don't want to promote using unauthenticated TCP connections, but it's allowed, and for a setup that runs buildkitd and buildctl on the same CI machine, it seems like a reasonable deployment?

Unrelated, but we should also mention the docker-container:// scheme here, happy to do that as a follow-up later.

Copy link
Member Author

@crazy-max crazy-max Sep 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but it's allowed, and for a setup that runs buildkitd and buildctl on the same CI machine, it seems like a reasonable deployment?

Yes but don't think users want to set up a local buildkit instance on an ephemeral GitHub Runner? I think they prefer to use this action to create a BuildKit container.

Unrelated, but we should also mention the docker-container:// scheme here, happy to do that as a follow-up later.

Yes sounds good. I guess it would use a context that connects to a remote docker engine instance?

@crazy-max
Copy link
Member Author

Not so sure about the env scheme, especially since we support other arguments using with- is there a reason we couldn't put node authentication details there, using a nodes field? It feels a little inconsistent to have to track multiple arguments over different fields.

Don't think there is a better alternative. Using with, we can't define arbitrary inputs. They must be defined in action.yml and with #165, user could have an arbitrary list of nodes and therefore as many authentication entries. See https://github.com/crazy-max/docker-setup-buildx-action/blob/append/docs/advanced/append-nodes.md

Potentially we could use that for specifying platforms per node as well? I think I'm imagining something that's like the refactoring of output in #162, but for the inputs instead.

We could change the format but ssh keys and client certs are multi line values and we can't read secrets directly in the action with the current API 😞

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
@crazy-max crazy-max changed the title auth support for ssh and tls endpoints auth support for tls endpoint Sep 22, 2022
@crazy-max
Copy link
Member Author

@tonistiigi As discussed, I removed the SSH authentication handling in the action as it would tamper the local machine when modifying the SSH configuration. Also updated the docs to show how to set up SSH auth using a third-party action instead.

@tonistiigi tonistiigi merged commit f0ad70c into docker:master Sep 22, 2022
30 checks passed
@crazy-max crazy-max deleted the node-auth branch September 22, 2022 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants