Inspect security settings in /sys/kernel/security
In this final step, we will explore the /sys/kernel/security
directory. The /sys
filesystem is another virtual filesystem that provides an interface to kernel data structures. The /sys/kernel/security
directory specifically contains information and controls related to the Linux Security Modules (LSMs) loaded by the kernel.
LSMs are frameworks that allow the kernel to support a variety of security models. Examples include SELinux, AppArmor, and others.
Let's list the contents of this directory using the ls
command. The ls
command lists directory contents.
Type the following command into your terminal and press Enter:
ls /sys/kernel/security/
You will see output similar to this, depending on the loaded LSMs:
apparmor lockdown lsm selinux
This output shows the subdirectories within /sys/kernel/security
. Each subdirectory often corresponds to a loaded LSM or a security feature like lockdown
.
You can further inspect the contents of these subdirectories using ls
and cat
. For example, to see the contents of the lockdown
directory within /sys/kernel/security
, you could use:
ls /sys/kernel/security/lockdown/
And to view the content of a file within that directory, for instance, the lockdown
file itself (which might contain similar information to /proc/sys/kernel/lockdown
), you could use:
cat /sys/kernel/security/lockdown
Exploring the /sys/kernel/security
directory provides deeper insight into the active security modules and their configurations on your system.
You have now learned how to check the kernel lockdown status using different methods and explored the kernel security interface in the /sys
filesystem.
Click Continue to complete the lab.