Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot access ICRRVA although secret exists in namespace #382

Open
nbgooch opened this issue May 11, 2022 · 1 comment
Open

Cannot access ICRRVA although secret exists in namespace #382

nbgooch opened this issue May 11, 2022 · 1 comment

Comments

@nbgooch
Copy link

nbgooch commented May 11, 2022

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

1048ff4

What went wrong?

When deploying application I get

Error: admission webhook "trust.hooks.securityenforcement.admission.cloud.ibm.com" denied the request: 
No credentials on client to call Vulnerability Advisor for IBM Cloud Container Registry with

What should have happened differently?

Application should have deployed successfully

How can it be reproduced?

  1. Install portieris
  2. Apply CRD
apiVersion: portieris.cloud.ibm.com/v1
kind: ClusterImagePolicy
metadata:
  name: block-vulnerable-images
spec:
   repositories:
    - name: "us.icr.io/*"
      policy:
        vulnerability:
          ICCRVA:
            enabled: true
           # I have tried both with and without accountID and does not seem to matter as we currently have no exceptions
  1. ICR secret in namespace being deployed to
    image
  2. Deploy image from ICR

Any other relevant information

I am pretty sure this is not a bug, but instead a misconfiguration. Can you provide more information on how to access the ICCRVA using secrets? I think maybe since it is a .dockerconfigjson secret and not an IAM key, it cannot access.

@iainduncani
Copy link
Member

Portieris will get the credentials to talk to Vulnerability Advisor from the imagePullSecrets attached to the Pod that is being deployed. The imagePullSecrets can be added directly to the pod being deployed but usually will come from a ServiceAccount, either the default one in your namespace or a different one that you reference in the pod definition so I think adding this service account to your namespace should do the trick:

apiVersion: v1
imagePullSecrets:
- name: all-icr-io
kind: ServiceAccount
metadata:
  name: default
  namespace: m-example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants