Full system policy profile - Question #233
Replies: 3 comments 5 replies
-
There is no full system policy (yet). The However, yes, the very experimental
Full support for Whonix is planned. Actually, there is already some structure to support Whonix, see for example: https://github.com/roddhjav/apparmor.d/blob/38648bcba1798ef9aeec13ee7fb93a1fe561ecd0/pkg/prebuild/tools.go#L17C2-L17C16. However, again, this is a WIP. The reason why all of this is still a WIP (and why it will stay like this for a while) is because of no new privileges restriction as apparmor prevents transition to profile with more privileges. They have been some work to allow a given profile with more privileges however, this is not supported by apparmor yet. Systemd is mostly starting other program with more privileges hence this limitation that is raised quickly. See: apparmor.d/apparmor.d/groups/_full/systemd Lines 54 to 57 in 38648bc If you restrict Kicksecure's apparmor-profile-everything you will at some point reach this limitation. However, it should be possible to restrict it quite a bit by leveraging current profile. But again, I have some time constrain. |
Beta Was this translation helpful? Give feedback.
-
I would be willing to work on something like this. But first thing this package is not the easiest to debug. There is the known issue that startup in gnome takes forever with this package. This is also true even if everything is in complain. I have tested for the purpose of maybe implementing a full system policy down the line, only the profiles in the group systemd. They were all in enforcing mode and there was no delay. Added upon them all the profiles in group apt, and the boot is still ok. And by the way, these are all in enforcing modes. So the most critical profiles for me are all perfect. Some profile somewhere slows downs the startup even when in complain mode. First this should be found. But my other suspicion is that, in fact, no profile is responsible for this delay, but rather the fact that we are loading up 1500 profiles every time. I wanted to test this by disabling some of the profiles but this is also not a piece of cake because of the hook. There needs to be an easier way to disable the hook on startup to reload every profile even if I disable them manually. Because I want to say: I would be interesting in only a number of the profiles here. All systemd, all root processes and internet facing daemons and all suid binaries. Literally by having only these profiles, a quasi strict everything profile can be written for init. |
Beta Was this translation helpful? Give feedback.
-
I would really appreciate your help, if you could explain some little things. I am going to fork this repository to make a full system policy. I won't be able to merge this to your project because it is certainly against your first rule. The full system policy is going to be really slack, in most senses. I will enforce this policy with everything. If the user installs a custom binary or compiles one in some random path, that should work out of the box. My only concern is that this full system policy will prevent changing the mac policy or apparmor profiles. It will also manually deny some sensitive stuff that might be used to circumvent the policy on other binaries. It will also not have most of the capabilities, to prevent privilege escalation. Any guide on full system policy explains creating only one profile. For the path |
Beta Was this translation helpful? Give feedback.
-
The full system policy seems to be not allowing anything ever unless a profile is present. I know the development of this projecty aims not to allow everything (or a large area) and blacklist some sub areas. Does this also apply to the full system profile? So, is this intentional?
With the profiles you have available for daemons and services with high privileges, Kicksecure's apparmor-profile-everything can be wastly further restricted and be used as a full policy that wouldn't require a profile for everything to run. Licenses are compatible. Is this of interest, or is it out of the scope of this project?
Beta Was this translation helpful? Give feedback.
All reactions