emissary-ingress / emissary

open source Kubernetes-native API gateway for microservices built on the Envoy Proxy
https://www.getambassador.io
Apache License 2.0
4.37k stars 685 forks source link

Apiext pod Azure policies non compliant #4911

Open BChancusi opened 1 year ago

BChancusi commented 1 year ago

When installing Emissary on AKS with the AKS related polcies enabled, including the Azure provided policy initative "Kubernetes cluster pod security restricted standards for Linux-based workloads", pods are non-compliant:

emissary-system/emissary-apiext pod:

emissary/emissary-ingress pod:

The apiext pod should possibly have the same default security context as the main ingress pod when installed through helm. E.g. "runAsUser:8888" etc.

Credentials auto mount should be resolvable by specifying our own service account and volume through helm param but yet to try.

To Reproduce Steps to reproduce the behavior:

  1. Enable the Azure AKS initiative and policies listed above. (Can be set to audit rather then deny pod creation for ease of debugging)
  2. Ensure polcies are enabled on the AKS, e.g by checking contrainst template "kubectl get constraintemplates"
  3. Install Emissary
  4. Trigger a policy scan on Azure, e.g. through azure "az" cli
  5. See non compliant pods in the azure portal policies page.

Versions:

cindymullins-dw commented 1 year ago

Thanks, @BChancusi for raising these issues. Wonder if you have interest in contributing to any of the issues mentioned? We do have a monthly contributor's meeting you're welcome to join even if just to discuss.

carlin-q-scott commented 1 year ago

I was looking into the k8s API token security finding myself and wondering if both containers needed access to the k8s API, or if maybe only the emissary-apiext container does. Does anyone know?