====== AppArmor ======
AppArmor ist ein Sicherheitsframework / Mandatory Access Control (MAC) für [[linux:Linux]]. Es kontrolliert Anwendungen für die ein Profil mit den Berechtigungen vorliegt (Standard ist ''/etc/apparmor.d'').
===== Links =====
  * [[http://kerneltrap.org/Linux/AppArmors_Security_Goals|AppArmor's Security Goals]]
  * [[http://www.linux.com/article.pl?sid=06/08/14/203253|Protect your applications with AppArmor]]
  * [[http://www.linux.com/article.pl?sid=06/12/01/0557219|Firewall Your Applications with AppArmor]]
===== Benutzung =====
==== Status ====
:!: Achtung: Wenn eine app gestartet wurde bevor ein Profil geladen wurde dann bleibt sie unbeschränkt.
sudo aa-status
apparmor module is loaded.
26 profiles are loaded.
26 profiles are in enforce mode.
   /sbin/dhclient
   /usr/bin/evince
   /usr/bin/evince-previewer
   /usr/bin/evince-previewer//sanitized_helper
   /usr/bin/evince-thumbnailer
   /usr/bin/evince-thumbnailer//sanitized_helper
   /usr/bin/evince//sanitized_helper
   /usr/lib/NetworkManager/nm-dhcp-client.action
   /usr/lib/connman/scripts/dhclient-script
   /usr/lib/cups/backend/cups-pdf
   /usr/lib/ipsec/charon
   /usr/lib/libvirt/virt-aa-helper
   /usr/lib/lightdm/lightdm-guest-session
   /usr/lib/lightdm/lightdm-guest-session//chromium
   /usr/lib/telepathy/mission-control-5
   /usr/lib/telepathy/telepathy-*
   /usr/lib/telepathy/telepathy-*//pxgsettings
   /usr/lib/telepathy/telepathy-*//sanitized_helper
   /usr/lib/telepathy/telepathy-ofono
   /usr/sbin/cups-browsed
   /usr/sbin/cupsd
   /usr/sbin/libvirtd
   /usr/sbin/mysqld-akonadi
   /usr/sbin/mysqld-akonadi///usr/sbin/mysqld
   /usr/sbin/tcpdump
   docker-default
0 profiles are in complain mode.
5 processes have profiles defined.
5 processes are in enforce mode.
   /sbin/dhclient (1144) 
   /usr/lib/telepathy/mission-control-5 (2921) 
   /usr/sbin/cups-browsed (964) 
   /usr/sbin/cupsd (720) 
   /usr/sbin/libvirtd (1382) 
0 processes are in complain mode.
0 processes are unconfined but have a profile defined.
==== Profil löschen ====
==== AppArmor stoppen ====
service apparmor teardown
stop leert nur den cache.
==== AppArmor starten ====
service apparmor start
==== AppArmor Utilities ====
Nach der Installation von apparmor-utils stehen folgende Werkzeuge zur Verfügung:
^ Utility ^ Beschreibung ^
| aa-status 	| Überblick über die geladenen AppArmor-Profile mit Angabe des Modus |
| aa-unconfined | Ausgabe der Prozesse mit Netzwerkzugriff ohne Profil |
| aa-audit 	| Profil in den Audit-Modus versetzen |
| aa-complain 	| Profil in den Complain-Modus versetzen |
| aa-enforce 	| Profil in den Enforce-Modus versetzen |
| aa-autodep 	| Erstellung eines Basis-Profils im Complain-Modus |
| aa-genprof 	| Erstellung eines Basis-Profils mit interaktiver Ergänzung von Regeln und abschließender Versetzung des Profils in den Enforce-Modus  |
| aa-logprof 	| interaktive Ergänzung von Regeln anhand der Einträge in /var/log/syslog |
| aa-cleanprof 	| automatisches Aufräumen eines Profils |
[[https://wiki.ubuntuusers.de/AppArmor/|Quelle]]