linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH 0/11] security: AppArmor - Overview
@ 2006-04-19 17:49 Tony Jones
  2006-04-19 17:49 ` [RFC][PATCH 1/11] security: AppArmor - Integrate into kbuild Tony Jones
                   ` (13 more replies)
  0 siblings, 14 replies; 173+ messages in thread
From: Tony Jones @ 2006-04-19 17:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: chrisw, Tony Jones, linux-security-module

Attached patches to include the AppArmor application security module in
the linux kernel.

An overview of AppArmor is available here
http://en.opensuse.org/Apparmor and a more detailed view here
http://en.opensuse.org/AppArmor_Detail A video of an overview and demo
of AppArmor is available here
ftp://ftp.belnet.be/pub/mirror/FOSDEM/FOSDEM2006-apparmor.avi

Overview
-----------
AppArmor is an LSM security enhancement for the Linux kernel. The
primary goal of AppArmor is to make it easy for a system administrator
to control application behavior, enforcing that the application has
access to only the files and POSIX.1e draft capabilities it requires to
do its job. AppArmor deliberately uses this simple access control model
to make it as easy as possible for the administrator to manage the
policy, because the worst security of all is that which is never
deployed because it was too hard.

AppArmor chooses which security policy to enforce for a process at
exec() time by the executable image's pathname, in conjunction with any
policy enforced for the currently running executable.

AppArmor mediates access to the file system using absolute path names
with shell-syntax wildcards, so that "/srv/htdocs/** r" grants read
access to all files in /srv/htdocs. AppArmor mediates access to POSIX.1e
Capabilities in that the process must both have e.g. "capability
net_bind_service" and intrinsically have that capability (usually by
being root) to be able to bind to privileged network ports. Thus a
confined process can not subvert AppArmor except as permitted by policy,
and can not access the file system except as permitted by the profile.

AppArmor is strictly monotonic to security: it only restricts privilege,
never enhancing privilege. So if you add AppArmor to a system, it only
becomes more secure or stays the same, the security policy will not add
vulnerabilities. Similarly, AppArmor is designed to be highly
transparent to applications: If you add AppArmor to a working system,
you have to develop AppArmor profiles, but you do not have to change
your applications. If you remove AppArmor from a running system, the
system continues to operate exactly as before, but without the AppArmor
security protections.

AppArmor is *not* intended to protect every aspect of the system from
every other aspect of the system: the intended usage is that only a
small fraction of all programs on a Linux system will have AppArmor
profiles. Rather, AppArmor is intended to protect the system against a
particular threat.

For instance, to secure a machine against network attack, all programs
that face the network should be profiled. If all open network ports lead
to AppArmor profiles, then there is no way for the network attacker to
attack the machine, except as controlled by AppArmor policy. As a
convenience, AppArmor includes a netstat wrapper that reports all
programs with open network ports and their AppArmor profile status.

AppArmor includes a training system so that a profile can be built by
exercising a program in "complain" mode where rules are not enforced but
violations are logged. User-level tools can then transform this log of
events into application security profiles by asking the user questions.
The profile generator is intelligent about not asking duplicate
questions, incrementally improving existing profiles, and suggesting
generalized alternatives to specific events, such as inserting * into
path names that appear to be library version numbers.

AppArmor has been split into two modules, the primary apparmor module
and a submodule that implements the necessary pathname matching
functions. The SuSE release of AppArmor uses a sub-module which supports
full shell pathname expansion syntax. This is achieved using a subset of
PCRE and limits on expression complexity at the userside compiler. It is
understood that this approach is not acceptable for mainline inclusion.
The version submitted here uses a simpler matching submodule that
implements literal and tailglob matches only. We plan on developing a
new submodule that will implement the missing functionality of the SuSE
release using the textsearch framework and a new bounded textsearch
algorithm acceptable for subsequent inclusion into the mainline kernel.

The features supported by the matching sub module are exposed into the
apparmor filesystem and read by the userspace parser which will prevent
unsupported policy from being loaded.

Without the use of this extended globbing module, AppArmor supports only
globs in the following form:

/path/to/files**

or:

/path/to/directory/**

Who Needs This?
-------------------
AppArmor is a core part of SUSE Linux. It has also been ported to
Slackware, Ubuntu, Gentoo, Red Hat, and Pardus Linux. AppArmor is not
"needed" but is desirable where ever an application hosted on Linux is
exposed to attack.

Patches
--------
The implementation has been broken down into 11 patches, with brief
descriptions here, and longer descriptions in each of the patch posts
that follow

   1. apparmor_build.patch. Integrate into kbuild.
   2. apparmor_headers.patch. Core headers.
   3. apparmor_lsm.patch. LSM interface implementation.
   4. apparmor_mediation.patch. Core access controls.
   5. apparmor_fs.patch. AppArmor filesystem.
   6. apparmor_interface.patch. Usersapce/kernelspace interface.
   7. apparmor_misc.patch. Misc., including Capabilities and data
      structure management.
   8. apparmor_match.patch. Pathname matching submodule.
   9. audit.patch. Integrate into audit subsystem.
  10. dpath_flags.patch. Generate absolute path names.
  11. namespace_sem.patch. Exports the namespace_sem semaphore.

The patches apply cleanly to 2.6.17-rc1 and -rc2.


Tests
------
The AppArmor team has a suite of functionality and stress tests
http://www.apparmor.org/

Bugs
----

   1. The simple tail-glob pattern matching sub-module described above
      needs to be replaced with a fully functional pattern matching
      module that uses textsearch facilities as soon as possible.
   2. AppArmor needs to re-construct the full path name of files to
      perform initial validation. Some of the LSM hooks that we mediate
      do not have vfsmount/nameidata passed. Our temporary workaround is
      to export the namespace_sem semaphore so we can safely walk the
      process's namespace to find a vfsmount with a root dentry matching
      the dentry we are trying to mediate. We believe a cleaner solution
      (such as passing a vfsmount or nameidata to all LSM hooks throughout
      the VFS layer) would be useful for audit, other LSMs, and
      potentially FUSE. As it is a fair amount of work to pass vfsmount or
      nameidata structures throughout the VFS, alternative suggestions
      and ideas are welcomed.

Thanks and Acknowledgment:
----------------------------------

   1. AppArmor started life as Steve Beattie's thesis topic in 1996 and
      has been in continuous development since.
   2. Professors Virgil Gligor and Heather Hinton contributed
      substantially to the initial design of AppArmor.
   3. LSM was built with cooperation from a great many people; the LSM
      interface reduced our long-term maintenance costs and helped raise
      the visibility of mandatory access control systems among many
      users. We wish to thank Stephen Smalley, James Morris, Chris
      Wright, and Greg Kroah-Hartman in particular for their work on LSM.
   4. The users of Immunix Linux and AppArmor on various Linuxes helped
      a lot to improve the system.
   5. The SUSE Security Team and the SUSE Kernel Team reviewed the
      AppArmor code to help make it more ready for LKML inclusion. Of
      course as usual, bugs are our own.

^ permalink raw reply	[flat|nested] 173+ messages in thread

end of thread, other threads:[~2006-04-28 21:49 UTC | newest]

Thread overview: 173+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-19 17:49 [RFC][PATCH 0/11] security: AppArmor - Overview Tony Jones
2006-04-19 17:49 ` [RFC][PATCH 1/11] security: AppArmor - Integrate into kbuild Tony Jones
2006-04-19 17:57   ` Arjan van de Ven
2006-04-19 18:10     ` Tony Jones
2006-04-19 18:35   ` Valdis.Kletnieks
2006-04-19 19:55   ` Adrian Bunk
2006-04-19 20:52     ` Tony Jones
2006-04-19 17:49 ` [RFC][PATCH 2/11] security: AppArmor - Core headers Tony Jones
2006-04-19 18:01   ` Arjan van de Ven
2006-04-20 17:43     ` Tony Jones
2006-04-19 17:49 ` [RFC][PATCH 3/11] security: AppArmor - LSM interface Tony Jones
2006-04-19 18:05   ` Arjan van de Ven
2006-04-19 17:49 ` [RFC][PATCH 4/11] security: AppArmor - Core access controls Tony Jones
2006-04-19 18:10   ` Arjan van de Ven
2006-04-19 18:57     ` Crispin Cowan
2006-04-19 23:05       ` Rik van Riel
2006-04-19 23:18         ` Seth Arnold
2006-04-19 23:21           ` Rik van Riel
2006-04-19 23:50             ` Crispin Cowan
2006-04-20 12:33       ` Stephen Smalley
2006-04-20 16:27         ` Lars Marowsky-Bree
2006-04-20 17:39     ` Tony Jones
2006-04-19 19:32   ` Jan Engelhardt
2006-04-19 19:50   ` Stephen Smalley
2006-04-20  9:40   ` Al Viro
2006-04-20 11:40     ` Serge E. Hallyn
2006-04-20 21:39       ` Tony Jones
2006-04-19 17:49 ` [RFC][PATCH 5/11] security: AppArmor - Filesystem Tony Jones
2006-04-21 21:13   ` Amy Griffis
2006-04-19 17:49 ` [RFC][PATCH 6/11] security: AppArmor - Userspace interface Tony Jones
2006-04-20 21:39   ` Pavel Machek
2006-04-21 18:01     ` Tony Jones
2006-04-21 18:41       ` Pavel Machek
2006-04-19 17:50 ` [RFC][PATCH 7/11] security: AppArmor - Misc (capabilities, data structures) Tony Jones
2006-04-19 18:16   ` Stephen Hemminger
2006-04-19 17:50 ` [RFC][PATCH 8/11] security: AppArmor - Pathname matching submodule Tony Jones
2006-04-19 17:50 ` [RFC][PATCH 9/11] security: AppArmor - Audit changes Tony Jones
2006-04-21 21:21   ` Amy Griffis
2006-04-22  0:13     ` Steve Grubb
2006-04-22  0:19       ` Tony Jones
2006-04-19 17:50 ` [RFC][PATCH 10/11] security: AppArmor - Add flags to d_path Tony Jones
2006-04-19 22:12   ` Christoph Hellwig
2006-04-20  5:36     ` Tony Jones
2006-04-20  8:26       ` Arjan van de Ven
2006-04-20 16:43         ` Tony Jones
2006-04-20 17:04           ` Christoph Hellwig
2006-04-20 17:50             ` Tony Jones
2006-04-21 12:16               ` Stephen Smalley
2006-04-24 13:05       ` Alan Cox
2006-04-19 17:50 ` [RFC][PATCH 11/11] security: AppArmor - Export namespace semaphore Tony Jones
2006-04-19 22:10   ` Christoph Hellwig
2006-04-20 12:39   ` Stephen Smalley
2006-04-20 12:46     ` Serge E. Hallyn
2006-04-20 12:05       ` Stephen Smalley
2006-04-20 13:21         ` Serge E. Hallyn
2006-04-20 12:48           ` Stephen Smalley
2006-04-20 12:58             ` Stephen Smalley
2006-04-20 22:11             ` Linda A. Walsh
2006-04-20 23:05               ` Christoph Hellwig
2006-04-21  1:29                 ` Linda A. Walsh
2006-04-21  2:09                   ` Chris Wright
2006-04-21  5:10                     ` Linda Walsh
2006-04-23 12:11                       ` Arjan van de Ven
2006-04-21 14:02               ` Stephen Smalley
2006-04-20 19:45           ` Tony Jones
2006-04-20 20:16             ` Serge E. Hallyn
2006-04-20 20:22             ` James Morris
2006-04-20 21:50     ` Linda Walsh
2006-04-20 21:56       ` Al Viro
2006-04-20 23:54         ` James Morris
2006-04-21 13:59       ` Stephen Smalley
2006-04-19 18:14 ` [RFC][PATCH 0/11] security: AppArmor - Overview Arjan van de Ven
2006-04-19 22:32   ` Andi Kleen
2006-04-19 23:00     ` grundig
2006-04-19 23:38       ` Andi Kleen
2006-04-20  1:32         ` Crispin Cowan
2006-04-20 13:00           ` grundig
2006-04-20 13:09             ` Serge E. Hallyn
2006-04-20 13:15               ` Al Viro
2006-04-21  0:11               ` Tony Jones
2006-04-24 13:01             ` Alan Cox
2006-04-20  8:42     ` Arjan van de Ven
2006-04-20 19:26       ` Crispin Cowan
2006-04-20 19:27       ` Chris Wright
2006-04-21 12:18         ` Stephen Smalley
2006-04-21 17:30           ` Chris Wright
2006-04-21 18:07             ` Stephen Smalley
2006-04-21 20:06               ` Valdis.Kletnieks
2006-04-21 20:35                 ` Stephen Smalley
2006-04-21 20:44                   ` Stephen Smalley
2006-04-21 21:38                   ` Dave Neuer
2006-04-22 10:01                     ` Thomas Bleher
2006-04-24  4:18               ` Neil Brown
2006-04-24  7:03                 ` Theodore Ts'o
2006-04-24 13:04                   ` Pavel Machek
2006-04-24 13:43                     ` Joshua Brindle
2006-04-24 21:07                   ` Stephen Smalley
2006-04-24 23:52                     ` Theodore Ts'o
2006-04-25  6:22                       ` Arjan van de Ven
2006-04-25 16:45                       ` Stephen Smalley
2006-04-25 16:52                         ` Arjan van de Ven
2006-04-25 17:43                           ` Seth Arnold
2006-04-25 18:34                         ` Valdis.Kletnieks
2006-04-25 18:48                           ` Stephen Smalley
2006-04-25 18:56                             ` Valdis.Kletnieks
2006-04-25  4:25                     ` Casey Schaufler
2006-04-25  7:50                       ` James Morris
2006-04-25 12:46                         ` Theodore Ts'o
2006-04-25 15:06                           ` Stephen Smalley
2006-04-25 16:00                         ` Casey Schaufler
2006-04-25 16:21                           ` Randy.Dunlap
2006-04-26  3:42                             ` Casey Schaufler
2006-04-26 12:15                               ` Stephen Smalley
2006-04-27  0:21                                 ` Casey Schaufler
2006-04-27 14:47                                   ` Karl MacMillan
2006-04-25 17:29                           ` Stephen Smalley
2006-04-26  3:56                             ` Casey Schaufler
2006-04-26 11:32                               ` Stephen Smalley
2006-04-25 16:47                       ` Stephen Smalley
2006-04-24  7:14                 ` Arjan van de Ven
2006-04-24  8:11                   ` Lars Marowsky-Bree
2006-04-25 19:27                   ` Seth Arnold
2006-04-24 13:11                 ` Joshua Brindle
2006-04-24 13:26                   ` Andi Kleen
2006-04-24 13:39                     ` Joshua Brindle
2006-04-24 15:16                       ` Joshua Brindle
2006-04-24 15:50                         ` Tony Jones
2006-04-24 17:03                           ` Joshua Brindle
2006-04-25 17:12                         ` Valdis.Kletnieks
2006-04-25 17:34                           ` Tony Jones
2006-04-24 13:52                     ` Alan Cox
2006-04-24 14:09                       ` Andi Kleen
2006-04-24 20:45                 ` Stephen Smalley
2006-04-25  8:10                   ` Neil Brown
2006-04-25  8:28                     ` Al Viro
2006-04-25 12:42                     ` James Carter
2006-04-25 12:43                       ` Andi Kleen
2006-04-25 14:50                         ` James Carter
2006-04-25 15:01                         ` Stephen Smalley
2006-04-25 18:11                           ` Tony Jones
2006-04-25 21:25                             ` Stephen Smalley
2006-04-25 17:07                     ` Stephen Smalley
2006-04-26 22:15                       ` Some Concrete AppArmor Questions - was " Neil Brown
2006-04-26 23:06                         ` Ken Brush
2006-04-27  4:15                           ` Andi Kleen
2006-04-27  6:52                             ` Arjan van de Ven
2006-04-27  7:40                               ` Chris Wright
2006-04-27 10:17                             ` Chris Wright
2006-04-27 14:42                               ` Karl MacMillan
2006-04-27 23:44                                 ` Chris Wright
2006-04-28 13:02                                   ` Stephen Smalley
2006-04-28 15:49                                     ` Casey Schaufler
2006-04-28 16:04                                       ` Stephen Hemminger
2006-04-28 21:49                                         ` James Morris
2006-04-28 16:56                                       ` Karl MacMillan
2006-04-27 16:03                               ` Stephen Smalley
2006-04-27 22:38                                 ` Chris Wright
2006-04-28 13:00                                   ` Stephen Smalley
2006-04-27 17:43                           ` Stephen Smalley
2006-04-27 17:58                             ` Ken Brush
2006-04-28 11:28                               ` Stephen Smalley
2006-04-28 11:47                                 ` Andi Kleen
2006-04-28 12:28                                   ` Stephen Smalley
2006-04-27 11:02                         ` Christoph Hellwig
2006-04-27 11:05                           ` Andi Kleen
2006-04-20 11:29     ` Serge E. Hallyn
2006-04-20 13:24     ` Christoph Hellwig
2006-04-20 22:32     ` Linda A. Walsh
2006-04-20 12:17 ` Stephen Smalley
2006-04-20 15:38   ` Joshua Brindle
2006-04-20 19:57   ` Crispin Cowan
2006-04-21 13:34     ` Stephen Smalley
2006-04-22 12:27 ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).