
security-misc: Enhance Miscellaneous Security Settings

Stable Features
Testing Features
Reduce Kernel Information Leaks
- Security Impact: There are many of hardware, kernel, debug information, etc. in
/sys
, which is especially problematic and has been the cause of many infoleaks such as kernel pointer leaks. - Privacy/Anonymity Impact: Details about your hardware can be used for identification.
- Threat: This information is per Debian (and probably most popular Linux distributions) available to attackers with local code execution privileges which includes,
- malicious applications collecting such information and submitting it to data collectors,
- as well as both, compromised non-privileged users and the privileged root user.
- Non-Threat: This information does not randomly leak to third parties on clean (non-compromised) machines through use of legitimate applications such as the APT package manager.
- Goal: This information should by default be unavailable to non-privileged users and untrusted root.
- Solution: Therefore security-misc includes the
hide-hardware-info.service
systemd unit.- Restricts access to
/sys
,/proc/cpuinfo
,/proc/bus
, and/proc/scsi
to the root user only. - This also hides most hardware identifiers.
- Restricts access to
- Status: This setting is disabled by default because it might break many applications. Testers-only! Call for testers and forum discussion: Restrict Hardware Information to Root - Testers Wanted!
- Enable: It can optionally be enabled by running the following command.
- Click = Copy Copied to clipboard!
- Reboot required.
- A whitelist that allows specific applications to access
/sys
and/proc/cpuinfo
is enabled by default to maintain basic functionality. [1] For example, this allows the launching of applications like XFCE.
- Limitations of Solution:
- Possible Future Enhancements: untrusted root
Whitelisting Applications
To whitelist applications, they must be run under the sysfs
group (if allowing access to /sys
) and/or the cpuinfo
group (if allowing access to /proc/cpuinfo
).
Remember that any whitelisted applications add to the attack surface. An attacker can attempt to exploit a vulnerability in the whitelisted application(s) to gain access to hardware information.
addgroup method
For example, to add user user
to group cpuinfo
, run the following command. (Note, this is weakening protections.)
Click = Copy Copied to clipboard!
For example, to add user user
to group sysfs
, run the following command. (Note, this is weakening protections.)
Click = Copy Copied to clipboard!
Re-login required after changing groups. Easiest: reboot. [3] [4]
For example, after reboot it would be possible to run the cpu-info
utility (from Debian package cpuinfo
).
Click = Copy Copied to clipboard!
systemd
For example, to run a systemd service as the sysfs
group, create a drop-in directory and add the following.
Click = Copy Copied to clipboard!
setgid method
To run a specific binary as the sysfs
group, the binary must be owned by the sysfs
group and be made setgid. To achieve this, change the ownership of the binary by running the following.
Click = Copy Copied to clipboard!
Then make the binary setgid.
Click = Copy Copied to clipboard!
The binary will now run with the permissions of the sysfs
group and have access to /sys
.
All of these steps can also be applied to the cpuinfo
group.
Disable the Whitelist
In order to reduce the attack surface as much as possible, optionally the whitelist can be disabled entirely.
1. Open file /etc/hide-hardware-info.d/50_user.conf
in an editor with root rights.
Kicksecure
See Open File with Root Rights for detailed instructions on why to use
sudoedit
for better security and how to use it.
Note: Mousepad (or the chosen text editor) must be closed before running the sudoedit
command.
Click = Copy Copied to clipboard!
Kicksecure for Qubes
NOTES:
- When using Kicksecure-Qubes, this needs to be done inside the Template.
Click = Copy Copied to clipboard!
- After applying this change, shutdown the Template.
- All App Qubes based on the Template need to be restarted if they were already running.
- This is a general procedure required for Qubes and unspecific to Kicksecure for Qubes.
Others and Alternatives
- This is just an example. Other tools could achieve the same goal.
- If this example does not work for you or if you are not using Kicksecure, please refer to this link.
Click = Copy Copied to clipboard!
2. Add.
Click = Copy Copied to clipboard!
3. Save.
4. Done.
SUID Disabler and Permission Hardener
See SUID Disabler and Permission Hardener.
hidepid
TODO: document
sudo systemctl enable proc-hidepid.service
Experimental Features
Unreleased. (Developers only.) Will flow into other repositories as per usual.
Remount Secure
Feature not ready!
- https://forums.whonix.org/t/re-mount-home-and-other-with-noexec-and-nosuid-among-other-useful-mount-options-for-better-security/7707/27
- https://github.com/Whonix/security-misc/blob/master/lib/systemd/system/remount-secure.service
- https://github.com/Whonix/security-misc/blob/master/usr/lib/security-misc/remount-secure
- Dev/remount-secure
Click = Copy Copied to clipboard!
Installation of security-misc
Prerequisites:
Template:Kicksecure Prerequisites
1. Download the Signing Key.
Click = Copy Copied to clipboard!
2. Optional: Check the Signing Key for better security.
3. Add Kicksecure signing key.
Click = Copy Copied to clipboard!
4. Kicksecure APT repository choices.
Optional: See Kicksecure Packages for Debian Hosts and Kicksecure Host Enhancements instead of the next step for more secure and complex options.
5. Add Kicksecure APT repository.
Click = Copy Copied to clipboard!
Install security-misc
.
Install package(s) security-misc
following these instructions
1 Platform specific notice.
- Kicksecure: No special notice.
- Kicksecure-Qubes: In Template.
2 Update the package lists and upgrade the system.
Click = Copy Copied to clipboard!
3 Install the security-misc
package(s).
Using apt
command line --no-install-recommends
option is in most cases optional.
Click = Copy Copied to clipboard!
4 Platform specific notice.
- Kicksecure: No special notice.
- Kicksecure-Qubes: Shut down Template and restart App Qubes based on it as per Qubes Template Modification
.
5 Done.
The procedure of installing package(s) security-misc
is complete.
selinux
- https://github.com/Whonix/security-misc/pull/100
- https://forums.whonix.org/t/restrict-hardware-information-to-root/7329/88
References
- ↑
https://gitlab.com/whonix/security-misc/-/blob/master/lib/systemd/system/user@.service.d/sysfs.conf
- ↑
- ↑
No reboot required: Use the execute command as different group ID command line utility
sg
to execute thecpu-info
(from Debian packagecpuinfo
) application under groupcpuinfo
. Click = Copy Copied to clipboard! - ↑ Also no reboot required: Click = Copy Copied to clipboard! Click = Copy Copied to clipboard! Or. Click = Copy Copied to clipboard!

We believe security software like Kicksecure needs to remain Open Source and independent. Would you help sustain and grow the project? Learn more about our 12 year success story and maybe DONATE!