-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Split the profiles in multiple packages. #464
Comments
I had thought about grouping and selecting profiles on package compilation, by your approach is better.
I disagree on this. Mandatory part of the package (tunables and abstractions) needs to be decoupled from highly prone to system failure systemd* profiles. I'm thinking about the following groups, based on coupling, chance of system failure and potential attack surface:
Also, the project needs a profile deprecation mechanism. When user first installs it, he expects that listed packages will provide confinement, but on the following update certain profiles could silently disappear and protection will be gone. User needs to be explicitly notified.
Just additional comment in the header of a profile? |
Most systemd profile are stable. Only a very few one are prone to failure or are too young to be considered as stable. It means that the profile selection should consider both the package group and some individual inclusion, for example to ship the full In general the main objectives are too:
Do you have example of profile?
I don't want to ship profile for GUI program on server, therefore, I think we should spilt them. Thus, the profiles for UI app can depends on
I do agree. This is something I purposely did not work on yet thank to the |
They sure are, but only under current version of the system, but under rolling release distro this profile group becomes brittle. Users who seek only protection of the browsers should not be forced to deal with such issues. Decoupled userland/browsers profiles could work almost anywhere, contrary to coupled core version which will work only under supported distros. If systemd/core apps are mandatory for protecting browsers - far less people will use the project.
avahi-autoipd?, openvpn, mullvad-daemon, containerd?, dockerd?, sshd, gnome-remote-desktop-daemon, goa-daemon, exim4, dnscrypt-proxy, dleyna-server-service, syncthing, ssserver, qbittorrent, rustdesk, murmurd; maybe more.
Some programs falls under multiple groups:
Maybe we should tag and treat the profiles accordingly. |
You have a good point here. Then we also need a
Yes, there is a bit of sorting and classification to do. It is possibly the biggest task here. We need to end up with a few configuration files in |
I haven't completely made up my mind yet about this proposed change but here are some thoughts.
But what are the exact advantages? Sure,
As already mentioned by @nobody43 the 100% stability cannot be guaranteed for rolling distros anyhow. The recent changes for mesa are an example for this. That said, I think that |
I think that it would be a good idea to replace the current apparmor.d package with a CLI/TUI utility for managing profiles instead:
Tagged groups for networked profiles that most people want enabled, and a group for core system profiles that some people would rather disable would IMO be a good way to start. |
https://github.com/jack-ullery/AppAnvil |
I'm not sure how this is supposed to work as all individual changes would be overwritten by the next update.
Above problem would also apply here. |
@curiosityseeker my proposal would avoid this as a configuration file for the apparmor tool should be kept locally (in e.g. ~/.config/apparmor.d/custom.flags) and the build process should source user changes from said file. The build and install process of the profiles should be automated by the proposed tool and no longer directly managed by the PKGBUILD or other distro package themselves. The package should only download this configuration utility. |
I see, thanks. I guess that would work if it comes to flags. But this is not a solution for other customizations. |
The user can always boot from a live medium and switch the offending profiles to the complain mode. Booting from a live medium is a skill obligatory for every advanced computer user. I'm afraid that at this stage of program-level (as opposed to user-level) security in Linux, almost anything can break the system. Actually, if you can't edit profiles yourself, you aren't ready for it. |
If AppArmor becomes slow because it deals with many profiles, than the right solution is to install profiles automatically when OS program packages are installed. This requires integration with package managers. |
Current stage of implementation is available of #578. For now, it is only a WIP, some internal check still is missing. Also, all profile from core and base should have integration tests, therefore #583 is a requirement
Rolling distro are by construction always in beta stage yes. However:
Absolutely no: Security policies are to be managed by system admin and system vendor. Not by user. System admin and vendor (the distribution) do it by deploying the full policies in a declarative way such as:
Any other option pose a risk:
However With the new condition feature coming in apparmor, I plan to add a Similarly, apparmor will soon support rule priority that will enable some more advanced overwrite.
Apparmor is an internal part of the security of an Linux distribution. Ideally the end user should not have to know that apparmor is a thing and is installed. The full apparmor.d should be able to run perfectly on any (compatible) distribution setup. This is clearly the goal of this project and the target to achieve before releasing a Meanwhile, apparmor can also be used for more advanced security configuration and should provide all required tooling (aa-log, aa-config...) for it (cf FSP). |
Sorry but I do not understand.. you mean that the end user with root/wheel privileges should not be able to install or configure apparmor profiles? I understand that you want pre-baked packages that distributions can adopt by default and I can see how it makes sense for distros, but I don't see how having such a tool would pose a security risk.
By trusting the repository, TLS, maybe PGP?
What do you mean by this? |
They can install (with a pm) and configure (not manually), however, your proposal was to fully give control to a wheel user to handle all profiles (while we currently give this power to the distribution). It may raise security issue yes but it can also become a maintenance hell:
My position is that setting security policies is one of the most privileged task a Linux system can do (and the most effective way to break your system if not done correctly). The It also needs to be fully declarative to comply with modern server/desktop management method (so no UI by default).
In short, let your favourite package manager verify the authenticity of your apparmor profiles. Local admin addition can be set, however, they should be minimal (they can also be signed see systemd configuration extension)
It is easy to mess up your own |
This issue aims to be an open discussion about possible reorganization of how the profiles are shipped.
The current apparmor.d package ships a lot of profiles. Depending on the target system, they are not always needed or not always stable. It can be an issue for new user as they can be legitimately afraid of breaking their system even if over 90% of the profiles are safe to use.
The idea is to split the profiles in multiple packages. The project itself would remain a mono repository with all the profiles in it, as it make it easier to develop and maintain them.
Possible packages
apparmor.d.base
Minimal core with tunables, abstractions, and dependencies of other profiles such that one can use this package if they only want to confine a given profile such as a server app, a GUI app without having to confine the rest of the system.
Possible issues: dbus may not be part of
base
and peer_label should be handled accordingly.apparmor.d.core
Profiles for program installed by default and common to all desktops and servers. Eg:
All profile in core should be safe to be enforced by default (they may be a few exceptions such as udevd).
apparmor.d.desktop
Base desktop, also useful for unsupported DE. Equivalent of the following groups:
freedesktop
gvfs
apparmor.d.gnome
,apparmor.d.kde
,apparmor.d.xfce
Desktop specific package. Should conflict with each other. DE specific configuration (in gnome) may require us to have a conflict with
apparmor.d.desktop
too.apparmor.d.browsers
All profiles related to browsers.
apparmor.d.app
Profiles related to UI applications. Could be split in multiple sub-packages.
Ideally, this package should only have
base
as strict dependency. However, it may lead to issue.apparmor.d.full
Like the current
apparmor.d
Advantages
Disadvantages
The text was updated successfully, but these errors were encountered: