|
@@ -371,11 +371,33 @@ function disable_nfs_insecure_locks {
|
371
|
371
|
fi
|
372
|
372
|
}
|
373
|
373
|
|
374
|
|
-function check_for_AMT {
|
375
|
|
- pci_hardware=$(lspci)
|
376
|
|
- if [[ "$pci_hardware" == *"MEI"* || "$pci_hardware" == *"HECI"* ]]; then
|
377
|
|
- echo $'Intel Active Management Technology (Management Engine) was detected. This is an active backdoor.'
|
378
|
|
- exit 782352
|
|
374
|
+function remove_management_engine_interface {
|
|
375
|
+ # see https://www.kernel.org/doc/Documentation/misc-devices/mei/mei.txt
|
|
376
|
+ # Disabling this interface doesn't cure the problems of ME, but it
|
|
377
|
+ # might stop an adversary in control of AMT from using the command
|
|
378
|
+ # interface to control the operating system.
|
|
379
|
+ if [ -f /dev/mei0 ]; then
|
|
380
|
+ rmmod mei_me
|
|
381
|
+ rmmod mei0
|
|
382
|
+ fi
|
|
383
|
+
|
|
384
|
+ blacklist_changed=
|
|
385
|
+ if [ ! -f /etc/modprobe.d/blacklist.conf ]; then
|
|
386
|
+ touch /etc/modprobe.d/blacklist.conf
|
|
387
|
+ blacklist_changed=1
|
|
388
|
+ fi
|
|
389
|
+ if ! grep -q "blacklist mei" /etc/modprobe.d/blacklist.conf; then
|
|
390
|
+ echo "blacklist mei" >> /etc/modprobe.d/blacklist.conf
|
|
391
|
+ blacklist_changed=1
|
|
392
|
+ fi
|
|
393
|
+ if ! grep -q "blacklist mei_me" /etc/modprobe.d/blacklist.conf; then
|
|
394
|
+ echo "blacklist mei_me" >> /etc/modprobe.d/blacklist.conf
|
|
395
|
+ blacklist_changed=1
|
|
396
|
+ fi
|
|
397
|
+
|
|
398
|
+ if [ $blacklist_changed ]; then
|
|
399
|
+ depmod -ae -E
|
|
400
|
+ update-initramfs -u
|
379
|
401
|
fi
|
380
|
402
|
}
|
381
|
403
|
|
|
@@ -609,8 +631,8 @@ function setup_utils {
|
609
|
631
|
read_config_param "PROJECT_REPO"
|
610
|
632
|
write_config_param "PROJECT_REPO" "$PROJECT_REPO"
|
611
|
633
|
|
612
|
|
- function_check check_for_AMT
|
613
|
|
- check_for_AMT
|
|
634
|
+ function_check remove_management_engine_interface
|
|
635
|
+ remove_management_engine_interface
|
614
|
636
|
|
615
|
637
|
function_check separate_tmp_filesystem
|
616
|
638
|
separate_tmp_filesystem 150
|