I am using the AKS cluster. I have enabled the Policy add-on feature. And have assigned the built-in policy with definition name Kubernetes cluster containers should only use allowed images
During the assignment, I have included the allowed regex pattern as ^.+mcr.microsoft.com/.+$ This is the image source I have included in my Pod YAML "mcr.microsoft.com/v2/mcr/hello-world/tags/list" But it gets denied. Since I am not familiar with the Regex pattern kindly help me to use the right input.
Remove the first .+
from your pattern. So ^mcr.microsoft.com\/.+$
This means that the image name actually starts exactly with "mcr.microsoft.com..."