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

Docker registry with native basic auth not working #106

Open
maxsuelmarinho opened this issue Jun 20, 2020 · 7 comments
Open

Docker registry with native basic auth not working #106

maxsuelmarinho opened this issue Jun 20, 2020 · 7 comments

Comments

@maxsuelmarinho
Copy link

Hi guys

I have been trying to get docker registry with native basic authentication working with the new image tag (2.7.1) without success.
Doc -> https://docs.docker.com/registry/deploying/#native-basic-auth

Specifically when I execute this command:

$ docker run --entrypoint htpasswd registry:2 -Bbn testuser testpassword > auth/htpasswd

This is the error I get:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"htpasswd\": executable file not found in $PATH": unknown. ERRO[0001] error waiting for container: context canceled

Investigating a little further, seems that the "htpasswd" was removed in the image tag 2.7.1.

$ docker run -it --rm registry:2.7.1 find / -name "htpasswd"

Although, looking in the previous version (tag 2.6.2) the file is there:

$ docker run -it --rm registry:2.6.2 find / -name "htpasswd" /usr/bin/htpasswd

And the initial command works was expected was well:

$ docker run --entrypoint htpasswd registry:2.6.2 -Bbn testuser testpassword testuser:$2y$05$KiRgtd4w8zO7ucC7LX8zguW58DBlm8E0yZ5gI64NXypIVtsosNvMu

@avelytchko
Copy link

avelytchko commented Jun 22, 2020

As I can see it has been removed from container in this commit due to CVE-2020-1927 and CVE-2020-1934.

@edsantiago
Copy link

This is a regression, and is inconsistent with published documentation. It breaks CI processes which rely on the --entrypoint htpasswd behavior (still) documented in docs.docker.com. If that is to be deprecated, it would be courteous to (1) indicate so in the documentation, and (2) offer a grace period. Please consider both.

@chanseokoh
Copy link

We are affected. We'd like to see a resolution (whatever it is) and correct docs. Also a migration path if htpasswd is going to be permanent removed.

@anonymouse64
Copy link

If the decision is to not support htpasswd in the container, then there needs to be a docs change on the website: https://docs.docker.com/registry/deploying/#native-basic-auth

@dejo1307
Copy link

This broke lot of everyone's automation, and it is a problem fixing it without at least docs being updated since no one is 100% sure what is going to be fix.

openstack-mirroring pushed a commit to openstack-archive/tripleo-ansible that referenced this issue Jul 7, 2020
htpasswd is removed in latest registry image[1]
and it's breaking molecule job for tripleo_podman
role, let's use working registry image.

[1] distribution/distribution-library-image#106
Change-Id: I644210a2dcc4cb3810d0999e8c69f8d54f602793
openstack-mirroring pushed a commit to openstack/openstack that referenced this issue Jul 7, 2020
* Update tripleo-ansible from branch 'master'
  - Use registry:2.7.0 instead of registry:2
    
    htpasswd is removed in latest registry image[1]
    and it's breaking molecule job for tripleo_podman
    role, let's use working registry image.
    
    [1] distribution/distribution-library-image#106
    Change-Id: I644210a2dcc4cb3810d0999e8c69f8d54f602793
openstack-mirroring pushed a commit to openstack-archive/tripleo-ansible that referenced this issue Jul 8, 2020
htpasswd is removed in latest registry image[1]
and it's breaking molecule job for tripleo_podman
role, let's use working registry image.

[1] distribution/distribution-library-image#106
Change-Id: I644210a2dcc4cb3810d0999e8c69f8d54f602793
(cherry picked from commit 439671e)
Conflicts:
    tripleo_ansible/roles/tripleo-podman/molecule/login/prepare.yml
openstack-mirroring pushed a commit to openstack-archive/tripleo-ansible that referenced this issue Jul 8, 2020
htpasswd is removed in latest registry image[1]
and it's breaking molecule job for tripleo_podman
role, let's use working registry image.

[1] distribution/distribution-library-image#106
Change-Id: I644210a2dcc4cb3810d0999e8c69f8d54f602793
(cherry picked from commit 439671e)
egegunes pushed a commit to egegunes/buildah-rpm that referenced this issue Sep 21, 2020
The docker.io/registry:2 image broke suddenly and with no warning:

distribution/distribution-library-image#106

Symptom: running 'htpasswd' from that container no longer works,
even though it's been documented for years (at docker.com) and
as of this writing still remains documented.

One solution is to run htpasswd locally (requires installing the
httpd-tools package) or using any crypt library to hash. Not
hard, but tedious, and it doesn't address the issue of the
docker registry:2 image being a moving target.

I choose to force the use of the :2.6 tag, in hopes that that
image will remain unmodified. Refactored to use FQIN instead
of shortname, and to define it in only one place.

Signed-off-by: Ed Santiago <[email protected]>
@warrenc5
Copy link

can someone say why I can't use apache htpasswd or htdigest from apache-utils.

Is it bcrypt? Is something different? I did a small test but [email protected]+deb9u9
didn't work.

@skandyla
Copy link

can someone say why I can't use apache htpasswd or htdigest from apache-utils.
Is it bcrypt? Is something different? I did a small test but [email protected]+deb9u9
didn't work.

You can use any external htpasswd util or install it inside the registry container.
But registry:2 require to use htpasswd bcrypt. So you should create htpasswd like this:
htpasswd -B [FILE] [USER]

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

No branches or pull requests

8 participants