-
Did anyone get this working? I have configured this according to the documentation, but always get an UNAUTHORIZED error from ACR: Error from server: error when creating "STDIN": admission webhook "connaisseur-svc.connaisseur.svc" denied the request: Unexpected Cosign exception for image "maresetest.azurecr.io/ifs/example-app:latest": Error: GET https://maresetest.azurecr.io/oauth2/token?scope=repository%3Aifs%2Fexample-app%3Apull&service=maresetest.azurecr.io: UNAUTHORIZED: authentication required, visit https://aka.ms/acr/authorization for more information. This is my values.yaml: application: I have created the necessary my-secret in connaisseur namespace as per documentation, but still no luck. I noticed that when using notary you are supposed to add isAcr: true, which perhaps is an indication ACR is a bit 'special'? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hi @marese98 what version of Connaisseur are you using? Cosign seems to have had such an issue in the past, so in case you're using an outdated Connaisseur version, the bundled Cosign version might not contain the upstream fixes. Otherwise: the ACR does indeed do things differently (e.g. not implementing all parts of the Notary server interface though claiming compatibility or using special auth token names), so the likelihood for there to be a problem (either on our side or upstream) is indeed not insignificant. If it's not due to an outdated version, I'll go digging a bit. Kind regards |
Beta Was this translation helpful? Give feedback.
-
Hoy @marese98 To clarify the confusion with Now to your problem. I managed to get things going using an ACR, so I'm gonna run you through my process, so you can replicate things or pinpoint issues:
# Retrieve the ID of your registry
REGISTRY_ID=$(az acr show --name <ACR-NAME> --query 'id' -otsv)
# Create a service principal with the Reader role on your registry
az ad sp create-for-rbac --name "<SERVICE-PRINCIPLE-NAME>" --role Reader --scopes ${REGISTRY_ID}
kubectl create secret docker-registry <YOUR_SECRET-NAME> --docker-server=<ACR-URL> --docker-username=<APPLICATION-ID> --docker-password=<PASSWORD>
application:
validators:
- name: acr-test
type: cosign
trustRoots:
- name: default
key: |
...
auth:
secretName: <YOUR_SECRET-NAME>
policy:
- pattern: <ACR-URL>/*:*
validator: acr-test
with:
verifyInTransparencyLog: false
Hopefully this helps. Cheers. |
Beta Was this translation helpful? Give feedback.
Hoy @marese98
To clarify the confusion with
isAcr
. That is only needed for validation using a notary server (meaning using Dokcer Content Trust). That isn't the case for you, so you shouldn't need to use that field. Also to clarify things here: the ACR's notary server sends back its authentication token in a different field then the default notary server (the one used by Docker themselves) would do. That's why thisisAcr
field exists.Now to your problem. I managed to get things going using an ACR, so I'm gonna run you through my process, so you can replicate things or pinpoint issues:
az login
followed byaz acr login --name <ACR-NAME>
…