{"id":2532,"date":"2021-11-06T16:06:17","date_gmt":"2021-11-06T16:06:17","guid":{"rendered":"https:\/\/dft.wiki\/?p=2532"},"modified":"2026-04-21T13:32:08","modified_gmt":"2026-04-21T17:32:08","slug":"apparmor","status":"publish","type":"post","link":"https:\/\/dft.wiki\/?p=2532","title":{"rendered":"Enhancing Linux Security with AppArmor no Ubuntu"},"content":{"rendered":"<p>Application Armor is a Linux kernel security module for restricting programs&#8217; capabilities by using per-program profiles.<\/p>\n<p>AppArmor uses the Linux Security Modules (LSM) kernel interface and does not apply to all of the running applications at the system but only on those to which a profile is created and assigned.<\/p>\n<p>It may be required to install an additional package to be able to manage the profiles:<\/p>\n<pre>sudo apt install apparmor-profiles -y<\/pre>\n<p>The profiles can allow\/deny capabilities suck as network, read, write, or execute files on matching paths.<\/p>\n<pre>sudo apparmor_status\r\nsudo aa-status<\/pre>\n<p>The 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\/script:<\/p>\n<pre>sudo aa-genprof \/usr\/sbin\/httpd<\/pre>\n<p>Set a profile to complain and enforce modes.<\/p>\n<pre>sudo aa-complain \/usr\/sbin\/httpd\r\nsudo aa-enforce \/usr\/sbin\/httpd<\/pre>\n<p>Load\/reload an altered policy.<\/p>\n<pre>sudo apparmor_parser<\/pre>\n<p>Read the logs and ask the user if he wants to permit some of the detected forbidden actions.<\/p>\n<pre>sudo aa-logprof<\/pre>\n<p>Merge the policies.<\/p>\n<pre>sudo aa-mergeprof<\/pre>\n<p>Force stopping\/removing 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>Application Armor is a Linux kernel security module for restricting programs&#8217; capabilities by using per-program [&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":8,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/2532\/revisions"}],"predecessor-version":[{"id":5476,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/2532\/revisions\/5476"}],"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}]}}