Comparison of secureblue with Kicksecure and Development Notes

From Kicksecure
< Dev
Revision as of 11:26, 12 March 2025 by Patrick (talk | contribs) (→‎Hardening)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Secureblue and Kicksecure are both hardened operating systems prioritizing security. This wiki page provides a side-by-side comparison of some of their security features, development decisions, and the rationale behind various implementations. Explore how each system addresses security challenges. This guide serves as a resource for developers, security enthusiasts, and users seeking insight into cutting-edge OS security practices.

Quick, preliminary analysis version 0.1, only based on quote secureblue GitHub repositoryarchive.org iconarchive.today icon README.md as of Nov 30, 2024, commit hash e40b70df06a30c3a2d99f337f3cbfe3d5a54aa83archive.org iconarchive.today icon and related, linked files. And plus a comment on #Unprivileged User Namespaces as of secureblue release 4.3.0.

Hardening[edit]

Hardening

Kicksecure is no longer using hardened_malloc for reasons elaborated in chapter Hardened Malloc, Deprecation in Kicksecure.

Unavailable in Kicksecure at time of writing. See Kicksecure Default Browser - Development Considerations for general considerations and and chapter Trivalent specifically.

  • Setting numerous hardened sysctl values [4]

secureblue /etc/sysctl.d/hardening.conf file as of commit a6b58f042b0e9e9036a6d68a5b202eed96a1a892archive.org iconarchive.today icon was inspired by, more or less copied and pasted from Kicksecure as can be seen from the following comment found in that file.

## Prevent kernel info leaks in console during boot.
## https://phabricator.whonix.org/T950
kernel.printk = 3 3 3 3

Therefore, Kicksecure has mostly the same settings. These can be found in package security-miscarchive.org iconarchive.today icon, specifically in folder /usr/lib/sysctl.darchive.org iconarchive.today icon.

If there are any differences, these can be discovered during ticket review secureblue sysctlarchive.org iconarchive.today icon.

Kicksecure might have more complete sysctl settings as per:

This section is inspired by the Kernel Self Protection Project (KSPP). It attempts to implement all recommended Linux kernel settings by the KSPP and many more sources.

https://kspp.github.io/Recommended_Settingsarchive.org iconarchive.today icon

https://github.com/KSPP/kspp.github.ioarchive.org iconarchive.today iconsecurity-misc readme

Kicksecure has SUID Disabler and Permission Hardener. See also chapter capabilities.

  • Disable Xwayland by default (for GNOME, Plasma, and Sway images)

TODO Kicksecure:

At this point, Kicksecure (and Whonix) runs primarily inside VMs. GNOME and KDE are unsuitable for Kicksecure.

No desktop environment suitable for Kicksecure that is already using Wayland has been identified for Kicksecure yet.

TODO Kicksecure: research

  • Disabling coredumps

Implemented in security-misc.

  • Disabling all ports and services for firewalld

No open ports for Kicksecure by default.

  • Adds per-network MAC randomization

TODO Kicksecure: https://github.com/Kicksecure/security-misc/issues/184archive.org iconarchive.today icon

See also MAC Address.

  • Blacklisting numerous unused kernel modules to reduce attack surface [5]

secureblue /etc/modprobe.d/blacklist.confarchive.org iconarchive.today icon as of git commit c8eff2ca0bc9f7f2db9e1e172dc70942e6983912archive.org iconarchive.today icon

looks similar, might be inspired/forked from Kicksecure /etc/modprobe.darchive.org iconarchive.today icon files but probably adjusted for secureblue. [6]

Quote Kicksecure Flathub Repository Default Settings:

"Kicksecure mitigates the issues described in chapter Flathub Package Sources Security related to unverified applications and non-freedom software by using Flatpak's subset option with the verified_floss parameter, which means that only Flatpaks can be installed that are both verified apps and floss (Freedom Software)."

Kicksecure has the same because Madaidan contributed to Kicksecure. Also see KSPP as mentioned above.

  • Require wheel user authentication via polkit for `rpm-ostree install` [8]

Not directly appreciable to Kicksecure. User documentation: root. Future enhancements: Role-Based Boot Modes (user versus admin) for Enhanced Security.

  • Brute force protection by locking user accounts for 24 hours after 50 failed login attempts, hardened password encryption and password quality suggestions

User accounts are locked after 50 failed login attempts using pam_faillock.

https://kspp.github.io/Recommended_Settingsarchive.org iconarchive.today icon

https://github.com/KSPP/kspp.github.ioarchive.org iconarchive.today iconsecurity-misc readme

  • Installing usbguard and providing `ujust` commands to automatically configure it

TODO Kicksecure:

  • Installing bubblejail for additional sandboxing tooling

TODO Kicksecure: sandbox-app-launcher

  • Set opportunistic DNSSEC and DNSOverTLS for systemd-resolved

Kicksecure does not use systemd-resolved by default.

systemd-resolved and other tools would require further research. This and systemd-resolved is mentioned here: DNS Security

TODO Kicksecure: Use DNSCrypt by default in Kicksecure?archive.org iconarchive.today icon

  • Configure chronyd to use Network Time Security (NTS) [9]

Kicksecure uses sdwdate.

  • Disable KDE GHNS by default [10]

Probably useful for secureblue but not essential for KDE since it not using GNOME by default.

user documentation: Other Desktop Environments

  • Disable install & usage of GNOME user extensions by default

Probably useful for secureblue but not essential for Kicksecure since it not using GNOME by default.

user documentation: Other Desktop Environments

  • Use HTTPS for all rpm mirrors

Kicksecure uses tor+https for APT as configured in anon-apt-sources-listarchive.org iconarchive.today icon and documented on the About wiki page.

  • Set all default container policies to `reject`, `signedBy`, or `sigstoreSigned`

Not applicable to Kicksecure since it is not a container focused operating system at time of writing. Probably useful for secureblue if using containers' imagesarchive.org iconarchive.today icon.

  • Disable a variety of services by default (including cups, geoclue, passim, and others)

Kicksecure does not install these by default and comes with Application-specific hardeningarchive.org iconarchive.today icon.

  • Removal of the unmaintained and suid-root fuse2 by default

Kicksecure has SUID Disabler and Permission Hardener.

capabilities[edit]

Kicksecure has SUID Disabler and Permission Hardener. As for capabilities, these can be useful but adding capabilities, while sometimes useful, can also add attack surface.

set_caps_if_present "cap_dac_read_search,cap_audit_write=ep" "/usr/bin/chage"

Kicksecure prefers not re-adding capabilities for chage.

These tools probably are used much nowadays on Linux desktop single user computers. If you need any of this, you are better off using root.

No user has reported yet that they need the ability to use chage. For the benefit of security hardening, chage remains non-functional in Kicksecure (lower attack surface) for non-root user.

set_caps_if_present "cap_chown,cap_dac_override,cap_fowner,cap_audit_write=ep" "/usr/bin/chfn"

Same as above.

set_caps_if_present "cap_dac_read_search,cap_audit_write=ep" "/usr/sbin/unix_chkpwd"

Same as above.

cap_dac_read_search is dangerous.

CAP_DAC_READ_SEARCH

set_caps_if_present "cap_dac_read_search=ep" "/usr/libexec/openssh/ssh-keysign"

TODO: Kicksecure: While cap_dac_read_search is still dangerous, it's better than SUID.

set_caps_if_present "cap_sys_admin=ep" "/usr/bin/fusermount3"
  • Kicksecure whitelists fusermount SUID, which is dangerous. (Optional user opt-in: Disable All SUID Binaries) In the future, when Dev/user-sysmaint-split has been implemented, fusermount might only be accessible for user "admin".
  • secureblue sets fusermount cap_sys_admin is dangerous. CAP_SYS_ADMIN: the new rootarchive.org iconarchive.today icon
  • Most other Linux desktop distributions: Neither SUID nor capabilities hardening.

Unprivileged User Namespaces[edit]

Disabling unprivileged user namespaces by default for the unconfined domain and the container domain

This is probably useful.

Without this security hardening, all locally running applications could use user namespaces (userns) and attempt to exploit them for user-to-root escalation. With this hardening, userns usage is restricted to specific applications such as Chromium that explicitly require it.Kicksecure Unprivileged User Namespace wiki page

Quote SecureBlue documentation on SELinux-based USERNS restrictionsarchive.org iconarchive.today icon

Since user namespaces are now restricted via selinux, we no longer need separate userns images.

Separate userns enabled versus userns disabled images or setting would still be useful.

However, even with all of this hardening in place, as described in Chrome sandbox escapearchive.org iconarchive.today icon, if the browser gets exploited, the browser is allowed to use userns and the system remains vulnerable to userns-based attacks.

Given that browsers are evolving into operating systems where users do almost everything, the effective security gain from these measures is not as significant as it might seem. Nowadays, Java isn't the "write once, run anywhere" framework we all rely on. The browser is.

Therefore, completely disabling user namespaces using user.max_user_namespaces=0 is the safer setting.Kicksecure Unprivileged User Namespace wiki page

sudoless[edit]

The term "sudoless" can confusing. See also definition of "sudoless".

v4.2.0 - secureblue goes sudoless! In a continuing effort to minimize and eventually eliminate suid-root binaries, sudo, su, and pkexec have all been removed from the images. As noted at the end of this section of the postinstall readme, polkit prompts and manual polkit invokations via run0 can be used to accomplish the same functionality without suid-root, notably even for non-wheel users (by prompting for the wheel user's password). In addition, suid-root has been removed from numerous other binaries that don't require it.secureblue release announcement: v4.2.0 - secureblue goes sudoless!archive.org iconarchive.today icon

Kicksecure won't be using run0archive.org iconarchive.today icon anytime soon.

It’s larger than doas. Way larger. run0 (really systemd-run) is 2642 lines long (including newlines and whatnot), and is heavily tied into the systemd codebase, which is about 1.3 million lines of C code. It’s unclear how much of that could be used to exploit run0, but some of it quite possibly can. doas on the other hand is relatively isolated (the only library it uses beyond the C standard library is PAM), and is only 1,850 lines long. Ergo, less attack surface.Kicksecure developer, Aaron Rainbolt], forum postarchive.org iconarchive.today icon

Instead, Kicksecure will implement user-sysmaint-split (Role-Based Boot Modes for Enhanced Security), where sudo, su, and pkexec will be non-executable by account user.

See Also[edit]

Footnotes[edit]

  1. Thanks to rusty-snake's specarchive.org iconarchive.today icon
  2. Why chromium?archive.org iconarchive.today icon
  3. Why not flatpak chromium?archive.org iconarchive.today icon
  4. detailsarchive.org iconarchive.today icon
  5. detailsarchive.org iconarchive.today icon
  6. For example, if secureblue does not provide an ISO with squashfs, then secureblue can disable the module.
    install squashfs /bin/false
    
  7. detailsarchive.org iconarchive.today icon
  8. why?archive.org iconarchive.today icon
  9. using chrony config from GrapheneOSarchive.org iconarchive.today icon
  10. why?archive.org iconarchive.today icon

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!