{"id":4812,"date":"2023-02-07T17:35:00","date_gmt":"2023-02-07T23:35:00","guid":{"rendered":"https:\/\/www.incredigeek.com\/home\/?p=4812"},"modified":"2024-02-29T16:38:32","modified_gmt":"2024-02-29T22:38:32","slug":"selinux-links-and-commands","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/selinux-links-and-commands\/","title":{"rendered":"SELinux Audit Commands and Links"},"content":{"rendered":"\n<p>You can install audit2why by installing the policycoreutils package<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo dnf install policycoreutils-python-utils<\/pre>\n\n\n\n<p>Show what and why something is failing<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">audit2why &lt; \/var\/log\/audit\/audit.log<\/pre>\n\n\n\n<p>Search with ausearch<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ausearch -m avc --start recent<\/pre>\n\n\n\n<p>Create and apply a module to fix the failure<\/p>\n\n\n\n<p>This creates two files, a .pp and .te.  The .pp is the compiled version of the .te<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">audit2allow -M mymodule &lt; \/var\/log\/audit\/audit.log<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">semodule -i mymodule.pp<\/pre>\n\n\n\n<p>Note that &#8220;mymodule.pp&#8221; will replace any previous &#8220;mymodule.pp&#8221;.  If your needing to create multiple modules\/allow multiple exceptions, you can change the name of each module.  <\/p>\n\n\n\n<p>You can also add the rules together then manually compile it.  Refer to the first link for more details.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Links with more info<\/p>\n\n\n\n<p><a href=\"https:\/\/danwalsh.livejournal.com\/24750.html\">https:\/\/danwalsh.livejournal.com\/24750.html<\/a><\/p>\n\n\n\n<p><a href=\"http:\/\/selinuxgame.org\/tutorials\/ausearch\/index.html\">http:\/\/selinuxgame.org\/tutorials\/ausearch\/index.html<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/access.redhat.com\/documentation\/en-us\/red_hat_enterprise_linux\/6\/html\/security-enhanced_linux\/sect-security-enhanced_linux-fixing_problems-allowing_access_audit2allow\">https:\/\/access.redhat.com\/documentation\/en-us\/red_hat_enterprise_linux\/6\/html\/security-enhanced_linux\/sect-security-enhanced_linux-fixing_problems-allowing_access_audit2allow<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can install audit2why by installing the policycoreutils package sudo dnf install policycoreutils-python-utils Show what and why something is failing audit2why &lt; \/var\/log\/audit\/audit.log Search with ausearch ausearch -m avc &#8211;start recent Create and apply a module to fix the failure &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/selinux-links-and-commands\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,573],"tags":[1402,1401,1400,1399,503,207],"class_list":["post-4812","post","type-post","status-publish","format-standard","hentry","category-linux","category-security","tag-audit-log","tag-audit2allow","tag-audit2why","tag-module","tag-security","tag-selinux"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4812","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=4812"}],"version-history":[{"count":7,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4812\/revisions"}],"predecessor-version":[{"id":5744,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4812\/revisions\/5744"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=4812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=4812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=4812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}