roddhjav / apparmor.d

Full set of AppArmor profiles (~ 1500 profiles)
https://apparmor.pujol.io
GNU General Public License v2.0
454 stars 43 forks source link

Profile Tests #570

Open roddhjav opened 2 days ago

roddhjav commented 2 days ago

This issue aims to present and discuss the various tests applied to the profiles as well as their current stage of deployment.

Current Status

[!CAUTION] Do not run the integration tests (make bats) outside a system dedicated for this purpose. The tests can be destructive and wipe your data.

Plan

For more complex software suite, more integration tests need to be done. The plan is to run existing integration suite from these very software in an environment with apparmor.d profiles.

nobody43 commented 2 days ago

I have the following draft: https://gist.github.com/nobody43/7a21f518dbebdd48a3c2e7af7934a63b Is it needed? Tested on Ubuntu 24.04.

Q: Why python? A: libapparmor could be utilized

Q: Why reimplement? A: libapparmor is too tightly coupled with actually loading the profiles

Q: Is it on par with apparmor_parser? A: No, even libapparmor does not claim 1:1 compatibility

Q: What's implemented? A: grep reason profile_tests.py

Q: What's not implemented? A: Mutually exclusive abstractions, dangerous file access, missing owner, tunables expansion, file rules to abstraction comparison, etc

Q: Is it reliable? A: Not tested thoroughly yet