IBM / portieris

A Kubernetes Admission Controller for verifying image trust.
Apache License 2.0
332 stars 78 forks source link

Error no valid ImagePullSecret defined when host contains a wildcard #456

Open pre opened 7 months ago

pre commented 7 months ago

What commit ID of Portieris did you experience the problem with?

v0.13.12

What went wrong?

When verification of image signatures is enabled, Portieris requires the workload define a valid image pull secret.

When

When

When

In our case, we provide each namespace with the same image pull secret with a wildcard host, because many images come from a different subdomain, even though the same credentials are allowed to the same service. Earlier we had cases where the subdomain could even not be known in advance.

While we can change our configuration and duplicate the credentials for each known registry subdomain (there are plenty), this behaviour took some time to figure out for a first time Portieris user.

What should have happened differently?

Portieris should understand that image pull credentials for *.world.com can be used for hello.world.com instead of failing with a somewhat misleading error message.

How can it be reproduced?

Create image pull credentials with a wildcard hostname. Enable Portieris trust configuration. See the request be denied.

apiVersion: v1
kind: Secret
metadata:
  name: default-registry-credentials
type: kubernetes.io/dockerconfigjson
data:
  .dockerconfigjson: { // base64 
    "auths": {
      "*.example.com":{
        // will not work
      },
      "hello.example.com":{
        // this will work 
      },
    }