<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Mandatory Access Control on</title><link>https://docs.protegrity.com/10.2/docs/aog/mandatory_access_control/</link><description>Recent content in Mandatory Access Control on</description><generator>Hugo</generator><language>en</language><atom:link href="https://docs.protegrity.com/10.2/docs/aog/mandatory_access_control/index.xml" rel="self" type="application/rss+xml"/><item><title>Working with profiles</title><link>https://docs.protegrity.com/10.2/docs/aog/mandatory_access_control/aog_working_with_profiles/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://docs.protegrity.com/10.2/docs/aog/mandatory_access_control/aog_working_with_profiles/</guid><description>&lt;h2 id="creating-a-profile">Creating a Profile&lt;/h2>
&lt;p>In addition to the existing profiles in the appliances, AppArmor allows creating profiles for other executable files present in the system. Using the &lt;code>aa-genprof&lt;/code> command, you can create a profile to protect a file. When this command is run, AppArmor loads that file in &lt;strong>complain&lt;/strong> mode and provides an option to analyze all the activities that might arise. It learns about all the activities that are present in the file and suggests the permissions that can be applied on them. After the permissions are assigned to the file, the profile is created and set in the &lt;strong>enforce&lt;/strong> mode.&lt;/p></description></item><item><title>Analyzing events</title><link>https://docs.protegrity.com/10.2/docs/aog/mandatory_access_control/aog_analyzing_events/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://docs.protegrity.com/10.2/docs/aog/mandatory_access_control/aog_analyzing_events/</guid><description>&lt;p>AppArmor provides an interactive tool to analyze the events occurring in the system. The &lt;code>aa-logprof&lt;/code> is one such utility that scans the logs for the events in your system. The &lt;code>aa-logprof&lt;/code> command scans the logs and provides a set actions for modifying a profile.&lt;/p>
&lt;p>Consider the &lt;strong>apparmor_example.sh&lt;/strong> script that is in the &lt;strong>enforce&lt;/strong> mode. After a certain period of time, you modify the script and insert a command to list all the files in the directory. When you run the &lt;strong>apparmor_example.sh&lt;/strong> script, a &lt;strong>Permission denied&lt;/strong> error appears on the screen. As a new command is added to this script and &lt;a href="https://docs.protegrity.com/10.2/docs/aog/mandatory_access_control/aog_apparmr_permissions/">permissions&lt;/a> are not assigned to the updated entry, AppArmor does not allow the script to run. The permissions must be assigned before the script is executed. To evaluate the permissions that can be applied to the new entries, you can view the logs for details. On the ESA CLI Manager, the logs are available in the &lt;strong>audit.log&lt;/strong> file in the &lt;strong>/var/log/&lt;/strong> directory. The following figure displays the logs that appear for the &lt;strong>apparmor_example.sh&lt;/strong> script.&lt;/p></description></item><item><title>AppArmor permissions</title><link>https://docs.protegrity.com/10.2/docs/aog/mandatory_access_control/aog_apparmr_permissions/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://docs.protegrity.com/10.2/docs/aog/mandatory_access_control/aog_apparmr_permissions/</guid><description>&lt;p>The following table describes the different permissions that AppArmor lists when creating a profile or analyzing events.&lt;/p>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>Permission&lt;/th>
 &lt;th>Description&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>(I)nherit&lt;/td>
 &lt;td>Inherit the permissions from the parent profile.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>(A)llow&lt;/td>
 &lt;td>Allow access to a path.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>(I)gnore&lt;/td>
 &lt;td>Ignore the prompt.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>(D)eny&lt;/td>
 &lt;td>Deny access to a path.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>(N)ew&lt;/td>
 &lt;td>Create a new profile.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>(G)lob&lt;/td>
 &lt;td>Select a specific path or create a general rule using wild cards that match a broader set of paths.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Glob with (E)xtension&lt;/td>
 &lt;td>Modify the original directory path while retaining the filename extension.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>(C)hild&lt;/td>
 &lt;td>Creates a rule in a profile, requires a sub-profile to be created in the parent profile, and rules must be separately generated for this child.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Abo(r)t&lt;/td>
 &lt;td>Exit AppArmor without saving the changes.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>(F)inish&lt;/td>
 &lt;td>Finish scanning for the profile.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>(S)ave&lt;/td>
 &lt;td>Save the changes for the profile.&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table></description></item><item><title>Troubleshooting for AppArmor</title><link>https://docs.protegrity.com/10.2/docs/aog/mandatory_access_control/aog_apparmr_ts/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://docs.protegrity.com/10.2/docs/aog/mandatory_access_control/aog_apparmr_ts/</guid><description>&lt;p>The following table describes solutions to issues that you might encounter while using AppArmor .&lt;/p>
&lt;table border="1" width="100%">
 &lt;thead>
 &lt;tr >
 &lt;td >Issue&lt;/td>
 &lt;td >Reason&lt;/td>
 &lt;td >Solution&lt;/td>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr >
 &lt;td >After you run the File Export or File Import operation in the ESA, the following message appears in the logs:
 &lt;pre>type=AVC msg=audit(1594813145.658:7306): apparmor="DENIED" operation="exec" profile="/usr/sbin/apache2" name="/usr/lib/sftp-server" pid=58379 comm="bash" requested_mask="x"* denied_mask="x" *fsuid=0 ouid=0FSUID="root" OUID="root"&lt;/pre>
 &lt;/td>
 &lt;td > &lt;/td>
 &lt;td >Perform the following steps:
 &lt;ol>
 &lt;li>On the CLI Manager, navigate to &lt;span>&lt;b>Administration&lt;/b> → &lt;b>OS Console&lt;/b>&lt;/span>&lt;/li>
 &lt;li>Navigate to the
 &lt;code>/etc/apparmor.d/custom&lt;/code> directory.&lt;/li>
 &lt;li>Edit the &lt;code>usr.sbin.apache2&lt;/code>
 profile.&lt;/li>
 &lt;li>Insert the following line.
 &lt;pre>/usr/lib/sftp-server rix,&lt;/pre>
 &lt;/li>
 &lt;li>Restart the AppArmor service using the following command.
 &lt;pre>/etc/init.d/apparmor restart&lt;/pre>
 &lt;/li>
 &lt;/ol>
 &lt;/td>
 &lt;/tr>
 &lt;tr >
 &lt;td >If a scheduler task containing a customized script is run,
 then the scheduled task is not executed and a denial message
 appears in the log. For example, if a task scheduler contains the
 &lt;code>/demo.sh&lt;/code> script in the command line, the
 following message appears in the logs. 
 &lt;pre>type=AVC msg=audit(1598429205.615:35253): apparmor="DENIED" operation="exec" profile="/usr/sbin/apache2" name="/demo.sh" pid=32684 comm=".taskV5FLVl.tmp" requested_mask="x" denied_mask="x" fsuid=0 ouid=0FSUID="root" OUID="root"&lt;/pre>
 &lt;/td>
 &lt;td >AppArmor restricts running any custom scripts from the
 scheduled task&lt;/td>
 &lt;td >Perform the following steps.
 &lt;ol>
 &lt;li>On the CLI Manager, navigate to &lt;span>&lt;b>Administration&lt;/b> → &lt;b>OS Console&lt;/b>&lt;/span>&lt;/li>
 &lt;li>Navigate to the
 &lt;code>/etc/apparmor.d/custom&lt;/code> directory.&lt;/li>
 &lt;li>Edit the &lt;code>usr.sbin.apache2&lt;/code>
 profile.&lt;/li>
 &lt;li>Insert the following line.
 &lt;pre>/demo.sh rix,&lt;/pre>
 &lt;/li>
 &lt;li>Restart the AppArmor service using the following
 command.
 &lt;pre>/etc/init.d/apparmor restart&lt;/pre>
 &lt;/li>
 &lt;/ol>
 &lt;/td>
 &lt;/tr>
 &lt;tr >
 &lt;td >If you run the &lt;b>Put Files&lt;/b> operation
 between two machines in a TAC, the following messages appear as
 logs in the source and target appliances. 
 &lt;div>Source appliance
 &lt;pre>type=AVC msg=audit(1598288495.530:5168): apparmor="DENIED" operation="mknod" profile="/etc/opt/Cluster/cluster_helper" name="/dummyfilefortest.sh" pid=62621 comm="mv" requested_mask="c" denied_mask="c" fsuid=0 ouid=0FSUID="root" OUID="root"&lt;/pre>
 &lt;/div>
 &lt;div>Target appliance 
 &lt;pre>type=AVC msg=audit(1598288495.950:2116): apparmor="DENIED" operation="chown" profile="/etc/opt/Cluster/cluster_helper" name="/dummyfilefortest.sh" pid=17413 comm="chown" requested_mask="w" denied_mask="w" fsuid=0 ouid=0FSUID="root" OUID="root"&lt;/pre>
 &lt;/div>
 &lt;/td>
 &lt;td > &lt;/td>
 &lt;td >Perform the following steps.
 &lt;ol>
 &lt;li>On the CLI Manager, navigate to &lt;span>&lt;b>Administration&lt;/b> → &lt;b>OS Console&lt;/b>&lt;/span>&lt;/li>
 &lt;li>Navigate to the
 &lt;code>/etc/apparmor.d/custom&lt;/code> directory.&lt;/li>
 &lt;li>Edit the
 &lt;code>etc.opt.Cluster.cluster_helper&lt;/code>
 profile.&lt;/li>
 &lt;li>Insert the following line on the source
 appliance
 &lt;pre>/&amp;lt;filename&amp;gt; cix,&lt;/pre>
 &lt;/li>
 &lt;li>Insert the following line on the target
 appliance
 &lt;pre>/&amp;lt;filename&amp;gt; wix,&lt;/pre>
 &lt;/li>
 &lt;li>Restart the AppArmor service on the source and target
 appliances using the following command.
 &lt;pre>/etc/init.d/apparmor restart&lt;/pre>
 &lt;/li>
 &lt;/ol>
 &lt;/td>
 &lt;/tr>
 &lt;/tbody>
 &lt;/table></description></item></channel></rss>