All AppArmor Profiles are in enforce or complain mode
An XCCDF Rule
Description
AppArmor profiles define what resources applications are able to access. To set all profiles to eitherenforce
or complain
mode
run the following command to set all profiles to enforce
mode:
$ sudo aa-enforce /etc/apparmor.d/*run the following command to set all profiles to
complain
mode:
$ sudo aa-complain /etc/apparmor.d/*To list unconfined processes run the following command:
$ sudo aa-unconfinedAny unconfined processes may need to have a profile created or activated for them and then be restarted.
Rationale
Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This recommendation is intended to ensure that any policies that exist on the system are activated.
- ID
- xccdf_org.ssgproject.content_rule_all_apparmor_profiles_in_enforce_complain_mode
- Severity
- Medium
- References
- Updated
Remediation Templates
An Ansible Snippet
- name: Gather the package facts
package_facts:
manager: auto
tags:
- CCE-92356-5
- all_apparmor_profiles_in_enforce_complain_mode
A Shell Script
# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ] && { rpm --quiet -q apparmor-profiles; }; then
var_apparmor_mode='<xccdf-1.2:sub xmlns:xccdf-1.2="http://checklists.nist.gov/xccdf/1.2" idref="xccdf_org.ssgproject.content_value_var_apparmor_mode" use="legacy"/>'
# make sure apparmor-utils is installed for aa-complain and aa-enforce