Skip to content

Multi-tenant isolation primitives on cPanel — CageFS, jails, LVE

A senior-operator framing of what actually isolates tenants on a cPanel host: CageFS, CloudLinux LVE, chroot jails, SELinux, and where each draws the line.

“Shared hosting is shared” is the operator’s joke until it isn’t. Multi-tenant isolation on cPanel is the boundary between “one customer ran bad code” and “one customer compromised the host”. The boundary is made of several primitives stacked together; understanding what each one actually blocks (and doesn’t) is what separates a competent operator from a panel-clicker.

The trade-off

The isolation primitives, in layers from kernel up:

  • Linux user/group ownership + permissions — the bottom. Always present, never sufficient by itself. A tenant who’s nobody can still read world-readable files.
  • chroot jails (suexec, mod_ruid2) — limit what a process can see in the filesystem. Apache children run as the cPanel user, so a process can’t write to another user’s files. Doesn’t block reading PHP source or other world-readable artifacts.
  • CageFS (CloudLinux) — proper per-user filesystem namespace. Each user sees their own /home, /tmp, /usr, etc.; views of system binaries are sanitized; cross-tenant filesystem visibility is closed. This is the meaningful isolation layer for shared hosting.
  • LVE (CloudLinux) — resource isolation at the kernel level. CPU, memory, I/O, IOPS, process count caps per user, enforced by the kernel scheduler. Prevents resource starvation, not data leakage.
  • SELinux / AppArmor — mandatory access control. cPanel has historically run with SELinux permissive; enabling enforcing mode is non-trivial. Most cPanel deployments don’t use SELinux in enforcing mode.
  • Network namespaces — rarely used on cPanel. Containers and VMs would provide this; cPanel doesn’t natively.

How to decide — what isolation level you actually need

  1. Customers run untrusted code (any shared hosting)? Need CageFS at minimum. Without it, PHP code in one account can read source files in another, including database credentials.
  2. Workload includes regulated data? Layer SELinux/AppArmor on top of CageFS. The defence-in-depth matters when an audit asks.
  3. Customers run scripts that exec shell commands? CageFS limits the binary surface; without it, your tenants can see and execute every system binary.
  4. Customers run resource-intensive jobs? LVE for resource isolation; CageFS for filesystem isolation. Both are needed; one without the other is incomplete.
  5. Single-customer-per-host deployment? You don’t need CageFS or LVE — there’s no “other tenant” to isolate from.

What to do

  1. Enable CageFS for every account on shared-hosting boxes. Disabling per-account should be the rare exception with a written reason.
  2. Run LVE in enforcing mode (not just observation). See the LVE policy framing.
  3. Audit CageFS skeleton periodically. Custom binaries added to the skeleton are tenant-visible; review what’s in /etc/cagefs/conf.d/.
  4. Verify isolation periodically. Log in as one tenant and try to read another’s /home/USER/public_html/wp-config.php. The answer should be “permission denied” — not “file not found”.
  5. Don’t substitute CageFS for proper credential management. Tenants can still leak credentials by uploading them to public web roots; isolation only stops cross-tenant access, not tenant self-inflicted leaks.

Stack Harbor verifies and operates isolation primitives on managed shared-hosting fleets as part of managed cPanel operations.