dbus: Add AppArmor support#102537
Conversation
|
@GrahamcOfBorg build dbus |
There was a problem hiding this comment.
given that apparmor isn't on default why should this be?
There was a problem hiding this comment.
The default mode is "enabled". In "enabled" mode, AppArmor mediation will be performed if AppArmor support is available in the kernel. If it is not available, dbus-daemon will start but AppArmor mediation will not occur. In "disabled" mode, AppArmor mediation is disabled. In "required" mode, AppArmor mediation will be enabled if AppArmor support is available, otherwise dbus-daemon will refuse to start.
I think that is okay as a default or am I wrong here?
There was a problem hiding this comment.
Interesting, we should for sure put that in the commit and code with some sort of link to the docs.
If we choose the default enabled, it will be the easiest for apparmor and non-apparmor users. If the support is in the kernel then it's on, which means that apparmor users don't have to switch a dbus option in configuration.nix. However, I don't see the apparmor module putting support into the kernel, from this line it shows me that the kernel already has it and just needs a kernel parameter https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/security/apparmor.nix#L32. I would think that apparmor support in the kernel would also implicate checking for that kernel parameter (along with other things), but I would like to at least check the startup is "as expected" without the apparmor module enabled.
There was a problem hiding this comment.
I added some docs to the option.
I don't think linking to external docs is really helpful since you can either use the AppArmor GitLab which seems to be neither complete nor seems the link to be stable or you can use the dbus man page that doesn't allow direct linking to that list item since it's not a heading.
7bc410f to
218700c
Compare
218700c to
3a4f2b5
Compare
|
Rebased to staging since this seems to be a mass rebuild when it evaluates |
|
@worldofpeace Properly rebased (I hope?) |
760e978 to
e5e9887
Compare
|
Took some time since I had to rebuild stdenv, but I successfully built this on macOS |
Thanks alot. I've merged the PR ✨ |
Motivation for this change
I'd like to do AppArmor mediation on dbus.
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)