Open alexeysofin opened 6 months ago
Hey @alexeysofin, we tried this scenario ourselves and we found that the behaviour is the same of the apparmor profiles irrespective of the kubearmor presence.
I've tried out this same profile and in the absence of kubearmor, kubectl exec
is not blocked, this is the expected behaviour.
PTAL https://github.com/kubearmor/KubeArmor/wiki/Enforcer-Feature-Parity
Bug Report
General Information
To Reproduce
Expected behavior
Permission denied for bash or at least more clear documentation for how k8s exec commands and apparmor profiles are inter-related. Scrolling though code, I couldn't easily find what's happening either.
Generated apparmor profile looks as follows
/etc/apparmor.d/kubearmor-default-nginx-nginx
And this same profile if applied without kubearmor does prevent bash or anything other than nginx/sleep from running which makes sense, moreover it prevents nginx from running because of missing some other permissions. Is kubearmor somewhat different in that regard? Maybe someone can at least point to the code where this logic that skips enforcement of commands lives.