run permission hardener when new packages are install files to /usr or /opt

(basically anywhere)

fixes https://github.com/Kicksecure/security-misc/issues/189
This commit is contained in:
Patrick Schleizer 2024-01-17 13:23:20 -05:00
parent 66e6371221
commit 18a06935e0
No known key found for this signature in database
GPG Key ID: CB8D50BB77BB3C48
2 changed files with 6 additions and 26 deletions

View File

@ -33,17 +33,16 @@ permission_hardening_legacy_config_folder() {
}
permission_hardening() {
echo ""
echo "Running SUID Disabler and Permission Hardener... See also:"
echo "https://www.kicksecure.com/wiki/SUID_Disabler_and_Permission_Hardener"
echo ""
echo "$0: INFO: running: permission-hardener enable"
echo ""
if ! permission-hardener enable ; then
echo "$0: ERROR: Permission hardening failed." >&2
return 0
fi
echo "$0: INFO: Permission hardening success."
echo ""
echo "$0: INFO: Permission hardening success."
}
case "$1" in
@ -64,6 +63,7 @@ case "$1" in
echo "INFO: triggered $DPKG_MAINTSCRIPT_PACKAGE: '$DPKG_MAINTSCRIPT_PACKAGE' $DPKG_MAINTSCRIPT_PACKAGE DPKG_MAINTSCRIPT_NAME: '$DPKG_MAINTSCRIPT_NAME' $\@: '$@' 2: '$2'"
/usr/share/security-misc/lkrg/lkrg-virtualbox || true
/usr/libexec/security-misc/mmap-rnd-bits || true
permission_hardening
exit 0
;;

View File

@ -1,25 +1,5 @@
## Copyright (C) 2019 - 2023 ENCRYPTED SUPPORT LP <adrelanos@whonix.org>
## Copyright (C) 2024 - 2024 ENCRYPTED SUPPORT LP <adrelanos@whonix.org>
## See the file COPYING for copying conditions.
#### meta start
#### project Kicksecure
#### category security
#### description
## Trigger 'activate-noawait update-initramfs' also works with both,
## initramfs-tools as well as dracut.
## - Activate initramfs hook that sets the sysctl values before init is executed.
## - dracut module 20remount-secure
activate-noawait update-initramfs
## LKRG /usr/share/security-misc/lkrg/lkrg-virtualbox
interest-noawait /usr/bin/vboxmanage
## /usr/libexec/security-misc/mmap-rnd-bits
## auto generates:
## /etc/sysctl.d/30_security-misc_aslr-mmap.conf
## sets:
## vm.mmap_rnd_bits
interest-noawait /boot
#### meta end
interest-await /usr
interest-await /opt