by strzibny · 4y ago · 0 comments
You'll basically get Ubuntu that didn't have SELinux in the first place, and most people don't care.
SELinux is difficult to build from scratch but there are decent tools to build your policy in an automated fashion.
The advice should be this: Don't have time to deal with SELinux at the moment? Switch to permissive policy and deal with it later.
I included SELinux as one big chapter in my book Deployment from Scratch rather than skipping on it.
I wish it's easier to sit down and write it, but it's not atm.
At the bare minimum, you need a base policy that already contains separate type contexts for each of your services, file contexts to apply to the service daemon binaries, and type transitions so that each service gets run in its proper context. If your daemons run in the wrong context, then immortalizing that in policy with e.g. audit2allow only deepens the swamp you're in.
I don't think there's any practical way to build an selinux policy from scratch by just running your system and recording it, even if the tools allow you to do that. You can only start from your OS' reference policy or indeed write the initial base policy by hand.