Azure built in policy container-no-privilege-escalation preventing "az aks command invoke"

Viewed 21

I am unable to use "az aks command invoke" because the policy at https://store.policy.core.windows.net/kubernetes/container-no-privilege-escalation/v3/template.yaml is preventing privilege escalation. I get the following error when I try it

 (KubernetesOperationError) Failed to run command in managed cluster due to kubernetes failure. details: admission webhook "validation.gatekeeper.sh" denied the request: [azurepolicy-k8sazurev3noprivilegeescalatio-adff37e713cffbf58639] Privilege escalation container is not allowed: init-command
[azurepolicy-k8sazurev3noprivilegeescalatio-adff37e713cffbf58639] Privilege escalation container is not allowed: user-command
Code: KubernetesOperationError
Message: Failed to run command in managed cluster due to kubernetes failure. details: admission webhook "validation.gatekeeper.sh" denied the request: [azurepolicy-k8sazurev3noprivilegeescalatio-adff37e713cffbf58639] Privilege escalation container is not allowed: init-command
[azurepolicy-k8sazurev3noprivilegeescalatio-adff37e713cffbf58639] Privilege escalation container is not allowed: user-command

Is this an expected ramification of having the AKS built in policies applied?

0 Answers
Related