Skip to main content
  1. Index/

composefs

composefs is a Linux filesystem technology created by Alexander Larsson and Giuseppe Scrivano at Red Hat that provides cryptographically verified, read-only filesystem trees with opportunistic file-level sharing across images. Its motivating problem is a gap that neither dm-verity nor plain overlayfs fills cleanly: dm-verity provides strong integrity over a whole block device but requires a self-contained disk image and cannot share files between images; overlayfs allows layered, shared filesystems but protects only file contents (via fs-verity) and not the directory structure or metadata — an attacker who can manipulate a file’s name, permissions, or position in the tree is not caught. composefs closes that gap by separately protecting content and metadata, then composing them at mount time.

Architecturally, a composefs image is a small, read-only EROFS filesystem that stores only metadata — filenames, permissions, xattrs, symlinks, and, for regular files, the expected fs-verity SHA-256 digest of the content rather than the content itself. File data lives separately in a content-addressed object store (a flat directory of files named by their content hash), which is passed to the mount as a basedir. At mount time, the kernel uses overlayfs to compose the EROFS metadata layer over the object store, producing a fully populated directory tree; when a file is read, overlayfs enforces that the backing object’s fs-verity digest matches what the metadata image recorded. The EROFS image itself can be fs-verity-verified at mount time by passing its expected digest, giving a complete chain: a single digest commits the metadata, the metadata commits every file’s content, and the kernel enforces both on every access. composefs requires no new kernel modules; it is built entirely from overlayfs (with the verity option added in kernel 6.6), EROFS, and fs-verity.

The primary consumers are OSTree-based systems and container runtimes. OSTree uses composefs to mount OS trees directly from its content-addressed object store rather than checking out files into a regular directory, replacing hardlink-based checkout with a verified, zero-copy mount. Container runtimes using the zstd:chunked image format can similarly compose container image layers from a shared object store, so files present in multiple images are stored once on disk and verified independently in each mount. The practical effect is that a composefs-mounted root filesystem or container image is as tamper-evident as a dm-verity image — any modification to content or structure causes an I/O error on access — while remaining as storage-efficient and incrementally updatable as a regular file tree. It is central to the verified boot story for bootc and image-based Linux systems where the running OS tree must be attested as unmodified.

Related

AIDE (Advanced Intrusion Detection Environment)

AIDE (Advanced Intrusion Detection Environment) is a host-based intrusion detection tool that implements file integrity monitoring (FIM): it builds a baseline database capturing cryptographic hashes and metadata for every file it is configured to watch, and on subsequent runs compares the live filesystem against that database, reporting anything that has been added, removed, or changed. Its security premise is detection after the fact: AIDE does not prevent modifications (that is the role of fapolicyd, SELinux, and IMA), but it provides a reliable, auditable record that modifications occurred, when a check was run, and which specific attributes changed. An attacker who compromises a system and modifies a binary, a configuration file, a cron job, or an SSH authorized_keys file will leave a fingerprint in the next AIDE check — provided the database has not also been compromised, which is the central operational concern the tool’s deployment model must address.

AppArmor (Application Armor)

AppArmor (Application Armor) is a Mandatory Access Control (MAC) system implemented as a major LSM (Linux Security Module), developed originally by Immunix and now maintained by Canonical. It is the default MAC system on Ubuntu, Debian, and their derivatives, and the default container confinement mechanism for containerd and Docker on those distributions. Where SELinux assigns security labels to every object on the system and enforces policy based on label interactions, AppArmor takes a fundamentally different approach: it confines programs by filesystem path. A profile for nginx lists the specific file paths that nginx is allowed to read, write, and execute, the network operations it may perform, and the Linux capabilities it may use — anything not listed is denied. No relabelling of the filesystem is required and no extended attributes are set: AppArmor’s confinement decisions are made purely from the path of the file being accessed and the identity of the confined process. This path-based model makes AppArmor profiles far simpler to read, write, and audit than SELinux policy, and eliminates the mislabelled-file failure mode that is the most common SELinux operational problem.

IMA (Integrity Measurement Architecture)

IMA (Integrity Measurement Architecture) is a Linux kernel subsystem, merged in kernel 2.6.30, that hooks into the kernel’s file access paths — execve(), mmap(), open() — and computes a cryptographic hash of each file’s contents before it is accessed, according to a configurable policy. It is the runtime half of the Linux integrity story: where TPM PCR measurements and Secure Boot cover what was loaded during the boot sequence, IMA covers what happens after the OS is running, hashing executables, libraries, kernel modules, firmware, and configuration files as they are opened, creating a continuously updated record of everything the system has actually used.