Polkit (formerly PolicyKit)
Polkit
(formerly PolicyKit
) provides a centralized way to define and manage policy rules for privileged operations performed by users on Linux systems. This documentation explains its role, potential issues when disabled, and methods for managing it.
Introduction[edit]
Issues when disabling Polkit[edit]
- Reboot and poweroff from the GUI are no longer possible. [1]
- Removable media can no longer be mounted, as
udisksd
treats removable media mounting as a privileged operation. - Graphical user creation tools (e.g.
users-admin
fromgnome-system-tools
) no longer function properly. [2] - Flatpaks can no longer be installed user-locally. (
flatpak --user install
) [3] - Network configuration via
nmtui
or similar tools (likely including the network widget in the panel) will probably no longer be configurable, as NetworkManager treats network reconfiguration as a privileged operation. - System usually takes longer to boot, likely due to processes repeatedly failing to start polkit.
Disabling Polkit[edit]
Disabling Polkit can be useful for security hardening inside browser-only VMs or other scenarios where a user is not expected to perform any privileged operations via polkit.
How to disable polkit as an opt-in hardening option? Undocumented.
Development[edit]
Polkit could be disabled using a systemd drop-in configuration snippet, modifying polkit.service
by adding ConditionKernelCommandLine
or a similar parameter to prevent polkit from starting in user sessions (outside of the sysmaint session).
Open file /usr/lib/systemd/system/polkit.service.d/99_sysmaint.conf
in an editor with root rights.
Select your platform.
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.
sudoedit /usr/lib/systemd/system/polkit.service.d/99_sysmaint.conf
Kicksecure for Qubes
NOTES:
- When using Kicksecure-Qubes, this needs to be done inside the Template.
sudoedit /usr/lib/systemd/system/polkit.service.d/99_sysmaint.conf
- 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.
sudoedit /usr/lib/systemd/system/polkit.service.d/99_sysmaint.conf
Paste.
ConditionKernelCommandLine=boot-role=sysmaint
Save.
Reboot.
Done.
polkit.service
should now only be running in sysmaint session.
Forum Discussion[edit]
- https://forums.kicksecure.com/t/investigate-security-suid-impact-of-polkitd-and-policykit-libraries/1075
Footnotes[edit]
- ↑ This is because systemd treats rebooting as a privileged operation.
- ↑
Probably because
accountsservice
treats user creation as a privileged operation. - ↑
Flatpak installation errors out:
Warning: Failed to get revokefs-fuse socket from system-helper: Failed to activate service 'org.freedesktop.Flatpak.SystemHelper': timed out (service_start_timeout=25000ms) Warning: Failed to activate service 'org.freedesktop.Flatpak.SystemHelper': timed out (service_start_timeout=25000ms) Warning: Failed to get revokefs-fuse socket from system-helper: Failed to activate service 'org.freedesktop.Flatpak.SystemHelper': timed out (service_start_timeout=25000ms) Warning: Failed to activate service 'org.freedesktop.Flatpak.SystemHelper': timed out (service_start_timeout=25000ms) Warning: Failed to get revokefs-fuse socket from system-helper: Failed to activate service 'org.freedesktop.Flatpak.SystemHelper': timed out (service_start_timeout=25000ms) Warning: Failed to activate service 'org.freedesktop.Flatpak.SystemHelper': timed out (service_start_timeout=25000ms) Warning: Failed to get revokefs-fuse socket from system-helper: Failed to activate service 'org.freedesktop.Flatpak.SystemHelper': timed out (service_start_timeout=25000ms) error: Failed to install org.gnome.Platform: Failed to activate service 'org.freedesktop.Flatpak.SystemHelper': timed out (service_start_timeout=25000ms)

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 13 year success story and maybe DONATE!