siderolabs / talos

Talos Linux is a modern Linux distribution built for Kubernetes.
https://www.talos.dev
Mozilla Public License 2.0
6.39k stars 514 forks source link

research: provide sane default restricted pod security, limit access to mounting `/system` #3943

Open smira opened 3 years ago

smira commented 3 years ago

This is more of a research ticket to collect some data.

There are two problems we need to solve:

There might a single solution to both problems, or different solutions.

Today Talos deploys PSP which enables everything for every user in the system, so it's effectively no-op.

Potential solutions:

Please also note that enabling write access to hostPath volumes means that eventually any path on the host filesystem can be mounted, so probably proper solution is simply to forbid hostPath volumes as baseline and allow it only for privileged users.

andrewrynhard commented 3 years ago

I would like to avoid any third party solutions if we can. That would be ideal IMHO.

smira commented 3 years ago

I would like to avoid any third party solutions if we can. That would be ideal IMHO.

we should probably discuss it more, but I wonder if we do PSP which forbids hostPath volumes as a baseline policy, should it be enough?

andrewrynhard commented 3 years ago

I would like to avoid any third party solutions if we can. That would be ideal IMHO.

we should probably discuss it more, but I wonder if we do PSP which forbids hostPath volumes as a baseline policy, should it be enough?

I feel like so. Our whole goal with Talos is to make the host irrelevant, so it makes sense to me.

sanmai-NL commented 4 months ago

@smira Given the current status on https://www.talos.dev/v1.6/kubernetes-guides/configuration/pod-security/, can this issue be closed?

sanmai-NL commented 4 months ago

@andrewrynhard @smira I think the main value that speaks from this issue, and that remains to be created, is a comprehensive documentation of Talos Linux's security model, applicable frameworks and the required parameters such as specific permissions. For example, document Talos Linux design wrt. Linux namespaces, networking, boot/disks and other dimensions. This would result in docs that list which filesystem paths are sensitive. When users then decide to reconfigure from the applied standards, they can be expected to take into account these paths and take appropriate measures themselves, with or without third party extensions to Kubernetes or Talos Linux.