info > APPARMOR_PARSER

APPARMOR_PARSER(8) AppArmor APPARMOR_PARSER(8)

🏷️ NAME

apparmor_parser — loads AppArmor profiles into the kernel

🚀 Quick Reference

Use Case Command Description
Load a profile apparmor_parser --add profile Insert a new AppArmor profile into the kernel
Replace an existing profile apparmor_parser --replace profile Replace an existing profile definition
Remove a profile apparmor_parser --remove profile Remove a profile from the kernel
Load all profiles from a directory apparmor_parser --add /etc/apparmor.d Load all profiles from the standard directory
Compile profile to stdout (binary cache) apparmor_parser --stdout profile Write binary cache to stdout, useful for inspection
Force complain mode apparmor_parser --Complain profile Load profile in complain (audit-only) mode
Check syntax only apparmor_parser --debug profile Check for syntax errors without loading
Show version apparmor_parser --version Print version and exit
Help apparmor_parser --help Show quick reference guide
Purge cache apparmor_parser --purge-cache Clear all cached profiles

📝 SYNOPSIS

apparmor_parser [options] <command> [profiles]...
apparmor_parser [options] <command>
apparmor_parser [-hv] [--help] [--version]

📖 DESCRIPTION

apparmor_parser is used as a general tool to compile, and manage AppArmor policy, including loading new apparmor.d(5) profiles into the Linux kernel.

AppArmor profiles restrict the operations available to processes.

The profiles are loaded into the Linux kernel by the apparmor_parser program. The profiles may be specified by file name or a directory name containing a set of profiles. If a directory is specified then the apparmor_parser will try to do a profile load for each file in the directory that is not a dot file, or explicitly black listed (*.dpkg-new, *.dpkg-old, *.dpkg-dist, *.dpkg-bak, *.dpkg-remove, *.pacsave, *.pacnew, *.rpmnew, *.rpmsave, *.orig, *.rej, *~). The apparmor_parser will fall back to taking input from standard input if a profile or directory is not supplied.

The input supplied to apparmor_parser should be in the format described in apparmor.d(5).

🎮 COMMANDS

The command set is broken into four subcategories.

🔓 Unprivileged commands

🔓 Unprivileged profile commands

🔒 Privileged commands

🔒 Privileged profile commands

⚙️ OPTIONS

📂 CONFIG FILE

An optional config file /etc/apparmor/parser.conf can be used to specify the default options for the parser, which then can be overridden using the command line options.

The config file ignores leading whitespace and treats lines that begin with # as comments. Config options are specified one per line using the same format as the longform command line options (without the preceding --).

Example:

#comment

optimize=no-expr-tree
optimize=compress-fast

As with the command line some options accumulate and others override, ie. when there are conflicting versions of switch the last option is the one chosen.

Example:

Optimize=no-minimize
Optimize=minimize

would result in Optimize=minimize being set.

The Include, Dump, and Optimize options accumulate except for the inversion option (no-X vs. X), and a couple options that work by setting/clearing multiple options (compress-small). In that case the option will override the flags it sets but may accumulate with others. All other options override previously set values.

🐛 BUGS

If you find any bugs, please report them at https://gitlab.com/apparmor/apparmor/-/issues.

🔗 SEE ALSO

apparmor(7), apparmor.d(5), aa_change_hat(2), and https://wiki.apparmor.net.

AppArmor 3.0.4 2025-08-15 APPARMOR_PARSER(8)

APPARMOR_PARSER
🏷️ NAME 🚀 Quick Reference 📝 SYNOPSIS 📖 DESCRIPTION 🎮 COMMANDS
🔓 Unprivileged commands 🔓 Unprivileged profile commands 🔒 Privileged commands 🔒 Privileged profile commands
⚙️ OPTIONS 📂 CONFIG FILE 🐛 BUGS 🔗 SEE ALSO

Generated by phpman v4.9.26-1-g511901d Author: Che Dong Under GNU General Public License
2026-08-09 10:19 @2600:1f28:365:80b0:50b3:453e:ff52:20f7
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format