azure-policy
azure-policy copied to clipboard
Improve ACR (azurecr.io) example regex
The old version, ^.+azurecr.io/.+$, has four problems:
- Strings like
evil.com/contoso.azurecr.io/foomatch. - Strings like
evilazurecr.io/foomatch. - Strings like
contoso.azurecraio/foomatch. - "Unescaped forward slash. This may cause issues if copying/pasting this expression into code." — RegExr
The new version, ^[^/]+\.azurecr\.io\/.+$, has four fixes, respectively:
- A literal
/is not allowed beforeazurecr(in the subdomain). - A literal
.is required directly beforeazurecr. - A literal
.is required betweenazurecrandio. - The
/is escaped with a backslash.
Useful command for viewing this commit:
git show --color-words=.
Thanks for the contribution. As mentioned here commits are not taken to built-ins in this repo but we will get the right internal folks to take a look at this. @RamyasreeChakka can you handle next steps since this is kubernetes related?
- @Azure/azure-policy-kubernetes-contributors - FYI
FYI that's a 404.
Thanks for the contribution. As mentioned here commits are not taken to built-ins in this repo but we will get the right internal folks to take a look at this. @RamyasreeChakka Ramyasree Chakka FTE can you handle next steps since this is kubernetes related?
@pilor and @SimonAlling - Thank you, AKS policy team will review the PR and incorporate the changes in built-ins if fitting.
Status, @RamyasreeChakka?
Status, @RamyasreeChakka?
@Amirzadehm @feruilob @nreisch - can you take a look at this PR?
@RamyasreeChakka I think I already pick up this change in internal repo https://github.com/Azure/azure-policy/blob/914cf50c1bb326c0540b4b06df3f6d762b11a88c/built-in-policies/policyDefinitions/Kubernetes/ContainerAllowedImages.json#L108