CPUs also come with bugs and, in some cases, can become security vulnerabilities. At the time of writing this, the most famous cases of such bugs are the meltdown and spectre vulnerabilities.
To check out what known vulnerabilities your CPU has, perform these steps.
-
Open a shell as your administrator user, and execute the following.
$ cat /proc/cpuinfo | grep bugs
-
The output will be one line per core on your CPU. So, in an old four single-threaded cores Intel CPU like mine it looks like below.
bugs : cpu_meltdown spectre_v1 spectre_v2 mds msbds_only bugs : cpu_meltdown spectre_v1 spectre_v2 mds msbds_only bugs : cpu_meltdown spectre_v1 spectre_v2 mds msbds_only bugs : cpu_meltdown spectre_v1 spectre_v2 mds msbds_only
As you may expect, the list of vulnerabilities will change depending on the CPU.
To mitigate these bugs, you can install the proper microcode apt
package for your CPU: the intel-microcode
or the amd-microcode
one. But to do so, first you need to enable the proper apt
sources so those packages can be downloaded in your system.
-
Log in as
mgrsys
, thencd
to/etc/apt/sources.list.d
.$ cd /etc/apt/sources.list.d
-
Create a new file called
debian-nonfree.list
.$ sudo touch debian-nonfree.list
-
Edit the
debian-nonfree.list
file, filling it with the lines below.deb http://deb.debian.org/debian bullseye non-free deb-src http://deb.debian.org/debian bullseye non-free deb http://deb.debian.org/debian-security/ bullseye-security non-free deb-src http://deb.debian.org/debian-security/ bullseye-security non-free deb http://deb.debian.org/debian bullseye-updates non-free deb-src http://deb.debian.org/debian bullseye-updates non-free
BEWARE!
This sources list is only for Debian 11 Bullseye! -
Save the file, update
apt
and then install the package that suits your CPU. In my case, I'll apply theintel-microcode
package.$ sudo apt update $ sudo apt install -y intel-microcode
-
After the package's installation is done, reboot your system.
$ sudo reboot
BEWARE!
The microcode package can affect the performance of your CPU. Also, the microcode applied may just mitigate rather than completely fix the vulnerabilities on your CPU.
/etc/apt/sources.list.d
/proc
/etc/apt/sources.list.d/debian-nonfree.list
/proc/cpuinfo
<< Previous (G012. Host hardening 06) | +Table Of Contents+ | Next (G014. Host hardening 08) >>