I am a Linux newbie, however, I was experimenting today with creating profiles for some applications. I have watched some YouTube videos on how to work it, and I have stumbled upon a few things that didn’t work as expected.
1- First problem I faced is that “aa-genprof” wasn’t working as advertized.
I have tried to create a profile for KTorrent as follows:
sudo aa-genprof ktorrent
Then I ran KTorrent, to populate the logs. Then I started using the “Scan” functionality. It didn’t catch any events/logs, even though manually reading the logs at “/var/logs/audit/audit.log” was populating events.
So, what I had to do is “Finish”, then manually using:
sudo aa-complain ktorrent
sudo aa-logprof -f /var/logs/audit/audit.log
Which worked as expected.
Could someone help me find out why my (default) installation of AppArmor is not running as expected?
2- Second problem I faced is using the Firefox profile found in “/usr/share/apparmor/extra-profiles/usr.lib.firefox.firefox”.
First of all, the Firefox binary is located at “/usr/lib64/firefox/firefox” NOT “/usr/lib/firefox/firefox”. So, I had to manually fix the profile as follows:
su -c "cat /usr/share/apparmor/extra-profiles/usr.lib.firefox.firefox | sed 's#/usr/lib/#/usr/lib{,64}/#' > /etc/apparmor.d/usr.lib64.firefox.firefox"
Which effectively modifies the file such that it accepts both “lib” and “lib64” in the directory path. However, when running “sudo aa-complain /usr/lib64/firefox/firefox”, I get the following error message:
Setting /usr/lib64/firefox/firefox to complain mode.
ERROR: /etc/apparmor.d/usr.lib64.firefox.firefox contains no profile
Even though “cat /etc/apparmor.d/usr.lib64.firefox.firefox” shows expected file contents. link]
What gives?