2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-22 10:07:12 +00:00

Documentation: Move README to README.md and sync with master branch

Move README to README.md to provide better integration with gitlab
and sync changes from master branch so we have badges, build info
etc.

Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
John Johansen 2018-09-13 15:47:26 -07:00
parent 486616908d
commit 699e006e51

View File

@ -1,3 +1,9 @@
# AppArmor
[![Build status](https://gitlab.com/apparmor/apparmor/badges/master/build.svg)](https://gitlab.com/apparmor/apparmor/commits/master)
[![Overall test coverage](https://gitlab.com/apparmor/apparmor/badges/master/coverage.svg)](https://gitlab.com/apparmor/apparmor/pipelines)
[![Core Infrastructure Initiative Best Practices](https://bestpractices.coreinfrastructure.org/projects/1699/badge)](https://bestpractices.coreinfrastructure.org/projects/1699)
------------ ------------
Introduction Introduction
------------ ------------
@ -54,6 +60,7 @@ parser/ source for parser/loader and corresponding documentation
profiles/ configuration files, reference profiles and abstractions profiles/ configuration files, reference profiles and abstractions
tests/ regression and stress testsuites tests/ regression and stress testsuites
utils/ high-level utilities for working with AppArmor utils/ high-level utilities for working with AppArmor
```
-------------------------------------- --------------------------------------
Important note on AppArmor kernel code Important note on AppArmor kernel code
@ -74,16 +81,27 @@ Building and Installing AppArmor Userspace
------------------------------------------ ------------------------------------------
To build and install AppArmor userspace on your system, build and install in To build and install AppArmor userspace on your system, build and install in
the following order. the following order. Some systems may need to export various python-related
environment variables to complete the build. For example, before building
anything on these systems, use something along the lines of:
```
$ export PYTHONPATH=$(realpath libraries/libapparmor/swig/python)
$ export PYTHON=/usr/bin/python3
$ export PYTHON_VERSION=3
$ export PYTHON_VERSIONS=python3
```
libapparmor: libapparmor:
```
$ cd ./libraries/libapparmor $ cd ./libraries/libapparmor
$ sh ./autogen.sh $ sh ./autogen.sh
$ sh ./configure --prefix=/usr --with-perl --with-python # see below $ sh ./configure --prefix=/usr --with-perl --with-python # see below
$ make $ make
$ make check $ make check
$ make install $ make install
```
[an additional optional argument to libapparmor's configure is --with-ruby, to [an additional optional argument to libapparmor's configure is --with-ruby, to
generate Ruby bindings to libapparmor.] generate Ruby bindings to libapparmor.]
@ -94,33 +112,44 @@ $ cd utils
$ make $ make
$ make check $ make check
$ make install $ make install
```
parser: parser:
```
$ cd parser $ cd parser
$ make # depends on libapparmor having been built first $ make # depends on libapparmor having been built first
$ make check $ make check
$ make install $ make install
```
Apache mod_apparmor: Apache mod_apparmor:
```
$ cd changehat/mod_apparmor $ cd changehat/mod_apparmor
$ make # depends on libapparmor having been built first $ make # depends on libapparmor having been built first
$ make install $ make install
```
PAM AppArmor: PAM AppArmor:
```
$ cd changehat/pam_apparmor $ cd changehat/pam_apparmor
$ make # depends on libapparmor having been built first $ make # depends on libapparmor having been built first
$ make install $ make install
```
Profiles: Profiles:
```
$ cd profiles $ cd profiles
$ make $ make
$ make check # depends on the parser having been built first $ make check # depends on the parser having been built first
$ make install $ make install
```
[Note that for the parser and the utils, if you only with to build/use [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 some of the locale languages, you can override the default by passing
@ -141,38 +170,50 @@ For details on structure and adding tests, see
tests/regression/apparmor/README. tests/regression/apparmor/README.
To run: To run:
```
$ cd tests/regression/apparmor (requires root) $ cd tests/regression/apparmor (requires root)
$ make $ make
$ sudo make tests $ sudo make tests
$ sudo bash open.sh -r # runs and saves the last testcase from open.sh $ sudo bash open.sh -r # runs and saves the last testcase from open.sh
```
Parser tests Parser tests
------------ ------------
For details on structure and adding tests, see parser/tst/README. For details on structure and adding tests, see parser/tst/README.
To run: To run:
```
$ cd parser/tst $ cd parser/tst
$ make $ make
$ make tests $ make tests
```
Libapparmor Libapparmor
----------- -----------
For details on structure and adding tests, see libraries/libapparmor/README. For details on structure and adding tests, see libraries/libapparmor/README.
```
$ cd libraries/libapparmor $ cd libraries/libapparmor
$ make check $ make check
```
Utils Utils
----- -----
Tests for the Python utilities exist in the test/ subdirectory. Tests for the Python utilities exist in the test/ subdirectory.
```
$ cd utils $ cd utils
$ make check $ make check
```
The aa-decode utility to be tested can be overridden by The aa-decode utility to be tested can be overridden by
setting up environment variable APPARMOR_DECODE; e.g.: setting up environment variable APPARMOR_DECODE; e.g.:
```
$ APPARMOR_DECODE=/usr/bin/aa-decode make check $ APPARMOR_DECODE=/usr/bin/aa-decode make check
```
Profile checks Profile checks
-------------- --------------
@ -180,29 +221,44 @@ A basic consistency check to ensure that the parser and aa-logprof parse
successfully the current set of shipped profiles. The system or other successfully the current set of shipped profiles. The system or other
parser and logprof can be passed in by overriding the PARSER and LOGPROF parser and logprof can be passed in by overriding the PARSER and LOGPROF
variables. variables.
```
$ cd profiles $ cd profiles
$ make && make check $ make && make check
```
Stress Tests Stress Tests
------------ ------------
To run AppArmor stress tests: To run AppArmor stress tests:
```
$ make all $ make all
```
Use these: Use these:
```
$ ./change_hat $ ./change_hat
$ ./child $ ./child
$ ./kill.sh $ ./kill.sh
$ ./open $ ./open
$ ./s.sh $ ./s.sh
```
Or run all at once: Or run all at once:
```
$ ./stress.sh $ ./stress.sh
```
Please note that the above will stress the system so much it may end up Please note that the above will stress the system so much it may end up
invoking the OOM killer. invoking the OOM killer.
To run parser stress tests (requires /usr/bin/ruby): To run parser stress tests (requires /usr/bin/ruby):
```
$ ./stress.sh $ ./stress.sh
```
(see stress.sh -h for options) (see stress.sh -h for options)