This issue is the follow-up of #464, the final solution is going to be quite different to the original proposal. Fell free to comment the current proposal
The problems
- They are too many profiles, most are only useful in specific setup
- At this scale, the compilation of apparmor profiles is slow and heavily RAM hungry.
- Files in /etc/apparmor.d get replaced by package updates, thus any user modification is lost.
- For admin/user, it is hard to select the profiles they want to install
Solution proposed in #464
The original solution was to split the profiles in various editions: all packages would conflict with each other.
- Default:
apparmor.d, apparmor.d.enforced
- Server:
apparmor.d.server, apparmor.d.server.enforced
- FSP:
apparmor.d.server.fsp, apparmor.d.server.fsp.enforced
However, it is not enough, we may as well provides packages for each supported DE, furthermore we also have some very specific development edition: test (for autopkgtest) and debug (to generate a tree of visited profiles in FSP mode). Then, we also add some core packages such as apparmor.d.base (abstraction, tunables) and apparmor.d.tools (for aa-log such as actual profiles packages are not architecture dependent)
As this is getting out of hand, we need a better solution.
Unified package solution
There is going to be only three packages:
apparmor.d-tools: for apparmor.d tools such as aa-log, aa-config and aa-install
apparmor.d-base: for abstractions, and tunables. Installed in /etc/apparmor.d/
apparmor.d: for all prebuilt profiles, installed in /usr/lib/apparmor.d/
Upon installation of apparmor.d, and after each install of a new program, a trigger/hook ( aa-install) will:
- Install the profiles only for programs that are present on the system
- Apply any configuration needed (such as complain/enforce mode, FSP mode...). This configuration is provided by:
- A general parameter in
/etc/apparmor/install.yml to select the main mode: enforce/complain
- Per profile configuration can also be provided in
/etc/apparmor/install.d/ as yaml files.
- Other flags can also be provided (such as
attached_disconnected, mediate_delete)
- Some profiles can be explicitly installed or ignored by providing a list of profiles to install in
/etc/apparmor/install.yml
- Default configuration is also shipped by the package under
/usr/lib/apparmor/install.d/
Configuration is for now limited to what profiles in which mode, another tools (aa-config), will later be added to adjust other parameters (such as security model targeted, common paths, boolean...). See #969
This issue is the follow-up of #464, the final solution is going to be quite different to the original proposal. Fell free to comment the current proposal
The problems
Solution proposed in #464
The original solution was to split the profiles in various editions: all packages would conflict with each other.
apparmor.d,apparmor.d.enforcedapparmor.d.server,apparmor.d.server.enforcedapparmor.d.server.fsp,apparmor.d.server.fsp.enforcedHowever, it is not enough, we may as well provides packages for each supported DE, furthermore we also have some very specific development edition:
test(for autopkgtest) anddebug(to generate a tree of visited profiles in FSP mode). Then, we also add some core packages such asapparmor.d.base(abstraction, tunables) andapparmor.d.tools(for aa-log such as actual profiles packages are not architecture dependent)As this is getting out of hand, we need a better solution.
Unified package solution
There is going to be only three packages:
apparmor.d-tools: for apparmor.d tools such asaa-log,aa-configandaa-installapparmor.d-base: for abstractions, and tunables. Installed in/etc/apparmor.d/apparmor.d: for all prebuilt profiles, installed in/usr/lib/apparmor.d/Upon installation of
apparmor.d, and after each install of a new program, a trigger/hook (aa-install) will:/etc/apparmor/install.ymlto select the main mode: enforce/complain/etc/apparmor/install.d/as yaml files.attached_disconnected,mediate_delete)/etc/apparmor/install.yml/usr/lib/apparmor/install.d/Configuration is for now limited to what profiles in which mode, another tools (aa-config), will later be added to adjust other parameters (such as security model targeted, common paths, boolean...). See #969