zot: [Bug]: Docker pull fails to pull from restricted path if anonymous access allowed on the other path

zot version

2.1.3-rc1 (master)

Describe the bug

So, there a some base images, that i want any clients to be able to pull, but rest of the images - only for logged users. Without login I’m able to pull repo.tld/base/foo:bar, but not repo.tld/service/baz:latest, that’s expected. Once i’ve done podman login repo.tld and docker login repo.tld, i can podman pull repo.tld/service/baz:latest, but not the docker one!

# docker --debug -l debug pull repo.tld/service/baz:latest
time="2025-01-30T16:00:03Z" level=debug msg="otel error" error="1 errors occurred detecting resource:\n\t* conflicting Schema URL: https://opentelemetry.io/schemas/1.21.0 and https://opentelemetry.io/schemas/1.26.0"
Error response from daemon: unauthorized: authentication required

From the Zot log i see that it does:

  1. GET /v2/, without auth, 200 OK
  2. HEAD /v2/service/baz/manifests/latest, 401
  3. end

If there no anonymous access allowed flow:

  1. GET /v2/, - 401
  2. HEAD /v2/service/baz/manifests/latest, with auth - 200 OK
  3. loading layers …

To reproduce

  1. Configuration
http:
  address: 0.0.0.0
  port: 443
  tls:
    cert: /etc/zot/tls.crt
    key: /etc/zot/tls.key
  auth:
    accessControl:
      repositories:
        "**": {defaultPolicy: [read]}
        "base/**": {anonymousPolicy: [read]}
  1. Client tool used: docker/27.5.1 go/go1.22.11 git-commit/4c9b3b0

Expected behavior

Docker pulls protected images when there also anonymous access allowed for some other path.

Screenshots

No response

Additional context

No response

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 2
  • Comments: 35 (28 by maintainers)

Most upvoted comments

I happen to work in a regulated industry organization, and we have several dimensions of requirements that do not allow us to individually or collectively change tools in any reasonable time frame. I’d personally be fired for just switching to podman. To convince the org to change, I’d have to get budget for a team to spend 3-6 months converting documentation, applications, CI/CD, and workstation/endpoint management. That’s assuming our security, compliance, and audit folks didn’t just say no because we wouldn’t have a support contract.

Sorry, I didn’t realize the implications. Initially, this project was supposed to be a simple implementation of the OCI image/dist spec without the complexity of the older docker ecosystem. In any, we’ll discuss how to proceed on this request.

Thank you so much for your kindness and positive work @andaaron !

I’ve been thinking about this and I totally see the value of the strict implementation. I think there will be an ongoing education issue, since most people are going to assume that OCI is a synonym for Docker-compatible. If you decide to keep Docker functionality “best effort” rather than “supported”, you may want an explainer in the Docs and maintain a “tested/untested” feature list there (or “just never use for Docker”).

I was very interested in zot because harbor is so heavy and distribution is so barebones. I think there’s a real place for zot in a lot of functions and use cases. But users shouldn’t bloat your project where it doesn’t want to go.