sipb / homeworld

Cluster management system for the SIPB Hyades project
MIT License
21 stars 19 forks source link

Remove setuid bits from 'su' and other setuid binaries #76

Open celskeggs opened 7 years ago

celskeggs commented 7 years ago

su: You should never need to gain root on a node. other binaries: let's maximally avoid privilege escalation. ping: maybe keep this one.

achernya commented 7 years ago

Scripts implements this with a cron job and whitelist for all setuid/setgid binaries. Scripts is a multi-tenant environment without container isolation, so it probably whitelists more things than Hyades should.

There's a similar check for filesystem capabilities: cron job, whitelist.

andersk commented 7 years ago

Scripts also has yum post-actions to preserve these changes on package upgrades. On Debian, you’d do this with dpkg-statoverride.

Or, you can mount the entire filesystem with the nosuid option, which neuters setuid, setgid, and fscaps globally. You can then whitelist individual binaries if needed by bind-mounting them onto themselves with the suid option (but really, you can probably just live without ping as non-root).