Linux

Exploring the Latest Security Features in Ubuntu 24.04

In the mere two years since the previous LTS release of Ubuntu shipped, the technology landscape has changed in profound ways. Because we’ve seen an explosion of ransomware attacks and critical Linux CVEs, it’s more important than ever to secure Linux systems. Thankfully, the industry has responded with a focus on security in Linux core components. That emphasis makes Ubuntu 24.04 perhaps the most important Ubuntu release ever for those concerned with securing their systems. We’ve combed through various Linux project changelogs, Debian package maintainer mailing lists, and piles of pages on Canonical's Launchpad system to bring you a definitive list of everything new in security in Ubuntu 24.04. Think we missed something important? Let us know at hello@mondoo.com.

Kernel 6.8

Kernel updates aren’t just about finally fixing your flakey WIFI or getting a few more FPS out of Tux Racer; they come with serious security improvements. And with Ubuntu 24.04, the Linux kernel takes the leap from 5.15 all the way to 6.8. Those two years of kernel development come with significant security improvements, from CPU-enabled security to hypervisor security, all with the aim of protecting your systems from attackers.

Hardware-based security

Recently it seems there’s been an endless stream of hardware attacks, from Meltdown and Spectre to the most recent M1/M2 processor attacks. Mitigations to those vulnerabilities have had a costly performance impact on systems, but there’s finally relief in the form of improved hardware security to stop many of these attacks from occurring in the future. The best part is that it doesn’t matter if you’re team AMD or team Intel: There’s something for everyone in these latest kernel releases.

Intel-specific improvements

  • Indirect Branch Tracking (IBT) on Intel’s latest CPUs is a new Control-Flow Enforcement Technology (CET) method. It provides hardware-based protection against jump/call-oriented programming (JOP/COP) attacks on Tiger Lake and later processors. See the LWN article for more details.
  • Support for Intel’s Software Guard Extensions 2 (SGX2) hardware secure memory feature (which was introduced in the Gemini Lake/Ice Lake processors) introduces an improved secure memory enclave that allows processes to encrypt memory space in order to prevent snooping. One particularly interesting use of this technology is encrypting VM memory space to prevent other system processes or VMs from reading the contents.
  • Intel Linear Address Masking safely reserves a portion of pointer address space for metadata. Note that this LAM implementation is specific to Intel processors and differs from AMD’s implementation, which shipped in 2019. See the LWN article for more details.
  • Intel Control-Flow Enforcement Technology (CET) is a marketing name for Intel’s implementation of a shadow stack system. In this system, a second shadow stack that cannot be directly modified is maintained for parity purposes. The processor pushes return addresses to both the standard stack and the shadow stack and then compares return values to make sure they match. By raising an error if the stack addresses differ, the processor can prevent control flow hijack attacks. To learn more, read Intel’s lengthy PDF description of how this system works.
  • Mitigation for the Gather Data Sampling (GDS) hardware vulnerability allows unprivileged speculative access to data that was previously stored in vector registers. See the Intel GDS article for a very lengthy description of this vulnerability.

AMD-specific improvements

  • There is now mitigation for the Speculative Return Stack Overflow (SRSO) vulnerabilities in AMD processors (CVE-2023-20569). See the Kernel SRSO docs for more information on how the mitigation was achieved.
  • Support for the AMD Zen 4’s Automatic IBRS (Indirect Branch Restricted Speculation) provides mitigation for Spectre v2 without the performance impact of software-only measures. See Phoronix.com performance testing for in-depth benchmarking.

Something for everyone

  • Straight-line speculation attack mitigation delivers kernel-level mitigation against the Spectre variant straight-line speculation CPU attack that was originally reported by ARM (but is present in multiple other CPU architectures).
  • Kernel Control Flow Integrity (KCFI) support is one of the more interesting kernel security features that has recently been introduced. This new CFI implementation is easier to enable, hardening the kernel against attacks that modify kernel control flow. See this excellent LWN.net article for a detailed look at how CFI protects the kernel.

Hypervisor security

  • Secure virtualization with new CPU support from AMD and Intel protects guest VMs from hypervisor-based attacks. AMD’s Secure Nested Paging (SEV-SNP) provides memory integrity protection. Intel’s Trust Domain Extensions (TDX) provides both memory integrity and encryption.
  • Hyper-V Virtual Trust Level (VTL) support provides 16 trust access levels for VMs to isolate memory, virtual CPUs, and interrupts based on trust level. See Microsoft’s Virtual Secure Mode documentation for more information.
  • Hyper-V Confidential VM support is expanded to include PCI pass-thru support.
  • Memory acceptance (as defined in UEFI Specification version 2.9) supports secure VMs with Intel’sl TDX and AMD’s SEV-SNP. This allows the VM to boot with a minimum amount of memory and later securely accept additional memory as it’s required instead of when the hypervisor provides it. See the LWN article for information on how this feature eventually shipped.

Cryptography improvements

  • Better random number generation not only improves cryptography but also increases performance.
  • Support for HCTR2, which is a length-preserving (plain text size == encrypted size) encryption method, works well with hardware acceleration in x86 and ARM processors. 
  • Hardware acceleration for AES cipher in GCM mode on ARM increases performance by ~75% in testing.
  • There's also hardware acceleration for the ARIA cipher on Intel AVX2 and AVX-512 capable processors.
  • DES-based encryption for NFS connections are disabled by default, with the ability to also disable SHA-1.
  • Ubuntu 24.04 removes support for insecure X.509 MD4/MD5/SHA1.
  • The release includes FIPS 202 SHA-3 support.

Networking security

  • NFSD has added support for RPC-with-TLS.
  • Support for TCP Authentication Option (TCP-AO, as defined in RFC5925) provides a new, more secure method of verifying TCP segments between hosts than the older TCP-MD5.
  • Netfilter egress hooks classify and potentially reroute traffic egressing your host based on rules to mitigate data exfiltration.

Memory security

  • Randomized slab caches prevent memory heap spraying attacks. Learn about this mitigation technique in the kernel.org git commit.
  • Ubuntu 24.04 has secret memory support with a new memfd_secret system call. Using this new syscall, a process can write data to system memory that only that process can read. This can prevent processes from snooping keys from memory.

Time for SELinux

Last, but not certainly not least, this is the first release of Ubuntu in which SELinux cannot be disabled at runtime. 2024 is finally the year to learn how to make your app run properly with SELinux enabled because it’s no longer a choice.

Find and fix the security risks that pose the biggest threat to your business.

Sudo 1.9.15

Sudo 1.9.15, included in Ubuntu 24.04, has several useful security improvements that help users better control who can use sudo and how authentication behaves. Here are some of the key changes:

  • The use_pty sudoers option is now set by default to protect against privilege escalations and command injection.
  • POSIX regular expressions are now supported in the sudoers file to replace unsafe * matches, which could allow users to execute commands not intended by administrators.
  • Custom sudo prompts can also be employed when using the sudo Kerberos module.
  • Commands can be forced to run under AppArmor profiles that further lock down security with a new APPARMOR_PROFILE sudoers configuration option.
  • Base sudo configuration files can now be stored on read-only systems while still specifying a writable directory for overrides.

apt 2.7.10

It may feel like apt functionality is set in stone, but this release of Ubuntu upgrades apt from 2.4.11 to 2.7.10 with three nice security additions:

  • Packages with the same version are now validated additionally using SHA-256 hashes.
  • Failures running apt on FIPS-enabled systems have been resolved.
  • Repositories (and PPAs) must now use 2048-bit RSA or greater signing.

Coreutils 9.4

The coreutils package includes such favorites as ls, mv, tr, and chksm. If it feels like 70s UNIX, it probably comes as part of the coreutils package. Ubuntu 24.04 upgrades coreutils from 8.32 to 9.4 with a few notable security improvements when writing scripts:

  • Skip using individual binaries for each checksum format and instead use chksum -a ALGORITHM to validate checksums.
  • chksum -a now supports the SM3 algorithm.
  • chksum --check now autodetects checksum formats so you don’t have to worry about what format is provided.
  • chksum –check now supports CRLF line endings in checksum files.
  • checksum CRC support is now 4-8x faster.

sssd 2.9.4

sssd, which provides authentication against remote directory servers, was upgraded from 2.6.3 to 2.94 with a few notable new features, specifically for enterprise workstation deployments. It now supports:

  • Passkey authentication for use with FIDO2 compliant devices
  • OAuth2 authentication against the latest releases of FreeIPA

systemd 255

systemd, the heart of modern Linux systems, has a large impact on the overall security of hosts. The new release, systemd 255, includes improvements to better secure individual unit files (such as services), encrypt disks using keys in TPM2 chips, and improve the overall security of the system.

Unit file improvements for secure services

  • New systemd unit configuration options allow users to limit the filesystem and network access of services. This is particularly useful in limiting the attack surface if a service is compromised by attackers.
  • Credentials used by services at startup can now be encrypted and stored locally or within TPM2 chips using a systemd-creds command. These credentials are decrypted and made available to the service at startup but no longer need to be stored in configuration files that could be read by users.
  • New unit configuration options, ReloadLimitIntervalSec and ReloadLimitBurst, let you control how rapidly services attempt to restart. These are great configuration options to prevent system denial of service attacks through service crashing.

TPM2 and full disk encryption (FDE) improvements

  • Communication between systemd and TPM2 devices is now conducted using a bind key for improved security.
  • The systemd-cryptenroll command includes improved support for unlocking using FIDO2 tokens.
  • A new tool, ukify, for building Unified Kernel Images, can pull full disk encryption (FDE) keys from the TPM2 store when dual booting Linux with encrypted Windows drives.
  • systemd-cryptenroll now allows enrollment without access to the actual TPM2 hardware using the --tpm2-device-key switch and the public key. This can be used to seal LUKS images offline for a specific TPM2 chip.
  • systemd-cryptenroll can now specify a TPM2 key handle instead of using the default Storage Roto Key (SRK).
  • A TPM2 Storage Root Key will now be set up at boot (if not already present) via the systemd-tpm2-setup service.

Virtual machine security

  • VM bootstrap configuration data can now be passed to systemd without the need for cloud-init by passing data using the DMI type 11 field.
  • Unit files can now detect when running on confidential virtual machines with a new cvm value in the ConditionSecurity configuration.

Overall system security

  • For users sharing a system with other users, systemd-homed has been improved to keep user data safe between sessions. systemd-homed now repeatedly attempts to unmount the user’s home directory on logout to prevent the next user from accessing sensitive data.
  • systemd-resolved now continues to use DNS over TLS even if it has been restarted. It also no longer hard-fails if the nameserver is using an unrecognized protocol.
  • Networkd now supports passing values to the kernel netlabel modules via a new NetLabel= config option.
  • The /etc/os-release spec now includes an optional SUPPORT_END field to expose distro EOL dates to tools like Mondoo. Thank you, systemd team!
  • Process spawning has been improved to not inherit the memory space of the manager before the exec.
  • System and service credentials are now stored in a tmpfs volume with the noswap option to allow ACL support and size limit enforcement.

cryptsetup 2.7.0

cryptsetup is a utility generally used to setup LUKS (Linux Unified Key Setup) disk encryption, along with other formats supported by dm-crypt. Ubuntu 24.04 updates cryptsetup from 2.4.3 to 2.7.0 bringing many useful new features to the world of full disk encryption:

  • Remove encryption from a volume with a new --decryption flag.
  • Add a new --force-offline-reencrypt flag to force the offline re-encryption process.
  • Don’t allow users to accidentally create volumes with nested encryption
  • Add support for FileVault2 encryption on HFS+ volumes. Note: This is not more modern FileVault support on APFS.
  • Improve detection of FIPS support on the system.
  • Support hardware OPAL disk encryption on self encrypting disks (SEDs).

There's even more

Remarkably, this isn't the full extent of security improvements in Ubuntu 24.04. But these are the features that most excite us. The Linux community has grown serious about providing as many advantages as possible for protecting systems, and it's reflected in this new Ubuntu LTS release.

While all of these enhancements give you the ability to better secure your environments, you still need to make smart configuration decisions and stay on top of new vulnerabilities that arise every day. Mondoo is a unified platform that prioritizes the security issues that are most important to fix. Instead of drowning you with a fire-hose stream of low-risk and irrelevant findings, Mondoo reveals the security problems that are most critical in the context of your unique infrastructure. To learn more, read about Firewatch, our newest set of prioritization features.

Tim Smith

Tim Smith is a Product Manager at Mondoo. He’s been working in web operations and software development roles since 2007 and port scanning class As since 1994. He downloaded his first Linux distro on a 14.4 modem. Tim most recently held positions at Limelight Networks, Cozy Co, and Chef Software.

You might also like

Releases
Mondoo November 2024 Release Highlights
Overview of Changes and New Security Features in Windows Server 2025
Releases
Mondoo October 2024 Release Highlights