refactoring

This commit is contained in:
Patrick Schleizer 2024-10-28 05:06:05 -04:00
parent d00235897d
commit fdd1f4b7f8
No known key found for this signature in database
GPG Key ID: CB8D50BB77BB3C48

View File

@ -17,21 +17,25 @@ run_cmd_whitelist() {
echo "$0: INFO: START"
sysfs_whitelist=1
cpuinfo_whitelist=1
default_variables_set() {
sysfs_whitelist=1
cpuinfo_whitelist=1
sysfs=1
sysfs=1
## https://www.kicksecure.com/wiki/Security-misc#selinux
selinux=0
## https://www.kicksecure.com/wiki/Security-misc#selinux
selinux=0
}
shopt -s nullglob
## Allows for disabling the whitelist.
for i in /usr/local/etc/hide-hardware-info.d/*.conf /etc/hide-hardware-info.d/*.conf ; do
parse_configuration() {
## Allows for disabling the whitelist.
for i in /usr/local/etc/hide-hardware-info.d/*.conf /etc/hide-hardware-info.d/*.conf ; do
bash -n "${i}"
source "${i}"
done
done
}
create_whitelist() {
if [ "${1}" = "sysfs" ]; then
@ -55,6 +59,9 @@ create_whitelist() {
fi
}
default_variables_set
parse_configuration
## sysfs and debugfs expose a lot of information
## that should not be accessible by an unprivileged
## user which includes hardware info, debug info and