mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-05-04 02:04:53 -04:00
refactoring
This commit is contained in:
parent
d00235897d
commit
fdd1f4b7f8
1 changed files with 17 additions and 10 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue