<div dir="ltr">Hi All,<br><br>Please see below two queries and share your valuable inputs.<br><br><b><font face="arial black, sans-serif">Question 1: </font></b><br><br>I am trying to generate an Apparmor profile similar to the below pseudo script.<br><br><b>foo.sh</b><br>#!/bin/sh<br>if condition<br>   /bin/sh script_1.sh<br>fi<br>/bin/sh script_2.sh<br>while [ condition ]<br>do  <br>   if [ condition ]<br>        /bin/sh script_3.sh<br>   else<br>        /bin/sh script_4.sh<br>   fi<br>done<br><br><b><font face="times new roman, serif">Queries:</font></b><br><br>-  If we create a separate profile for each script (for instance, script1_1.sh)  and consolidate to one profile for foo.sh<br>-  However, we will try to perform/exercise all possible test cases to execute all code paths while running in complain mode to gather logs<br>   for preparing the profiles.<br>-  Do we have any recommendations to prepare an Apparmor profile for Linux scripts?<br><br><b><font face="arial black, sans-serif">Question 2:</font></b><br><br>- In my embedded system most of the rootfs files are in READ-ONLY except a few directory,files are READ-WRITE (for instance, non-volatile partitions and so on).<br>- All libraries in my device rootfs are located in READ-ONLY folders ( /lib/, /usr/lib and so on).<br>- While preparing profiles for my applications, I am adding each entry of the library as per the application access.<br><br>  /lib/** mr,<br>  /usr/lib/** mr,<br><br>- Since all libraries are in READ-ONLY, if we allow all libraries (with wild-card) any possible security leak?<br>- Do we still have command-line injection possible to the library too? I am trying to understand here, how do we affect security leaks if we allow all libraries (since they are in READ-ONLY directory).<br><div><br></div><div>Thanks</div><div>Murali.S</div></div>