<div dir="ltr"><div><div><div><div>i am trying to create apparmor profile for ruby file named test.rb and put that file under /root, test.rb contain:<br><br>    #!/usr/bin/env ruby<br>    `mkdir demo`<br><br>i created apparmor profile by following way:<br><br>    aa-genprof test.rb<br><br>above command successfully created apparmor profile for that test.rb, Now i wants that this test.rb file should not create anything inside /root directory except read access. So i made following changes in apparmor profile for test.rb file:<br><br>     Last Modified: Mon Sep 29 06:59:34 2014<br>    #include <tunables/global><br><br>    /root/test.rb {<br>      #include <abstractions/base><br><br>      /root/test.rb mr,<br>      /root/ r,<br>    }<br><br>Now i restart and reloaded apparmor by following way:<br><br>    sudo service apparmor restart<br><br>so i assumed that when i will run my test.rb should not create any directory inside /root directory, But when i run this file like this way:<br><br>    ruby test.rb<br><br>Its create demo directory inside /root<br><br>    ls /root<br>    demo<br><br>I dont understand why this produce this behaviour...<br><br><br></div>There is same question i posted here:<br><br><a href="http://stackoverflow.com/questions/26120464/apparmor-profile-creation-for-ruby-script">http://stackoverflow.com/questions/26120464/apparmor-profile-creation-for-ruby-script</a><br><br></div>Thanks,<br></div>Pradeep Gupta<br></div><a href="mailto:info@dryzilla.com">info@dryzilla.com</a><br>+91-9993125991<br></div>