-
Notifications
You must be signed in to change notification settings - Fork 40
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
Create a demo for the docker registry generic connector #1303
Comments
NotesAfter a lot of trial and error, I decided to drop the Kubernetes part of this tutorial. It was over complicating it and creating tons of problems. I decided to pivot to a docker-compose file to stand up the environment. The initial workflow of using the generic connector to authenticate for push/pulling images to/from a Docker Registry does not seem like a practical example of maintaining images in a Jenkins pipeline. I'm looking into other possible ways of using Secretless to authenticate with Docker to make the tutorial |
@JakeQuilty can you share more details about what you're looking into? If I connect to a remote Docker registry now, I unfailingly use the CLI (I never make direct API calls) - is there a way to configure the CLI to connect to Secretless as if it's the remote registry, and have Secretless add the correct headers to the requests Secretless sends? Is that doable with the generic connector, or would a more flexible custom connector be needed for this use case? The more details you can add, the better we'll be able to understand how to push this forward. |
UpdateAfter a lot of playing with the CLI, I'm not sure if this is practical with the way the CLI authenticates the user on The CLI requires a user to be "logged in" before making a "Logged in" can be defined as: having a registry specified in the The Docker CLI feeds these credentials straight, the way they are, to the Docker Daemon. The Docker Daemon then authenticates to the Registry by, from everything I've seen, sending the credentials to the Registry and receiving a Bearer Token on every CLI request that goes out to the Registry. This article was really helpful for describing how the CLI authenticates. The MiTM the author uses makes Secretless seem possible between the Daemon and the Registry. I have not been able to set up a proxy for the Daemon on OS X and I found this thread that confirmed it wasn't possible(after hours of trying). I haven't been able to test this on a Linux VM yet, because I ran out of time for the day. Regardless if Secretless can be hacked into a proxy between the Docker Daemon and the Registry, I think the set up required to do this might kill the ability to scale it through Jenkins servers in containers. The only way I was able to trick the CLI into allowing a CLI command that required authentication to go through to the Daemon was by deleting the default Credential HelpersAfter looking at this for a while, I think a good way to achieve the same goal of keeping the Docker credentials off of the Jenkins server would be to use Conjur as a Docker credential helper. This does not seem too difficult to implement and would keep the credentials off the Jenkins server until they are used. These are just binaries that are called to |
UpdateI don’t think this is possible without making a specific connector for HTTP. In an Ubuntu vm I was able to put a Secretless proxy between the daemon and the registry. I used this blog about Docker Authentication again and this Docker doc to set it up.
I used the generic HTTP config for Docker Registries. Unfortunately, when trying to
I don’t think generic HTTP connectors will work OOB with the Docker CLI, because of how the daemon authenticates with the Registry. Suggested SolutionWe should make a specific connector for Docker CLI. There are two places to put Secretless to authenticate with the Docker CLI. Docker CLI --> Secretless --> Docker DaemonThe Docker daemon default listens on this sock: Docker Daemon --> Secretless --> Docker RegistryFor this we’d use an HTTP connector to inject the Bearer token into the request to the Registry. We’d have to work around credential handshake that the Daemon and Registry do to get the API token. I spent most of my time looking at this, so most of my notes give more details about this. |
Putting this on hold until there is a Docker CLI connector. I created a new issue to create the connector here: #1312 |
Is your feature request related to a problem? Please describe.
There is no demo for the docker registry generic connector.
Describe the solution you would like
Create a demonstration of the docker registry generic connector in action. The goal is to have the demo flow around a Jenkins server hosted in Kubernetes that authenticates with Secretless to push and pull from a private Docker Registry.
Describe alternatives you have consideredAdditional context
This stems from this Epic to create more generic connector examples.
The text was updated successfully, but these errors were encountered: