A community-built C++ library to parse, read, and modify AppArmor profiles.
This library is used by the AppAnvil project.
Packages needed to compile the library:
- CMake
- PkgConfig
- clang (or an equivalent C++ compiler)
- Bison
- Flex
sudo apt install pkg-config cmake clang bison flex libfl-dev
sudo zypper in cmake clang bison flex
Additional packages needed to run the tests:
- GoogleTest
- GoogleMock
sudo apt install libgtest-dev libgmock-dev
sudo zypper in gtest gmock
Optional packages needed to run linters and static analysis checks:
- clang-tidy
- cppcheck
sudo apt install clang-tidy-15 cppcheck
sudo apt install clang cppcheck
If you want to run the tests, first you must load the example profiles from the main apparmor repository. These profiles are included in a submodule for convenience. We also disable a few irrelevant tests using a patch.
git submodule update --init --recursive --remote
git -C modules/apparmor am ../disable_tests.patch
Before you build the library, you should first generate the makefile by running:
cmake .
Optionally, if you want to run linters and static analysis checks:
cmake -DANALYZE=TRUE .
After the makefile is generated, you can build the library:
make
Alternatively, you can build and install the library, to make it useable by other programs:
sudo make install
To build an run the tests:
make test
To only run certain tests (using regex):
ctest -R e2e
If you installed the library using sudo make install
, then you can also uninstall it by running:
sudo make uninstall