~ubuntu-branches/ubuntu/wily/apparmor/wily

« back to all changes in this revision

Viewing changes to parser/apparmor_parser.pod

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2011-04-27 10:38:07 UTC
  • mfrom: (5.1.118 natty)
  • Revision ID: james.westby@ubuntu.com-20110427103807-ym3rhwys6o84ith0
Tags: 2.6.1-2
debian/copyright: clarify for some full organization names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# ----------------------------------------------------------------------
 
2
#    Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
 
3
#                  2008, 2009
 
4
#    NOVELL (All rights reserved)
 
5
#
 
6
#    Copyright (c) 2010
 
7
#    Canonical Ltd. (All rights reserved)
 
8
#
 
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.
 
12
#
 
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.
 
17
#
 
18
#    You should have received a copy of the GNU General Public License
 
19
#    along with this program; if not, contact Novell, Inc.
 
20
# ----------------------------------------------------------------------
 
21
 
 
22
 
 
23
=pod
 
24
 
 
25
=head1 NAME
 
26
 
 
27
apparmor_parser - loads AppArmor profiles into the kernel
 
28
 
 
29
=head1 SYNOPSIS
 
30
 
 
31
B<apparmor_parser [-adrR] [--add] [--debug]  [--replace] [--remove]
 
32
                  [--preprocess] [--Include n] [--base n] [ --Complain ]>
 
33
 
 
34
B<apparmor_parser [-hv] [--help] [--version]>
 
35
 
 
36
=head1 DESCRIPTION
 
37
 
 
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.
 
41
 
 
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).
 
45
 
 
46
=head1 OPTIONS
 
47
 
 
48
=over 4
 
49
 
 
50
=item -a, --add
 
51
 
 
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.
 
56
 
 
57
=item -r, --replace
 
58
 
 
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.
 
62
 
 
63
=item -R, --remove
 
64
 
 
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
 
68
used.
 
69
 
 
70
=item -C, --Complain
 
71
 
 
72
For the profile to load in complain mode.
 
73
 
 
74
=item -B, --binary
 
75
 
 
76
Load a binary (cached) profile, as produced with the -S option.
 
77
 
 
78
=item -N, --names
 
79
 
 
80
Produce a list of policies from a given set of profiles (implies -K).
 
81
 
 
82
=item -S, --stdout
 
83
 
 
84
Writes a binary (cached) profile to stdout (implies -K and -T).
 
85
 
 
86
=item -o file, --ofile file
 
87
 
 
88
Writes a binary (cached) profile to the specified file (implies -K and -T)
 
89
 
 
90
=item -b n, --base n
 
91
 
 
92
Set the base directory for resolving #include directives
 
93
defined as relative paths.
 
94
 
 
95
=item -I n, --Include n
 
96
 
 
97
Add element n to the search path when resolving #include directives
 
98
defined as an absolute paths.
 
99
 
 
100
=item -f n, --subdomainfs n
 
101
 
 
102
Set the location of the apparmor security filesystem (default is
 
103
"/sys/kernel/security/apparmor").
 
104
 
 
105
=item -m n, --match-string n
 
106
 
 
107
Only use match features "n".
 
108
 
 
109
=item -n n, --namespace-string n
 
110
 
 
111
Force a profile to load in the namespace "n".
 
112
 
 
113
=item -X, --readimpliesX
 
114
 
 
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".
 
118
 
 
119
=item -k, --show-cache
 
120
 
 
121
Report the cache processing (hit/miss details) when loading or saving
 
122
cached profiles.
 
123
 
 
124
=item -K, --skip-cache
 
125
 
 
126
Perform no caching at all: disables -W, implies -T.
 
127
 
 
128
=item -T, --skip-read-cache
 
129
 
 
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.
 
133
 
 
134
=item -W, --write-cache
 
135
 
 
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.
 
140
 
 
141
=item -Q, --skip-kernel-load
 
142
 
 
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.
 
146
 
 
147
=item -q, --quiet
 
148
 
 
149
Do not report on the profiles as they are loaded, and not show warnings.
 
150
 
 
151
=item -v, --verbose
 
152
 
 
153
Report on the profiles as they are loaded, and show warnings.
 
154
 
 
155
=item -V, --version
 
156
 
 
157
Print the version number and exit.
 
158
 
 
159
=item -p, --preprocess
 
160
 
 
161
Dump the input profile to stdout out applying preprocessing flattening
 
162
includes into the output profile.
 
163
 
 
164
=item -d, --debug
 
165
 
 
166
Given once, only checks the profiles to ensure syntactic correctness.
 
167
Given twice, dumps its interpretation of the profile for checking.
 
168
 
 
169
=item -D n, --dump=n
 
170
 
 
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.
 
175
 
 
176
  apparmor_parser --dump=dfa-stats --dump=trans-stats <file>
 
177
 
 
178
Use --help=dump to see a full list of which dump flags are supported
 
179
 
 
180
=item -O n, --optimize=n
 
181
 
 
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).
 
188
 
 
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
 
191
of time to complete.
 
192
 
 
193
Use --help=optimize to see a full list of which optimization flags are
 
194
supported.
 
195
 
 
196
=item -h, --help
 
197
 
 
198
Give a quick reference guide.
 
199
 
 
200
=back
 
201
 
 
202
=head1 BUGS
 
203
 
 
204
If you find any bugs, please report them at
 
205
L<http://https://bugs.launchpad.net/apparmor/+filebug>.
 
206
 
 
207
=head1 SEE ALSO
 
208
 
 
209
apparmor(7), apparmor.d(5), subdomain.conf(5), aa_change_hat(2), and
 
210
L<http://wiki.apparmor.net>.
 
211
 
 
212
=cut