2023-03-30 02:08:47 -04:00
|
|
|
## Copyright (C) 2012 - 2023 ENCRYPTED SUPPORT LP <adrelanos@whonix.org>
|
2019-12-19 12:01:33 -05:00
|
|
|
## See the file COPYING for copying conditions.
|
|
|
|
|
2019-12-29 04:21:52 -05:00
|
|
|
## Please use "/etc/permission-hardening.d/20_user.conf" or
|
|
|
|
## "/usr/local/etc/permission-hardening.d/20_user.conf" for your custom
|
2019-12-20 05:54:16 -05:00
|
|
|
## configuration. When security-misc is updated, this file may be overwritten.
|
|
|
|
|
2019-12-08 11:50:11 -05:00
|
|
|
## File permission hardening.
|
|
|
|
##
|
|
|
|
## Syntax:
|
|
|
|
## [filename] [mode] [owner] [group] [capability]
|
|
|
|
##
|
2019-12-19 12:01:33 -05:00
|
|
|
## To remove all SUID/SGID binaries in a directory, you can use the "nosuid"
|
|
|
|
## argument.
|
2019-12-20 03:45:01 -05:00
|
|
|
|
2019-12-23 02:38:53 -05:00
|
|
|
## TODO: white spaces inside file name untested and probably will not work.
|
|
|
|
|
2020-12-01 05:14:48 -05:00
|
|
|
######################################################################
|
|
|
|
# Global Settings
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
#whitelists_disable_all=true
|
|
|
|
|
2019-12-23 02:29:47 -05:00
|
|
|
######################################################################
|
|
|
|
# SUID disablewhitelist
|
|
|
|
######################################################################
|
|
|
|
|
2019-12-23 02:38:53 -05:00
|
|
|
## disablewhitelist disables below (or in lexically higher) files
|
|
|
|
## exactwhitelist and matchwhitelist. Add these here (discouraged) or better
|
|
|
|
## in file "/etc/permission-hardening.d/20_user.conf".
|
|
|
|
|
|
|
|
## For example, if you are not using SELinux the following might make sense to
|
|
|
|
## enable. TODO: research
|
2019-12-23 02:35:13 -05:00
|
|
|
#/utempter/utempter disablewhitelist
|
|
|
|
|
2019-12-26 05:44:35 -05:00
|
|
|
## If you are not going to use AppImages such as electrum Bitcoin wallet.
|
|
|
|
#/fusermount disablewhitelist
|
|
|
|
|
2019-12-20 13:02:33 -05:00
|
|
|
######################################################################
|
|
|
|
# SUID exact match whitelist
|
|
|
|
######################################################################
|
|
|
|
|
2019-12-23 03:28:42 -05:00
|
|
|
## In case you need to use 'su'. See also:
|
2022-04-16 14:18:35 -04:00
|
|
|
## https://www.kicksecure.com/wiki/root#su
|
2019-12-23 03:28:42 -05:00
|
|
|
#/bin/su exactwhitelist
|
|
|
|
#/usr/bin/su exactwhitelist
|
|
|
|
|
2019-12-20 13:02:33 -05:00
|
|
|
######################################################################
|
2019-12-23 01:38:31 -05:00
|
|
|
# SUID exact match whitelist
|
2019-12-20 13:02:33 -05:00
|
|
|
######################################################################
|
|
|
|
|
2021-08-01 16:37:02 -04:00
|
|
|
## https://manpages.debian.org/xserver-xorg-legacy/Xorg.wrap.1.en.html
|
2019-12-20 12:59:27 -05:00
|
|
|
## https://lwn.net/Articles/590315/
|
2019-12-21 06:53:07 -05:00
|
|
|
## http://forums.whonix.org/t/permission-hardening/8655/25
|
|
|
|
#/usr/lib/xorg/Xorg.wrap whitelist
|
2019-12-20 12:59:27 -05:00
|
|
|
|
2019-12-20 13:02:33 -05:00
|
|
|
######################################################################
|
2020-12-01 04:28:15 -05:00
|
|
|
# SUID regex match whitelist
|
2019-12-20 13:02:33 -05:00
|
|
|
######################################################################
|
2019-12-20 12:59:27 -05:00
|
|
|
|
2019-12-22 18:57:23 -05:00
|
|
|
######################################################################
|
|
|
|
# SUID regex match whitelist
|
|
|
|
######################################################################
|
|
|
|
|
2019-12-20 13:02:33 -05:00
|
|
|
######################################################################
|
|
|
|
# Permission Hardening
|
|
|
|
######################################################################
|
|
|
|
|
2019-12-08 11:50:11 -05:00
|
|
|
/home/ 0755 root root
|
|
|
|
/root/ 0700 root root
|
|
|
|
/boot/ 0700 root root
|
2019-12-20 05:57:41 -05:00
|
|
|
/etc/permission-hardening.d 0600 root root
|
|
|
|
/usr/local/etc/permission-hardening.d 0600 root root
|
2019-12-23 15:28:29 -05:00
|
|
|
/lib/modules/ 0700 root root
|
2023-10-26 13:45:28 -04:00
|
|
|
/usr/src 0700 root root
|
|
|
|
/etc/cups/cupsd.conf 0400 root root
|
|
|
|
/etc/syslog.conf 0600 root root
|
2023-10-27 06:53:45 -04:00
|
|
|
/etc/ssh/sshd_config 0600 root root
|
2023-10-26 13:45:28 -04:00
|
|
|
/etc/crontab 0600 root root
|
|
|
|
/etc/cron.d 0700 root root
|
|
|
|
/etc/cron.daily 0700 root root
|
|
|
|
/etc/sudoers.d 0700 root root
|
|
|
|
/etc/cron.hourly 0700 root root
|
|
|
|
/etc/cron.weekly 0700 root root
|
|
|
|
/etc/cron.monthly 0700 root root
|
|
|
|
/etc/group 0644 root root
|
|
|
|
/etc/group- 0644 root root
|
|
|
|
/etc/hosts.allow 0644 root root
|
|
|
|
/etc/hosts.deny 0644 root root
|
|
|
|
/etc/issue 0644 root root
|
|
|
|
/etc/issue.net 0644 root root
|
|
|
|
/etc/motd 0644 root root
|
|
|
|
/etc/passwd 0644 root root
|
|
|
|
/etc/passwd- 0644 root root
|
2019-12-19 12:01:33 -05:00
|
|
|
|
2019-12-20 13:02:33 -05:00
|
|
|
######################################################################
|
|
|
|
# SUID/SGID Removal
|
|
|
|
######################################################################
|
|
|
|
|
2019-12-19 12:01:33 -05:00
|
|
|
## Remove all SUID/SGID binaries/libraries.
|
2019-12-20 13:02:33 -05:00
|
|
|
|
2019-12-19 12:01:33 -05:00
|
|
|
/bin/ nosuid
|
2020-12-06 04:15:52 -05:00
|
|
|
/usr/local/bin/ nosuid
|
2020-12-06 04:10:10 -05:00
|
|
|
|
2019-12-19 12:01:33 -05:00
|
|
|
/usr/bin/ nosuid
|
2020-12-06 04:15:52 -05:00
|
|
|
/usr/local/usr/bin/ nosuid
|
2020-12-06 04:10:10 -05:00
|
|
|
|
2019-12-19 12:01:33 -05:00
|
|
|
/sbin/ nosuid
|
2020-12-06 04:15:52 -05:00
|
|
|
/usr/local/sbin/ nosuid
|
2020-12-06 04:10:10 -05:00
|
|
|
|
2019-12-19 12:01:33 -05:00
|
|
|
/usr/sbin/ nosuid
|
2020-12-06 04:15:52 -05:00
|
|
|
/usr/local/usr/sbin/ nosuid
|
2020-12-06 04:10:10 -05:00
|
|
|
|
2019-12-21 14:06:51 -05:00
|
|
|
/lib/ nosuid
|
2020-12-06 04:15:52 -05:00
|
|
|
/usr/local/lib/ nosuid
|
|
|
|
|
2019-12-19 12:01:33 -05:00
|
|
|
/lib32/ nosuid
|
2020-12-06 04:15:52 -05:00
|
|
|
/usr/local/lib32/ nosuid
|
|
|
|
|
2019-12-19 12:01:33 -05:00
|
|
|
/lib64/ nosuid
|
2020-12-06 04:15:52 -05:00
|
|
|
/usr/local/lib64/ nosuid
|
2020-12-06 04:10:10 -05:00
|
|
|
|
2019-12-19 12:01:33 -05:00
|
|
|
/usr/lib/ nosuid
|
2020-12-06 04:15:52 -05:00
|
|
|
/usr/local/usr/lib/ nosuid
|
2020-12-06 04:10:50 -05:00
|
|
|
|
|
|
|
/usr/lib32/ nosuid
|
2020-12-06 04:15:52 -05:00
|
|
|
/usr/local/usr/lib32/ nosuid
|
2020-12-06 04:10:50 -05:00
|
|
|
|
|
|
|
/usr/lib64/ nosuid
|
2020-12-06 04:15:52 -05:00
|
|
|
/usr/local/usr/lib64/ nosuid
|
2019-12-23 09:39:50 -05:00
|
|
|
|
2020-12-06 04:08:58 -05:00
|
|
|
## https://forums.whonix.org/t/suid-disabler-and-permission-hardener/7706/68
|
|
|
|
/opt/ nosuid
|
|
|
|
/usr/local/opt/ nosuid
|
|
|
|
|
2019-12-23 09:39:50 -05:00
|
|
|
######################################################################
|
|
|
|
# Capability Removal
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
## Ping doesn't work with Tor anyway so its capabilities are removed to
|
|
|
|
## reduce attack surface.
|
|
|
|
## anon-apps-config does this.
|
|
|
|
#/bin/ping 0744 root root none
|
|
|
|
|
|
|
|
## TODO: research
|
|
|
|
#/usr/lib/x86_64-linux-gnu/gstreamer1.0/grstreamer-1.0/gst-ptp-helper 0744 root root none
|