Przeglądaj źródła

SecImprove: limit unpriv user to see only their own processes

Robert Zollner 5 lat temu
rodzic
commit
47d375ca7f

+ 4 - 0
install/hst-install-debian.sh

@@ -929,6 +929,10 @@ if [ ! "$release" -eq 10 ]; then
     chmod 755 /usr/bin/rssh
     chmod 755 /usr/bin/rssh
 fi
 fi
 
 
+# Restrict access to /proc fs
+# - Prevent unpriv users from seeing each other running processes
+mount -o remount,defaults,hidepid=2 /proc
+echo "@reboot root sleep 5 && mount -o remount,defaults,hidepid=2 /proc" > /etc/cron.d/hestia-proc
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                     Configure Hestia                     #
 #                     Configure Hestia                     #

+ 5 - 0
install/hst-install-ubuntu.sh

@@ -973,6 +973,11 @@ if [ ! -e "/sbin/iptables-restore" ]; then
     fi
     fi
 fi
 fi
 
 
+# Restrict access to /proc fs
+# - Prevent unpriv users from seeing each other running processes
+mount -o remount,defaults,hidepid=2 /proc
+echo "@reboot root sleep 5 && mount -o remount,defaults,hidepid=2 /proc" > /etc/cron.d/hestia-proc
+
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                     Configure Hestia                     #
 #                     Configure Hestia                     #

+ 8 - 1
install/upgrade/versions/1.3.0.sh

@@ -60,4 +60,11 @@ fi
  
  
 # Set var LOGIN_STYLE hestia.conf
 # Set var LOGIN_STYLE hestia.conf
  echo "[ * ] Set var LOGIN_STYLE hestia.conf"
  echo "[ * ] Set var LOGIN_STYLE hestia.conf"
- $BIN/v-change-sys-config-value "LOGIN_STYLE" "default" 
+ $BIN/v-change-sys-config-value "LOGIN_STYLE" "default"
+
+# Restrict access to /proc fs
+if [ ! -e "/etc/cron.d/hestia-proc" ]; then
+    echo "[ * ] Restrict access to /proc fs"
+    echo "@reboot root sleep 5 && mount -o remount,defaults,hidepid=2 /proc" > /etc/cron.d/hestia-proc
+    mount -o remount,defaults,hidepid=2 /proc
+fi