“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
nobodycan 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
- 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.
- Workload includes regulated data? Layer SELinux/AppArmor on top of CageFS. The defence-in-depth matters when an audit asks.
- Customers run scripts that exec shell commands? CageFS limits the binary surface; without it, your tenants can see and execute every system binary.
- Customers run resource-intensive jobs? LVE for resource isolation; CageFS for filesystem isolation. Both are needed; one without the other is incomplete.
- Single-customer-per-host deployment? You don’t need CageFS or LVE — there’s no “other tenant” to isolate from.
What to do
- Enable CageFS for every account on shared-hosting boxes. Disabling per-account should be the rare exception with a written reason.
- Run LVE in enforcing mode (not just observation). See the LVE policy framing.
- Audit CageFS skeleton periodically. Custom binaries added to the skeleton are tenant-visible; review what’s in
/etc/cagefs/conf.d/. - 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”. - 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.