Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit required privileges to run some MetalK8s control plane and infra services #2918

Open
thomasdanan opened this issue Nov 9, 2020 · 0 comments
Labels
kind:epic High-level description of a feature iteration severity:medium Medium impact (usability) on live deployments topic:deployment Bugs in or enhancements to deployment stages

Comments

@thomasdanan
Copy link
Contributor

Component:

Why this is needed:

Some MetalK8s users may have security constraints when it comes to run MetalK8s. Limiting the number of services requiring root user to run will help to improve MetalK8s adoption.

it likely makes sense for us to not run several things that are running as root today as non-root. Some are using a non-0 UID already (using some randomly chosen UID). However, we should for all node-local services (i.e., static manifests) create the appropriate user(s) and use their UID in the Pod manifest. Of course, we then need to ensure the applicable user(s) has the right to read e.g. x509 keys and such.

Examples of things we can likely run with lower privileges:

  • Repository nginx (no need to bind to any low ports)
  • apiserver-proxy nginx (same as above)
  • kube-scheduler, kube-apiserver, kube-controller-manager
  • etcd, but then we must properly manage the ownership of /var/lib/etcd
  • salt-api, maybe salt-master, if proper permissions on the sockets and such in /var/run/salt can be set

Furthermore, we can use securityContexts to further drop capabilities (and some more), such that services that do (need to) run as root are still somewhat constrained.

One kubeadm issue relates to this: kubernetes/kubeadm#1367

What should be done:

Implementation proposal (strongly recommended):

Test plan:

@thomasdanan thomasdanan added topic:deployment Bugs in or enhancements to deployment stages kind:epic High-level description of a feature iteration severity:medium Medium impact (usability) on live deployments labels Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:epic High-level description of a feature iteration severity:medium Medium impact (usability) on live deployments topic:deployment Bugs in or enhancements to deployment stages
Projects
None yet
Development

No branches or pull requests

1 participant