The AppArmor user space development project.
Find a file
Jamie Strandboge 1db463f4de This patchset is broken into 4 parts:
* the application, library, documentation and installation script
* the initial templates and policy groups. This will undoubtedly need
  refinement as we get feedback from users. Initial policy is based on Ubuntu's
  Application Review Board (ARB) requirements[2].
* tests for the library
* Makefile integration

Templates are stored in /usr/share/apparmor/easyprof/templates and policy
groups in /usr/share/apparmor/easyprof/policygroups. This can be adjusted via
/etc/apparmor/easyprof.conf.

The aa-easyprof.pod has complete documentation on usage with some
additional information in utils/easyprof/README (mostly duplicated
here).

Testing can be performed in a number of ways:
$ cd utils ; make check # runs unit tests and pyflakes

Unit tests manually:
$ ./test/test-aa-easyprof.py

In source manual testing:
$ ./aa-easyprof --templates-dir=./easyprof/templates \
                --policy-groups-dir=./easyprof/policygroups \
                ... \
                /opt/foo/bin/foo

Post-install manual testing:
$ make DESTDIR=/tmp/test PERLDIR=/tmp/test/usr/share/perl5/Immunix install
$ cd /tmp/test
$ PYTHONPATH=/tmp/test/usr/local/.../dist-packages ./usr/bin/aa-easyprof \
    --templates-dir=/tmp/test/usr/share/apparmor/easyprof/templates \
    --policy-groups-dir=/tmp/test/usr/share/apparmor/easyprof/policygroups \
    /opt/bin/foo

(you may also adjust /tmp/test/etc/apparmor/easyprof.conf to avoid
specifying --templates-dir and --policy-groups-dir).

Committing this now based on conversation with John and Steve.

Acked-By: Jamie Strandboge <jamie@canonical.com>
2012-05-07 22:37:48 -07:00
changehat adjust documentation "release" name to match other manpages. 2011-05-27 15:04:42 -07:00
common bump version tag for apparmor 2.8 beta-5 2012-04-11 17:24:07 -07:00
deprecated - added new aa-status tool rewritten in Python 2011-05-27 15:08:50 -04:00
documentation Add documentation directory and start of the dfa variables documentation 2011-06-27 10:32:04 +01:00
kernel-patches Add compatibility patches for linux kernel 3.1 2011-08-27 12:56:53 -07:00
libraries/libapparmor The m4 shipped to handle Python was incorrectly clearing 2012-04-25 12:15:19 -07:00
parser Fix change_profile to grant access to api 2012-04-11 16:04:33 -07:00
profiles Allow Google Chrome and chromium-browser to work under sanitized helper. While 2012-05-02 07:44:55 -05:00
tests With the fixing of the change_profile rules to automatically allow 2012-04-11 23:17:52 -07:00
utils This patchset is broken into 4 parts: 2012-05-07 22:37:48 -07:00
.bzrignore .bzrignore: ignore the generated testfiles in the parser testsuite, all 2011-08-09 01:17:42 -07:00
LICENSE Add a top-level "catch-all" GPLv2 license to cover any files that are 2007-03-30 15:47:14 +00:00
Makefile Subject: toplevel makefile: correct location of libapparmor 2012-03-22 13:17:48 -07:00
README add a missing "make install" call to README in the libapparmor section. 2011-09-12 22:30:17 +02:00

------------
Introduction
------------
AppArmor protects systems from insecure or untrusted processes by
running them in restricted confinement, while still allowing processes
to share files, exercise privilege and communicate with other processes.
AppArmor is a Mandatory Access Control (MAC) mechanism which uses the
Linux Security Module (LSM) framework. The confinement's restrictions
are mandatory and are not bound to identity, group membership, or object
ownership. The protections provided are in addition to the kernel's
regular access control mechanisms (including DAC) and can be used to
restrict the superuser.

The AppArmor kernel module and accompanying user-space tools are
available under the GPL license (the exception is the libapparmor
library, available under the LGPL license, which allows change_hat(2)
and change_profile(2) to be used by non-GPL binaries).

For more information, you can read the techdoc.pdf (available after
building the parser) and by visiting the http://apparmor.net/ web
site.


-------------
Source Layout
-------------

AppArmor consists of several different parts:

changehat/	source for using changehat with Apache, PAM and Tomcat
common/		common makefile rules
desktop/	empty
kernel-patches/	compatibility patches for various kernel versions
libraries/	libapparmor source and language bindings
parser/		source for parser/loader and corresponding documentation
profiles/	configuration files, reference profiles and abstractions
tests/		regression and stress testsuites
utils/		high-level utilities for working with AppArmor

--------------------------------------
Important note on AppArmor kernel code
--------------------------------------

While most of the kernel AppArmor code has been accepted in the
upstream Linux kernel, a few important pieces were not included. These
missing pieces unfortunately are important bits for AppArmor userspace
and kernel interaction; therefore we have included compatibility
patches in the kernel-patches/ subdirectory, versioned by upstream
kernel (2.6.37 patches should apply cleanly to 2.6.38 source).

Without these patches applied to the kernel, the AppArmor userspace
will not function correctly.

------------------------------------------
Building and Installing AppArmor Userspace
------------------------------------------

To build and install AppArmor userspace on your system, build and install in
the following order.


libapparmor:
$ cd ./libraries/libapparmor
$ sh ./autogen.sh
$ sh ./configure --prefix=/usr --with-perl	# see below
$ make
$ make check
$ make install

[optional arguments to libapparmor's configure include --with-python
 and --with-ruby, to generate python and ruby bindings to libapparmor,
 respectively.]


Utilities:
$ cd utils
$ make
$ make check
$ make install


parser:
$ cd parser
$ make
$ make check
$ make install


Apache mod_apparmor:
$ cd changehat/mod_apparmor
$ make		# depends on libapparmor having been built first
$ make install


PAM AppArmor:
$ cd changehat/pam_apparmor
$ make		# depends on libapparmor having been built first
$ make install


Profiles:
$ cd profiles
$ make
$ make check	# depends on the parser having been built first
$ make install


[Note that for the parser and the utils, if you only with to build/use
 some of the locale languages, you can override the default by passing
 the LANGS arguments to make; e.g. make all install "LANGS=en_US fr".]

-------------------
AppArmor Testsuites
-------------------

A number of testsuites are in the AppArmor sources. Most have documentation on
usage and how to update and add tests. Below is a quick overview of their
location and how to run them.


Regression tests
----------------
For details on structure and adding tests, see
tests/regression/apparmor/README.

To run:
$ cd tests/regression/apparmor (requires root)
$ make
$ sudo make tests
$ sudo bash open.sh -r	 # runs and saves the last testcase from open.sh


Parser tests
------------
For details on structure and adding tests, see parser/tst/README.

To run:
$ cd parser/tst
$ make
$ make tests


Libapparmor
-----------
For details on structure and adding tests, see libraries/libapparmor/README.
$ cd libraries/libapparmor
$ make check

Profile checks
--------------
A basic consistency check to ensure that the parser and aa-logprof parse
successfully the current set of shipped profiles. The system or other
parser and logprof can be passed in by overriding the PARSER and LOGPROF
variables.
$ cd profiles
$ make && make check

Stress Tests
------------
To run AppArmor stress tests:
$ make all

Use these:
$ ./change_hat
$ ./child
$ ./kill.sh
$ ./open
$ ./s.sh

Or run all at once:
$ ./stress.sh

Please note that the above will stress the system so much it may end up
invoking the OOM killer.

To run parser stress tests (requires /usr/bin/ruby):
$ ./stress.sh

(see stress.sh -h for options)

-----------------------------------------------
Building and Installing AppArmor Kernel Patches
-----------------------------------------------

TODO