<div dir="ltr">Hi All,<br><br>I have successfully set up the apparmor in my Linux machine.<br><br>Requirement:<br><br>- Trying to find the list of capabilities needed for this below code which runs in "unprivileged" mode [ nobody user ]<br>- The below code while executes, permission denied for write operation and killing init process <br>cat /tmp/kill.sh<br>#!/bin/sh<br>echo "Exploring apparmor"<br>while [ 1 ]<br>do<br>cat /nvram/foo<br>echo "TEST" > /nvram/foo    => This operation won't be successful due to permission issue.<br>killall root_process        =>  This operation won't be successful due to permission issue.<br>sleep 5<br>done<br><br>ls -ltr /nvram/foo<br>-rw-r--r--    1 root     root             0 Aug  1 22:23 /nvram/foo<br><br>~# /tmp/kill.sh<br>~# su nobody<br>nobody@:/home/root$<br>nobody@/home/root$<br>nobody@:/home/root$<br>nobody@:/home/root$ /tmp/kill.sh &<br>[1] 18981<br>nobody@:/home/root$ Exploring apparmor<br>/tmp/kill.sh: line 6: /nvram/foo: Permission denied<br>killall: can't kill pid 4404: Operation not permitted<br><br><br>Analysis:<br><br>While running this process (complain) mode in apparmor, I assume the required capabilities will be apparmor event logs.<br><br>Please note that, the process runs in "unprivileged (nobody) user.<br><br>For write operation while the process is running in nobody user mode, it needs CAP_DAC_OVERRIDE capability to complete the write operation.<br><br>For kill operation, while the process is running in nobody user mode, it needs CAP_KILL capability to complete the kill operation.<br><br><br>Query 1:<br><br>- But I do not see CAP_DAC_OVERRIDE and CAP_KILL in apparmor event logs.<br><br>Query 2:<br><br>- How apparmor identities how many capabilities are needed for the process?<br><br>Query 3:<br><br>- Does all system calls need capability when it runs in a non-root process, how does apparmor mapping the linux capabilities?<br><br>Can someone please clarify these queries?<div><br></div><div>Thankx</div><div>Murali.S<br><br><br><br><br><br><br><br><br><br><br><br><br></div></div>