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