Check profiles in /etc/apparmor.d
In the previous step, you saw a list of loaded AppArmor profiles using aa-status
. Now, let's explore where these profiles are stored on the file system.
AppArmor profiles are typically located in the /etc/apparmor.d/
directory. This directory contains the profile files, which are plain text files defining the rules for each confined application.
To list the contents of this directory, use the ls
command:
ls /etc/apparmor.d/
You will see a list of files and directories. Each file in this directory (that is not in a subdirectory like abstractions
or tunables
) usually represents a specific AppArmor profile for an application.
Example output:
bootchartd usr.sbin.tcpdump
...
These filenames often correspond to the path of the executable they are designed to confine. For example, usr.sbin.tcpdump
is the profile for the /usr/sbin/tcpdump
command.
You can view the content of a profile file using a text editor like nano
. Let's look at the profile for usr.sbin.tcpdump
. Type the following command:
nano /etc/apparmor.d/usr.sbin.tcpdump
This will open the profile file in the nano
editor. You will see lines defining file access rules, network permissions, and other restrictions. Don't worry about understanding every line right now; the goal is just to see the structure of a profile file.
To exit nano
, press Ctrl + X
. If you made any changes, it will ask if you want to save. Press N
for No, then Enter
to confirm.
Exploring the files in /etc/apparmor.d/
gives you insight into the specific security policies applied to different applications on your system.
Click Continue to move on.