In my experience it's also annoying on Fedora and CentOS.alamahant wrote:The only distro you can use selinux with a desktop as an everyday driver is fedora and redhat derivatives.
In Gentoo you will need to be doing constant troubleshooting and adjustments and end up having a miserable life.
Code: Select all
init=/sbin/openrc-init
-systemd -logind -elogind seatdI am NaN! I am a man!
Maybe in my homelabalamahant wrote:Let me add something.The Selinux provided by the Gentoo developers is way more feature rich and configurable than the "targeted" mode of the redhats.
But with all this power there is potential to really give yourself daily headaches.If you really know what you are doing and are willing to put in the extra work go for it!
I take it AppArmor is a bit less hassle?pietinger wrote:I hesitated a little before responding here, because one of our Gentoo developers might write a rebuttal. So I'll just go ahead and do it myself:
Probably anyone who knows a little about IT security will say that a server machine should always be equipped with MAC [*]. Here, SELinux is actually mainly used. When it comes to desktops, opinions differ. Some also recommend SELinux here, while others (myself included) consider AppArmor more suitable for a desktop.
*) https://wiki.gentoo.org/wiki/User:Pieti ... protection
What are the benefits of using a MAC system? (see also the link to WikiPedia in my article)
It prevents a program from doing things OTHER than what is actually intended/desired due to a bug in that program.
For example, in 2018, a bug was "built into" OpenSMTPD that allowed users to obtain a shell via OpenSMTPD - Yes, it was a ROOT shell. Anyone using SELinux or AA (and provided they had the appropriate profiles for OpenSMTPD active) was "spared" from this hack... because these systems did not anticipate OpenSMTPD starting a bash... and simply prevented it. The bug was found 1.5 years later in 2020 ... -> https://www.cve.org/CVERecord?id=CVE-2020-7247
For example, I use AppArmor to deny both of my browsers access (not only write access but ALSO read access) to my /home directory. The same would also be possible with SELinux.
Unfortunately, the documentation for AppArmor is very limited.leyvi wrote:[...] is there good documentation elsewhere?
German is not an issue for me. Translator programs are quite good these days.pietinger wrote:Unfortunately, the documentation for AppArmor is very limited.leyvi wrote:[...] is there good documentation elsewhere?
The official wiki is here:
https://gitlab.com/apparmor/apparmor/-/ ... umentation
@ermor has provided a link to OpenSuse documentation here:
https://forums.gentoo.org/viewtopic-p-8 ... ml#8870721
Unfortunately, my own posts have not yet been translated and are in the German section of the forum (all D** threads):
https://forums.gentoo.org/viewforum-f-53.html
The archlinux wiki tends to have good writeups. In this case, https://wiki.archlinux.org/title/Apparmor .pietinger wrote:Unfortunately, the documentation for AppArmor is very limited.leyvi wrote:[...] is there good documentation elsewhere?

Good to know. I do realize that MAC is rather extreme, but given I already have full disk encryption and secure boot, I thought I might as well...penguinomicon wrote:...
If you're angling towards a job with the NSA, I'm sure they'll still let you in the door if you can say you're familiar with some other MAC first. And if you're not angling towards a job with the NSA, then I'm not sure why you'd even thinking about footgunning yourself quite this hard.
leyvi wrote:I've decided to mess around with AppArmor since YOLO. [...]
TBH I don't suggest aa-genprof ... here is another article about AA ... the chapter "Generating profiles by hand" describes almost the same as I did ...leyvi wrote:Is there a way to run aa-genprof not as root? [...] but maybe that's not the best solution?
Thanks, that will be very helpful for small tweaks. The thing is, I do actually use this computer for productivity (believe it or not). I'd rather not have to write all that every time I install something. That's why aa-genprof looks so appealing.pietinger wrote:TBH I don't suggest aa-genprof ... here is another article about AA ... the chapter "Generating profiles by hand" describes almost the same as I did ...
https://en.opensuse.org/SDB:AppArmor_geeks
Thanks Hu, I'll check it out.Hu wrote:Arch Linux has an online copy of the manual for aa-genprof. As I read that manual, you run aa-genprof as root, then it tells you to go manually run the application (presumably as any uid you want). After you tell it you are done, then it generates the profile. Presumably, that means all you need to do is start the to-be-profiled application from a shell running as you. I have not tried any of this.