Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Docker credentials passed via CRI (on image pull) match URL paths by prefix #102472

@saschagrunert

Description

@saschagrunert

What happened:

#8438 introduced a glob mechanism for Docker authentication configuration files. URL paths are being matched via strings.HasPrefix:

if !strings.HasPrefix(targetURL.Path, globURL.Path) {
// the path of the credential must be a prefix
return false, nil
}

This means that credentials provided for a container image quay.io/saschagrunert/foo in config.json will also be passed to the container runtime if we choose an image like quay.io/saschagrunert/foo-my-suffix.

I don't think that this is intentional because I cannot think of a valid use-case around it.

What you expected to happen:

That the credentials only for full path matches get passed down to the container runtime (via the CRI).

How to reproduce it (as minimally and precisely as possible):

Run kubernetes as described above with a set of pre-configured auth secrets and pull an image with a path suffix.

Anything else we need to know?:

None

Environment:

  • Kubernetes version (use kubectl version): v1.22.0-alpha.2.260+14e4ed07cf81a8
  • Cloud provider or hardware configuration: None
  • OS (e.g: cat /etc/os-release): NixOS
  • Kernel (e.g. uname -a): 5.11.21
  • Install tools: None
  • Network plugin and version (if this is a network-related bug): None
  • Others: None

cc @brendanburns @tcnghia

Metadata

Metadata

Assignees

Labels

help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/bugCategorizes issue or PR as related to a bug.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.sig/nodeCategorizes an issue or PR as relevant to SIG Node.sig/securityCategorizes an issue or PR as relevant to SIG Security.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions