DLPX-86523 CIS: /home filesystem and mount options#869
Open
prakashsurya wants to merge 1 commit into
Open
Conversation
8e514fc to
4bfe990
Compare
4bfe990 to
96a294e
Compare
Mount the home ZFS dataset at /home (with the nodev and nosuid options) instead of /export/home, to satisfy the CIS requirement for a dedicated, hardened /home filesystem. Build / new installs: - Create and mount the home dataset at /home in the raw-disk-image hook and the upgrade-container template, with nodev,nosuid on the /home fstab entry. Update ansible roles and the FAQ for the new path. In-place upgrades (upgrade-scripts): - common.sh: migrate_export_home_to_home() repoints the home dataset's /etc/fstab entry and any affected /etc/passwd home directories from /export/home to /home, then mounts /home -- leaving the existing /export/home mount live until the next reboot so processes holding it open are not disrupted and a busy unmount cannot fail the upgrade. It self-guards on the fstab entry, so it is a no-op once migrated and on fresh installs / upgrade containers that already use /home. - common.sh: harden_home_mount_options() ensures the /home fstab entry carries nodev,nosuid. Idempotent (a no-op once the options are set). - execute: call both functions before the package phase, so package maintainer scripts (e.g. the delphix-platform postinst) operate on the home dataset already mounted at /home, rather than on a /home directory on the root filesystem that the dataset mount would later shadow. The migration runs before the hardening, which depends on the /home entry the migration creates. Neither call is host-only; the functions self-guard and no-op in containers. Dev images: - delphix-ldap (internal-dev / internal-dcenter only): stop adding the '/home auto_home -nobrowse' autofs map. With the home dataset at /home, that automount reasserts /home on its timeout, shadowing the dataset and breaking home-directory access and SSH login. Customer variants never applied it, so no upgrade-time handling is required. Co-Authored-By: Sanjeev Rohila <sanjeev.rohila@delphix.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
96a294e to
b975685
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The appliance's home ZFS dataset is mounted at
/export/home, without thenodevornosuidmount options. CIS requires a dedicated/homefilesystem carrying thoseoptions, so the current layout fails the relevant controls for the
/homepartitionand its mount options.
Solution
The solution taken in this PR is to mount the home dataset at
/home, withnodev,nosuid, on both fresh installs and in-place upgrades.Fresh installs / build:
/home(raw-disk-image hook andupgrade-container template), with
nodev,nosuidon the/homefstab entry.delphixuser's hometo
/home/delphix.In-place upgrades (
upgrade/upgrade-scripts):migrate_export_home_to_home()(common.sh) repoints the home dataset's/etc/fstabentry, and any affected/etc/passwdhome directories, from/export/hometo/home, then mounts/home. The pre-existing/export/homemount is left live until the next reboot, so running processes that hold it open are
not disrupted and a busy unmount cannot fail the upgrade. The function self-guards on
the fstab entry, so it is a no-op once migrated, and on systems that already use
/home.harden_home_mount_options()(common.sh) ensures the/homefstab entry carriesnodev,nosuid. It is idempotent.executecalls both functions before the package phase, so package maintainerscripts (e.g. the
delphix-platformpostinst) operate on the home dataset alreadymounted at
/home, rather than on a/homedirectory on the root filesystem thatthe dataset mount would later shadow. The migration runs before the hardening, which
depends on the
/homeentry the migration creates. Neither call is host-only. Thefunctions self-guard and no-op inside upgrade containers.
Dev images:
delphix-ldaprole (internal-dev / internal-dcenter only) no longer adds the/home auto_home -nobrowseautofs map. With the home dataset at/home, thatautomount reasserts
/homeon its timeout, shadowing the dataset and breakinghome-directory access and SSH login. Customer variants never applied it.
Companion change
This must land together with two companion PRs that move the remaining
/export/homereferences to
/home:delphixuser's home directory (and.bashrc) from/export/home/delphixto/home/delphixin thedelphix-platformpackage. Without it, the
internal-devimage build fails sourcing/export/home/delphix/.bashrc./export/homereferences to
/home, most notably thecliuser's home (/home/cli) and thesshd_configAuthorizedKeysFilepath inappliance/packaging/postinst.Because that
postinstnow operates in terms of/home, the home-dataset migrationruns before the package phase (see Solution above), so the dataset is mounted at
/homeby the time those maintainer scripts run.Testing Done
Static:
shellcheck(-e SC1090 -e SC1091 -e SC2329),shfmt, andbash -nclean on
common.shandexecute. Thesedtransforms were verified againstrepresentative
fstabandpasswdsamples, including boundary cases such as/export/home2/..., which must not be rewritten.On-engine (dcoa
dlpx-develop,2026.4.0.0, with the autofs/homemap removedto mirror the fixed config):
/etc/fstaband/etc/passwdrepointed to/home,dataset mounted at both
/homeand/export/home.upgrade -v deferred, exit 0) followed by reboot: fstab to/home, passwd to/home/delphix, dual-mount pre-reboot, a single/homezfs mountafter reboot, home-directory contents intact, SSH login works.
/etc/fstaband/etc/passwdbyte-identical).
/homeautofs conflict surfaced here, and was fixed (thedelphix-ldapchange);/homeis stable across reboot once the map is removed.Full build and end-to-end upgrade:
git ab-pre-pushwith this branch plus bothcompanion PRs (delphix-platform#565 and dlpx-app-gate#4346, via
--extra-repo), andupgrade testing from
2026.3.0.0:🤖 Generated with Claude Code