Solution Rbac
- Check the environment and identify the authorisation mode:
kubectl describe pod kube-apiserver-controlplane -n kube-system | grep "--authorization-mode" - Check how many
rolesexist:kubectl get roles - How to check all roles in all namespaces:
kubectl get roles --all-namespaces - How to check the resources the
kube-proxypod has access to:kubectl describe role kube-proxy -n kube-system - How to check which account the
kube-proxyrole is assigned to:kubectl describe rolebinding kube-proxy -n kube-system - The answer would be:
system:bootstrappers:kubeadm:default-node-token - The output looks like this:
Name: kube-proxy Labels: <none> Annotations: <none> Role: Kind: Role Name: kube-proxy Subjects: Kind Name Namespace ---- ---- --------- Group system:bootstrappers:kubeadm:default-node-token - How to run the
get podscommand as a specific user:kubectl get pods --as dev-user - The
kube-proxyrule get get details of the configmap object bykube-proxyonly.