Ver código fonte

ME might affect many x86 installs, so instead of stopping the show just remove the interface, which reduces risks a little

Bob Mottram 8 anos atrás
pai
commit
c9a1c8b510
2 arquivos alterados com 30 adições e 8 exclusões
  1. 1
    1
      src/freedombone-tests
  2. 29
    7
      src/freedombone-utils-setup

+ 1
- 1
src/freedombone-tests Ver arquivo

@@ -1148,7 +1148,7 @@ fi
1148 1148
 
1149 1149
 test_app_functions
1150 1150
 test_unique_onion_ports
1151
-check_for_AMT
1151
+remove_management_engine_interface
1152 1152
 fix_stig
1153 1153
 test_stig
1154 1154
 

+ 29
- 7
src/freedombone-utils-setup Ver arquivo

@@ -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