~ubuntu-branches/ubuntu/precise/apparmor/precise-security

« back to all changes in this revision

Viewing changes to parser/apparmor.pod

  • Committer: Package Import Robot
  • Author(s): Steve Beattie, Jamie Strandboge, Serge Hallyn, Steve Beattie
  • Date: 2012-04-12 06:17:42 UTC
  • Revision ID: package-import@ubuntu.com-20120412061742-9v75hjko2mjtbewv
Tags: 2.7.102-0ubuntu3
[ Jamie Strandboge ]
* debian/patches/0007-ubuntu-manpage-updates.patch: update apparmor(5)
  to describe Ubuntu's two-stage policy load and how to add utilize it
  when developing policy (LP: #974089)

[ Serge Hallyn ]
* debian/apparmor.init: do nothing in a container.  This can be
  removed once stacked profiles are supported and used by lxc.
  (LP: #978297)

[ Steve Beattie ]
* debian/patches/0008-apparmor-lp963756.patch: Fix permission mapping
  for change_profile onexec (LP: #963756)
* debian/patches/0009-apparmor-lp959560-part1.patch,
  debian/patches/0010-apparmor-lp959560-part2.patch: Update the parser
  to support the 'in' keyword for value lists, and make mount
  operations aware of 'in' keyword so they can affect the flags build
  list (LP: #959560)
* debian/patches/0011-apparmor-lp872446.patch: fix logprof missing
  exec events in complain mode (LP: #872446)
* debian/patches/0012-apparmor-lp978584.patch: allow inet6 access in
  dovecot imap-login profile (LP: #978584)
* debian/patches/0013-apparmor-lp800826.patch: fix libapparmor
  log parsing library from dropping apparmor network events that
  contain ip addresses or ports in them (LP: #800826)
* debian/patches/0014-apparmor-lp979095.patch: document new mount rule
  syntax and usage in apparmor.d(5) manpage (LP: #979095)
* debian/patches/0015-apparmor-lp963756.patch: Fix change_onexec
  for profiles without attachment specification (LP: #963756,
  LP: #978038)
* debian/patches/0016-apparmor-lp968956.patch: Fix protocol error when
  loading policy to kernels without compat patches (LP: #968956)
* debian/patches/0017-apparmor-lp979135.patch: Fix change_profile to
  grant access to /proc/attr api (LP: #979135)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
#                  2008, 2009
4
4
#    NOVELL (All rights reserved)
5
5
#
6
 
#    Copyright (c) 2010
 
6
#    Copyright (c) 2010, 2011, 2012
7
7
#    Canonical Ltd. (All rights reserved)
8
8
#
9
9
#    This program is free software; you can redistribute it and/or
16
16
#    GNU General Public License for more details.
17
17
#
18
18
#    You should have received a copy of the GNU General Public License
19
 
#    along with this program; if not, contact Novell, Inc.
 
19
#    along with this program; if not, contact Canonical Ltd.
20
20
# ----------------------------------------------------------------------
21
21
 
22
22
 
34
34
 
35
35
AppArmor confinement is provided via I<profiles> loaded into the kernel
36
36
via apparmor_parser(8), typically through the F</etc/init.d/apparmor>
37
 
SysV initscript, which is used like this:
 
37
SysV initscript (on Ubuntu, also see UBUNTU POLICY LOAD, below), which is used
 
38
like this:
38
39
 
39
40
        # /etc/init.d/apparmor start
40
41
        # /etc/init.d/apparmor stop
94
95
 
95
96
A confined process can not call mknod(2) to create character or block devices.
96
97
 
 
98
=head1 UBUNTU POLICY LOAD
 
99
 
 
100
Ubuntu systems use Upstart instead of a traditional SysV init system. Because
 
101
Upstart is an event-driven init system and understanding that policy must be
 
102
loaded before execution, Ubuntu loads policy in two stages: first via upstart
 
103
jobs for binaries that are started in early boot, and then via a SysV
 
104
initscript that starts in S37 for all remaining policy. When developing
 
105
policy it is important to know how your application is started and if policy
 
106
load should be handled specially.
 
107
 
 
108
In general, nothing extra has to be done for applications without an initscript
 
109
or with an initscript that starts after AppArmor's second stage initscript.
 
110
 
 
111
If the confined application has an Upstart job, adjust the job to call
 
112
F</lib/init/apparmor-profile-load> with the filename of the policy file
 
113
(relative to F</etc/apparmor.d/>). For example:
 
114
 
 
115
        pre-start script
 
116
                /lib/init/apparmor-profile-load usr.bin.foo
 
117
        end script
 
118
 
 
119
If the confined application does not have an Upstart job but it starts before
 
120
AppArmor's second stage initscript, then add a symlink from the policy file in
 
121
F</etc/apparmor.d> to F</etc/apparmor/init/network-interface-security/>. For
 
122
example:
 
123
 
 
124
        # cd /etc/apparmor/init/network-interface-security/
 
125
        # ln -s /etc/apparmor.d/usr.bin.foo .
 
126
 
 
127
The network-interface-security Upstart job will load all the symlinked policy
 
128
files in F</etc/apparmor/init/network-interface-security/> before any network
 
129
interfaces come up. Because network interfaces come up very early in the boot
 
130
process, this will help ensure that AppArmor policy is loaded before the
 
131
confined application starts.
 
132
 
97
133
=head1 ERRORS
98
134
 
99
135
When a confined process tries to access a file it does not have permission
140
176
 
141
177
=item F</etc/init.d/apparmor>
142
178
 
 
179
=item F</etc/apparmor/init/network-interface-security/>
 
180
 
143
181
=item F</etc/apparmor.d/>
144
182
 
145
183
=item F</var/lib/apparmor/>