Securing the Linux kernel with lockdown mode
Additional Safeguards
If you want to use lockdown mode, you need to monitor a few additional factors when operating your environment. After all, lockdown and any other security feature will not help if an attacker can disable them without being noticed.
Lockdown mode cannot prevent every possible security issue – for example, an admin can change certain files on the system. It is possible that a bad guy could quickly reconfigure GRUB to prevent lockdown mode from being activated in the first place.
Regular Checks
Discovering whether lockdown mode is still active is most easily done at the command line. During monitoring, you will want to check whether the lockdown
parameter is defined in the /proc/cmdline
file and whether it has a value of confidentiality
or integrity
. The LSM lockdown
module also needs to appear in the kernel command line, otherwise the lockdown
parameter has no effect.
Even without a lockdown mode in the kernel, all the alarms should go off if a system reboots unexpectedly. Most of the time, a sudden reboot is due to a broken hardware device or driver. But you need clarity about the root cause quickly. The problem could also be an attacker rebooting the system after changing the boot loader configuration. For this reason, I would recommend monitoring a few additional files of system config for example, /boot/grub/grub.cfg
.
Do Not Feel Too Secure
Every admin should also be clear that absolute security does not exist. State-financed hackers usually spare no effort and are therefore capable of carrying out highly complex attacks. In fact, an attacker could simply overwrite the boot loader and use their own configuration file so that the grub.cfg
stored on the system is not changed. You would only find out about this by checking if the currently running kernel is the one delivered by the manufacturer. If you want to secure your system against such attacks, you have a great deal of work to do. Lockdown mode in the Linux kernel is certainly not a carte blanche that lets you put your feet up and stop worrying about security.
This raises the question as to whether there are also things that Linux kernel lockdown mode does not protect systems against. The answer to this question is a resounding yes.
For example, lockdown does nothing at all to protect you against hardware-related errors. Prominent examples of hardware-based security flaws include the Spectre and Meltdown attacks that caused alarm throughout the Linux community a couple years ago. Although Spectre and Meltdown are now rendered harmless by other kernel workarounds, lockdown mode would not have been able to offer any protection against these bugs.
Similarly, the Linux kernel itself has unnoticed bugs that bypass lockdown mode. This was the case in June 2020, for example, when a bug in the ACPI code allowed kernel code to be smuggled past the UEFI Secure boot interface – and also past the lockdown module.
« Previous 1 2 3 4 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
AlmaLinux OS Kitten 10 Gives Power Users a Sneak Preview
If you're looking to kick the tires of AlmaLinux's upstream version, the developers have a purrfect solution.
-
Gnome 47.1 Released with a Few Fixes
The latest release of the Gnome desktop is all about fixing a few nagging issues and not about bringing new features into the mix.
-
System76 Unveils an Ampere-Powered Thelio Desktop
If you're looking for a new desktop system for developing autonomous driving and software-defined vehicle solutions. System76 has you covered.
-
VirtualBox 7.1.4 Includes Initial Support for Linux kernel 6.12
The latest version of VirtualBox has arrived and it not only adds initial support for kernel 6.12 but another feature that will make using the virtual machine tool much easier.
-
New Slimbook EVO with Raw AMD Ryzen Power
If you're looking for serious power in a 14" ultrabook that is powered by Linux, Slimbook has just the thing for you.
-
The Gnome Foundation Struggling to Stay Afloat
The foundation behind the Gnome desktop environment is having to go through some serious belt-tightening due to continued financial problems.
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.