Load AppArmor profiles in complain/enforce mode

AppArmor profiles can be in one of two modes: complain mode or enforce mode.

In complain mode - the system does not enforce any rules and profile violations are accepted with logs.

To be able to load the profiles - first install apparmor-utils package.

Run the following command to set profile to complain mode:

aa-complain /etc/apparmor.d/profile1
Run the following command to set profile to enforce mode:
aa-enforce  /etc/apparmor.d/profile2
Run the following command to set the execution mode of all profiles in complain mode:
aa-complain /etc/apparmor.d/*
Run the following command to set the execution mode of all profiles in enforce mode:
aa-enforce /etc/apparmor.d/*