1
# ----------------------------------------------------------------------
2
# Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
4
# NOVELL (All rights reserved)
7
# Canonical Ltd. (All rights reserved)
9
# This program is free software; you can redistribute it and/or
10
# modify it under the terms of version 2 of the GNU General Public
11
# License published by the Free Software Foundation.
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with this program; if not, contact Novell, Inc.
20
# ----------------------------------------------------------------------
27
apparmor_parser - loads AppArmor profiles into the kernel
31
B<apparmor_parser [-adrR] [--add] [--debug] [--replace] [--remove]
32
[--preprocess] [--Include n] [--base n] [ --Complain ]>
34
B<apparmor_parser [-hv] [--help] [--version]>
38
B<apparmor_parser> is used to import new apparmor.d(5) profiles
39
into the Linux kernel. The profiles restrict the operations available
40
to processes by executable name.
42
The profiles are loaded into the Linux kernel by the B<apparmor_parser>
43
program, which takes its input from standard input. The input supplied to
44
B<apparmor_parser> should be in the format described in apparmor.d(5).
52
Insert the AppArmor definitions given into the kernel. This is the default
53
action. This gives an error message if a AppArmor definition by the same
54
name already exists in the kernel, or if the parser doesn't understand
55
its input. It reports when an addition succeeded.
59
This flag is required if an AppArmor definition by the same name already
60
exists in the kernel; used to replace the definition already
61
in the kernel with the definition given on standard input.
65
This flag is used to remove an AppArmor definition already in the kernel.
66
Note that it still requires a complete AppArmor definition as described
67
in apparmor.d(5) even though the contents of the definition aren't
72
For the profile to load in complain mode.
76
Load a binary (cached) profile, as produced with the -S option.
80
Produce a list of policies from a given set of profiles (implies -K).
84
Writes a binary (cached) profile to stdout (implies -K and -T).
86
=item -o file, --ofile file
88
Writes a binary (cached) profile to the specified file (implies -K and -T)
92
Set the base directory for resolving #include directives
93
defined as relative paths.
95
=item -I n, --Include n
97
Add element n to the search path when resolving #include directives
98
defined as an absolute paths.
100
=item -f n, --subdomainfs n
102
Set the location of the apparmor security filesystem (default is
103
"/sys/kernel/security/apparmor").
105
=item -m n, --match-string n
107
Only use match features "n".
109
=item -n n, --namespace-string n
111
Force a profile to load in the namespace "n".
113
=item -X, --readimpliesX
115
In the case of profiles that are loading on systems were READ_IMPLIES_EXEC
116
is set in the kernel for a given process, load the profile so that any "r"
117
flags are processed as "mr".
119
=item -k, --show-cache
121
Report the cache processing (hit/miss details) when loading or saving
124
=item -K, --skip-cache
126
Perform no caching at all: disables -W, implies -T.
128
=item -T, --skip-read-cache
130
By default, if a profile's cache is found in /etc/apparmor.d/cache/ and
131
the timestamp is newer than the profile, it will be loaded from the cache.
132
This option disables this cache loading behavior.
134
=item -W, --write-cache
136
Write out cached profiles to /etc/apparmor.d/cache/. Off by default.
137
In cases where abstractions have been changed, and the parser is running
138
with "--replace", it may make sense to also use "--skip-read-cache" with
139
the "--write-cache" option.
141
=item -Q, --skip-kernel-load
143
Perform all actions except the actual loading of a profile into the kernel.
144
This is useful for testing profile generation, caching, etc, without making
145
changes to the running kernel profiles.
149
Do not report on the profiles as they are loaded, and not show warnings.
153
Report on the profiles as they are loaded, and show warnings.
157
Print the version number and exit.
159
=item -p, --preprocess
161
Dump the input profile to stdout out applying preprocessing flattening
162
includes into the output profile.
166
Given once, only checks the profiles to ensure syntactic correctness.
167
Given twice, dumps its interpretation of the profile for checking.
171
Debug flag for dumping various structures and passes of policy compilation.
172
A single dump flag can be specified per --dump option, but the dump flag
173
can be passed multiple times. Note progress flags tend to also imply
174
the matching stats flag.
176
apparmor_parser --dump=dfa-stats --dump=trans-stats <file>
178
Use --help=dump to see a full list of which dump flags are supported
180
=item -O n, --optimize=n
182
Set the optimization flags used by policy compilation. A sinlge optimization
183
flag can be toggled per -O option, but the optimize flag can be passed
184
multiple times. Turning off some phases of the optimization can make
185
it so that policy can't complete compilation due to size constraints
186
(it is entirely possible to create a dfa with millions of states that will
187
take days or longer to compile).
189
Note: The parser is set to use a balanced default set of flags, that
190
will result in resonable compression but not take excessive amounts
193
Use --help=optimize to see a full list of which optimization flags are
198
Give a quick reference guide.
204
If you find any bugs, please report them at
205
L<http://https://bugs.launchpad.net/apparmor/+filebug>.
209
apparmor(7), apparmor.d(5), subdomain.conf(5), aa_change_hat(2), and
210
L<http://wiki.apparmor.net>.