Skip to content

unified packages and post install #986

Description

@roddhjav

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions