mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-05-03 00:44:53 -04:00
Create hide-hardware-info
This commit is contained in:
parent
ddc778b452
commit
9449f5017a
1 changed files with 21 additions and 0 deletions
21
usr/lib/security-misc/hide-hardware-info
Normal file
21
usr/lib/security-misc/hide-hardware-info
Normal file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
## sysfs and debugfs expose a lot of information
|
||||
## that should not be accessible by an unprivileged
|
||||
## user which includes hardware info, debug info and
|
||||
## more. This restricts /sys, /proc/cpuinfo, /proc/bus
|
||||
## and /proc/scsi to the root user only. This hides
|
||||
## many hardware identifiers from ordinary users
|
||||
## and increases security.
|
||||
for i in /proc/cpuinfo /proc/bus /proc/scsi /sys
|
||||
do
|
||||
if [ -e "${i}" ]; then
|
||||
chmod og-rwx "${i}"
|
||||
else
|
||||
## /proc/scsi doesn't exist on Debian so errors
|
||||
## are expected here.
|
||||
if ! [ "${i}" = "/proc/scsi" ]; then
|
||||
echo "ERROR: ${i} could not be found."
|
||||
fi
|
||||
fi
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue