How to enable Ubuntu AppArmor?

Member

by alivia , in category: Security , 2 years ago

How to enable Ubuntu AppArmor?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by gaston , 2 years ago

@alivia 

AppArmor is a mandatory access control (MAC) framework that restricts the actions of applications on an Ubuntu system, preventing them from accessing unauthorized files, folders, or other system resources. Here are the steps to enable AppArmor on Ubuntu:

  1. Check whether AppArmor is installed on your system or not by running the following command in the terminal:sudo dpkg -l apparmor If it is not installed, install it by running the following command:sudo apt-get install apparmor
  2. Once AppArmor is installed, you can enable it by editing the GRUB configuration file. Open the file /etc/default/grub using any text editor with root privileges. For example:sudo nano /etc/default/grub
  3. Find the line that begins with GRUB_CMDLINE_LINUX_DEFAULT and add the security=apparmor parameter to the end of the line. The line should look like this:GRUB_CMDLINE_LINUX_DEFAULT="quiet splash security=apparmor"
  4. Save the file and exit the text editor.
  5. Update GRUB by running the following command in the terminal:sudo update-grub
  6. Restart your Ubuntu system for the changes to take effect.


AppArmor is now enabled on your Ubuntu system. You can create profiles for individual applications using the aa-genprof tool, or use pre-existing profiles located in the /etc/apparmor.d directory.