docker / docker/cli

Login credentials are case-senstive

Open
#2,753 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area/authentication area/distribution help wanted kind/enhancement
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Description

For images which require authorization, the host passed to the docker login command must match the host in the image in a case-sensitive manner. Reported to us at GitLab originally here: https://gitlab.com/gitlab-org/gitlab/-/issues/255291

Steps to reproduce the issue:
Assuming a registry running and reachable at test.registry.org

  1. docker build -t Test.Registry.org/test:latest .
  2. docker login test.registry.org
  3. docker push Test.Registry.org/test:latest auth fails

Describe the results you received:

Authentication fails.

Describe the results you expected:

Authentication does not fail.

Additional information you deem important (e.g. issue happens only occasionally):

The client is caching the login credentials in a case-sensitive manner

09:04 $ cat ~/.docker/config.json
{
        "auths": {
                "Test.Registry.org": {
                        "auth": "super-secret"
                },
                "test.registry.org": {
                        "auth": "super-secret"
                }
        },
        "HttpHeaders": {
                "User-Agent": "Docker-Client/19.03.13 (linux)"
        },
        "experimental": "enabled"
}

Output of docker version:

09:56 $ docker version
Client: Docker Engine - Community
 Version:           19.03.13
 API version:       1.40
 Go version:        go1.13.15
 Git commit:        4484c46d9d
 Built:             Wed Sep 16 17:02:36 2020
 OS/Arch:           linux/amd64
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          19.03.13
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       4484c46d9d
  Built:            Wed Sep 16 17:01:06 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.3.7
  GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0

Output of docker info:

Client:
 Debug Mode: false
 Plugins:
  app: Docker Application (Docker Inc., v0.8.0)
  buildx: Build with BuildKit (Docker Inc., v0.4.2-tp-docker)

Server:
 Containers: 6
  Running: 0
  Paused: 0
  Stopped: 6
 Images: 71
 Server Version: 19.03.13
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 8fba4e9a7d01810a393d5d25a3621dc101981175
 runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
 init version: fec3683
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.4.0-48-generic
 Operating System: Ubuntu 18.04.5 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 30.99GiB
 Name: hayley-Precision-5540
 ID: CI4P:CT65:VU5N:4VFX:BHYO:ABRF:HDYL:EXN7:KFDA:QHO6:OY6V:WV7U
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  gitlab.local:5000
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support

Additional environment details (AWS, VirtualBox, physical, etc.):

10:00 $ uname -a
Linux hayley-Precision-5540 5.4.0-48-generic #52~18.04.1-Ubuntu SMP Thu Sep 10 12:50:22 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The reported entry points are docker login, docker push, and the credential cache in ~/.docker/config.json. Reproduce the case mismatch with the listed registry commands, then trace the CLI's credential lookup; done means differently cased host names reuse the same credentials and authentication succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
authentication, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.