OS Manuals

/usr/bin/apparmor_parser

From apparmor-parser 5.0.2-r3 (enterprise-packages), captured 2026-11-08 by running apparmor_parser --help (exit 0). permalink

AppArmor parser version 5.0.2
Copyright (C) 1999-2008 Novell Inc.
Copyright 2009-2018 Canonical Ltd.

Usage: /usr/bin/apparmor_parser [options] [profile]

Options:
--------
-a, --add		Add apparmor definitions [default]
-r, --replace		Replace apparmor definitions
-R, --remove		Remove apparmor definitions
-C, --Complain		Force the profile into complain mode
-B, --binary		Input is precompiled profile
-N, --names		Dump names of profiles in input.
-S, --stdout		Dump compiled profile to stdout
-o n, --ofile n		Write output to file n
-b n, --base n		Set base dir and cwd
-I n, --Include n	Add n to the search path
-f n, --subdomainfs n	Set location of apparmor filesystem
-m n, --match-string n  Use only features n
-M n, --features-file n Set compile & kernel features to file n
--policy-features n     Policy features set in file n
--override-policy-abi n     As policy-features but override ABI rules
--kernel-features n     Kernel features set in file n
-n n, --namespace n	Set Namespace for the profile
-X, --readimpliesX	Map profile read permissions to mr
-k, --show-cache	Report cache hit/miss details
-K, --skip-cache	Do not attempt to load or save cached profiles
-T, --skip-read-cache	Do not attempt to load cached profiles
-W, --write-cache	Save cached profile (force with -T)
    --skip-bad-cache	Don't clear cache if out of sync
    --purge-cache	Clear cache regardless of its state
    --debug-cache       Debug cache file checks
    --print-cache-dir	Print the cache directory path
-L, --cache-loc n	Set the location of the profile caches
-q, --quiet		Don't emit warnings
-v, --verbose		Show profile names as they load
-Q, --skip-kernel-load	Do everything except loading into kernel
-V, --version		Display version info and exit
-d [n], --debug 	Debug apparmor definitions OR [n]
-p, --preprocess	Dump preprocessed profile
-D [n], --dump		Dump internal info for debugging
-O [n], --Optimize	Control dfa optimizations
-h [cmd], --help[=cmd]  Display this text or info about cmd
-j n, --jobs n		Set the number of compile threads
-c[n], --zstd-compress-level[=n]    Compress profile at level n
                                    n can be: none, default, fast, small, or 0-22
                                    (0 disables compression, default: 10)
--max-jobs n		Hard cap on --jobs. Default 8*cpus
--abort-on-error	Abort processing of profiles on first error
--skip-bad-cache-rebuild Do not try rebuilding the cache if it is rejected by the kernel
--config-file n		Specify the parser config file location, processed early before other options.
--print-config		Print config file location
--warn n		Enable warnings (see --help=warn)
--Werror [n]		Convert warnings to errors. If n is specified turn warn n into an error
Options (45)
OptionDescriptionSource
-a, --addAdd apparmor definitions [default]help
-r, --replaceReplace apparmor definitionshelp
-R, --removeRemove apparmor definitionshelp
-C, --ComplainForce the profile to load in complain mode.help + man
-B, --binaryTreat the profile files specified on the command line (or stdin if none specified) as binary cache files, produced with the -S or -o options, and load to the kernel as specified by -a, -r, and -R…help + man
-N, --namesDump names of profiles in input.help
-S, --stdoutDump compiled profile to stdouthelp
-o, --ofile nWrite output to file nhelp
-b, --base nSet the base directory for resolving #include directives defined as relative paths.help + man
-I, --Include nAdd element n to the search path when resolving #include directives defined as an absolute paths.help + man
-f, --subdomainfs, --apparmorfs nSet the location of the apparmor security filesystem (default is "/sys/kernel/security/apparmor").help + man
-m, --match-string nOnly use match features "n".help + man
--policy-features nSpecify the feature set that the policy was developed under.help + man
--override-policy-abi nSpecify the feature set that the policy was developed under and override any feature ABI rules that the policy may be using.help + man
--kernel-features nSpecify the feature set of the kernel that the policy is being compiled for.help + man
-n, --namespace, --namespace-string nForce a profile to load in the namespace "n".help + man
-X, --readimpliesXIn the case of profiles that are loading on systems were READ_IMPLIES_EXEC is set in the kernel for a given process, load the profile so that any "r" flags are processed as "mr".help + man
-k, --show-cacheReport the cache processing (hit/miss details) when loading or saving cached profiles.help + man
-K, --skip-cachePerform no caching at all: disables -W, implies -T.help + man
-T, --skip-read-cacheBy default, if a profile's cache is found in the location specified by --cache-loc and the timestamp is newer than the profile, it will be loaded from the cache.help + man
-W, --write-cacheWrite out cached profiles to the location specified in --cache-loc.help + man
--skip-bad-cacheSkip updating the cache if it contains cached profiles in a bad or inconsistent statehelp + man
--purge-cacheClear cache regardless of its statehelp
--debug-cacheDebug cache file checkshelp
--print-cache-dirPrint the cache directory location.help + man
-L, --cache-loc nSet the location(s) of the cache directory.help + man
-q, --quietDo not report on the profiles as they are loaded, and not show warnings.help + man
-v, --verboseReport on the profiles as they are loaded, and show warnings.help + man
-Q, --skip-kernel-loadPerform all actions except the actual loading of a profile into the kernel.help + man
-V, --versionDisplay version info and exithelp
-d, --debug nGiven once, only checks the profiles to ensure syntactic correctness.help + man
-p, --preprocessDump preprocessed profilehelp
-D, --dump nDebug flag for dumping various structures and passes of policy compilation.help + man
-O, --Optimize, --optimize nSet the optimization flags used by policy compilation.help + man
-h, --help cmdDisplay this text or info about cmdhelp
-j, --jobs nSet the number of jobs used to compile the specified policy.help + man
-c, --zstd-compress-level nCompress profile at level n n can be: none, default, fast, small, or 0-22 (0 disables compression, default: 10)help
--max-jobs nWhen --jobs is set to a scaling value (ie.help + man
--abort-on-errorAbort processing of profiles on first errorhelp
--config-file nSpecify the parser config file location, processed early before other options.help + man
--print-configPrint config file locationhelp
--warn nEnable various warnings during policy compilation.help + man
--Werror nConvert warnings to errors.help
-M, --features-file nUse the features file located at path "n" (default is /etc/apparmor.d/cache/.features). (in the manual page but not in --help)man
--print-config-filePrint the config file location that will be used. (in the manual page but not in --help)man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.