{"id":2532,"date":"2021-11-06T16:06:17","date_gmt":"2021-11-06T16:06:17","guid":{"rendered":"https:\/\/dft.wiki\/?p=2532"},"modified":"2026-06-08T22:20:57","modified_gmt":"2026-06-09T02:20:57","slug":"apparmor","status":"publish","type":"post","link":"https:\/\/dft.wiki\/?p=2532","title":{"rendered":"Enhancing Linux Security with AppArmor no Ubuntu"},"content":{"rendered":"<p>AppArmor is a Linux kernel security module that restricts program capabilities using per-program profiles.<\/p>\n<p>AppArmor uses the Linux Security Modules (LSM) kernel interface and does not apply to all running applications on the system, only those with a profile created and assigned.<\/p>\n<p>An additional package may be required to manage profiles:<\/p>\n<pre>sudo apt install apparmor-profiles -y<\/pre>\n<p>Profiles can allow or deny capabilities such as network access, and reading, writing, or executing files on matching paths.<\/p>\n<pre>sudo apparmor_status\r\nsudo aa-status<\/pre>\n<p>Profiles are located at:<\/p>\n<ul>\n<li>ls \/etc\/apparmor.d\/*<\/li>\n<li>ls \/etc\/apparmor.d\/disable\/*<\/li>\n<\/ul>\n<p>Create a new profile for an application or script:<\/p>\n<pre>sudo aa-genprof \/usr\/sbin\/httpd<\/pre>\n<p>Set a profile to complain or enforce mode:<\/p>\n<pre>sudo aa-complain \/usr\/sbin\/httpd\r\nsudo aa-enforce \/usr\/sbin\/httpd<\/pre>\n<p>Load or reload an updated policy:<\/p>\n<pre>sudo apparmor_parser<\/pre>\n<p>Read the logs and prompt the user to permit any detected forbidden actions:<\/p>\n<pre>sudo aa-logprof<\/pre>\n<p>Merge policies:<\/p>\n<pre>sudo aa-mergeprof<\/pre>\n<p>Force stop and remove AppArmor:<\/p>\n<pre>sudo invoke-rc.d apparmor kill\r\nsudo update-rc.d -f apparmor remove<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>AppArmor is a Linux kernel security module that restricts program capabilities using per-program profiles. AppArmor [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,6],"tags":[],"class_list":["post-2532","post","type-post","status-publish","format-standard","hentry","category-linux","category-raspberry-pi"],"_links":{"self":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/2532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2532"}],"version-history":[{"count":9,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/2532\/revisions"}],"predecessor-version":[{"id":5706,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/2532\/revisions\/5706"}],"wp:attachment":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}