cloudfoundry-community / docker-registry-boshrelease

Run your own private Docker Registry in standalone mode (without requiring the public index) on AWS, OpenStack or vSphere with BOSH
MIT License
13 stars 20 forks source link

docker.proxy.only_auth_for_admin breaks admin authentication #29

Closed clbeeson closed 6 years ago

clbeeson commented 6 years ago

After adding docker.proxy.only_auth_for_admin true to our 3.3.1 deployment (the deployment previously had basic auth enabled and allowed push and pull operations with credentials) , I am able to pull images without providing credentials but am unable to push an image even with appropriate credentials. This seems connected with the differences between v1 and v2 protocols for pull and push as referenced here: https://github.com/docker/distribution/issues/1230

jhunt commented 6 years ago

Do we just need to update the version of docker/distribution?

clbeeson commented 6 years ago

From the research I've done it doesn't look like a basic auth with a limit_except Get in nginx will provide the unauthenticated pull and authenticated push/admin functions. Doesn't look like there is much support for this type of solution in the Docker community either. The options to resolve shown in the Docker community are: 1.) Use JWT support for finer grained access controls. 2.) Use 2 URLs and separate the access controls in the nginx config by the endpoints. 3.) Basically the same as #2 except use different ports for segregation.

kinjelom commented 6 years ago

Please look at this PR: https://github.com/cloudfoundry-community/docker-registry-boshrelease/pull/36 it solves this issue by using "ports for segregation" mentioned by @clbeeson

Tested:


The registry is available for administrative and reading purposes on different rules:

jhunt commented 6 years ago

Merged #36