Yes, I know about the encryption but that wouldn’t protect against infostealers*. Meanwhile I think I’ve found the way to deny unconfined domains reading my specific files, but then there are other issues, such as a whitelisted app using ‘ls’ to read the directory, which in turn uses unconfined domain, not the app’s app_exec_t. I have to look into domain transitions I guess.
Edit:* think about protecting already encrypted files against physical access.
Yeah. I’d like to figure out confined users someday as well. Unfortunately, I don’t think it is ready for prime time yet.
What I would like to do is mark a filesystem (on a thumb drive that is normally not connected) as accessible only to processes running as a specific user account that I would not normally sign in with. (And when I do sign in with that special account, it would only be a console/virtual-terminal sign in.)
Good luck.
Edit: A private NFSv4 server on a private LAN connection might be another option, but it would be a hassle to set up. When exported with sec=krb, NFSv4 will deny access to the filesystem (even the root user) unless the process has access to the right Kerberos ticket.
To deny access through unconfined, you can either write a CIL policy with deny rules, which probably is the easiest way. But since unconfined_t can modify the Selinux policy, you need to protect against this through other means. Be aware that you might also need take care of other lax domains similar to unconfined_t. Or you create a new Selinux user which does not allow access to your type, but that’s definitely a lot more work.
Do you have a domain transition in place? The sepolicy generate command should create an interface app_run (or similar) which you could use. Could you show your policy here?