DLPX-86523 CIS: /home filesystem and mount options#756
Open
justsanjeev wants to merge 18 commits into
Open
Conversation
60315a7 to
2547134
Compare
4447b5d to
70aaee3
Compare
5a45f37 to
28406a7
Compare
28406a7 to
abd7103
Compare
abd7103 to
b8d8ec5
Compare
b8d8ec5 to
6497d9d
Compare
6497d9d to
bacfefb
Compare
58d854c to
fe722dd
Compare
fe722dd to
52199cc
Compare
52199cc to
c752b4f
Compare
c752b4f to
4c2f334
Compare
4c2f334 to
823162d
Compare
554ea59 to
b81c2e4
Compare
b81c2e4 to
7c5bcea
Compare
sebroy
requested changes
Mar 26, 2025
7c5bcea to
5ce66b3
Compare
sebroy
requested changes
May 13, 2025
b061620 to
7cc9bcf
Compare
2309e84 to
332ae64
Compare
Fixing the headers in the changed files. Incoprorating new comments from Seb Resolving comments from Seb on redundant nodev PR URL: https://www.github.com/delphix/appliance-build/pull/756
…tp-v2, disabling cache is the cleaner approach here
…tp-v2, disabling cache is the cleaner approach here- Change #2
…tp-v2, disabling cache is the cleaner approach here- Change #3
…thon package' woked in the removal of chache directorywith additional changes made.
…latform for non empty /export/home
…latform for non empty /export/home
…asks/main.yml as well
…e the /export/home back due to buildserver
…per Prakash-s suggestion
332ae64 to
ed1b547
Compare
ed1b547 to
271dde1
Compare
justsanjeev
commented
May 7, 2026
Author
There was a problem hiding this comment.
Note: An unrelated log/debug file was accidentally included in one of the earlier development commits. It is not part of the final intended change and will be cleaned up during the final squash/rebase before merge. Kindly ignore it during review.
prakashsurya
reviewed
Jun 1, 2026
| if grep -qE '^[^#].*[[:space:]]/home[[:space:]]' /etc/fstab; then | ||
| if ! grep -qE '^[^#].*[[:space:]]/home[[:space:]].*nodev' /etc/fstab || | ||
| ! grep -qE '^[^#].*[[:space:]]/home[[:space:]].*nosuid' /etc/fstab; then | ||
| sed -i '/^[^#].*[[:space:]]\/home[[:space:]]/ s/defaults/defaults,nodev,nosuid/' \ |
Contributor
There was a problem hiding this comment.
why do we do this here, and in the delphix-platform ansible logic via delphix/delphix-platform#477 ?
do we need to do the same configuration in 2 places?
prakashsurya
pushed a commit
that referenced
this pull request
Jun 1, 2026
Squash of #756: mount the home ZFS dataset at /home instead of /export/home for CIS compliance, with nodev,nosuid on the /home fstab entry. Includes the build-side fstab (90-raw-disk-image), upgrade-container template, ansible role path updates, and the upgrade execute changes as authored in #756. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
prakashsurya
added a commit
that referenced
this pull request
Jun 1, 2026
… /home Re-implements the upgrade-path migration from #756: - common.sh: add an idempotent migrate_export_home_to_home() that repoints the home dataset's /etc/fstab entry and affected /etc/passwd home directories from /export/home to /home and mounts /home, leaving the old /export/home mount live until reboot. Self-guards on the fstab entry, so it is a no-op once migrated or inside an already-/home upgrade container. - execute: replace #756's inline whole-file sed (which ran early) with a single guarded call to the function, placed late -- after the package phase and set-bootfs, before the nodev/nosuid block that hardens the /home entry it creates. - delphix-ldap: stop adding the '/home auto_home -nobrowse' autofs map. This dev-only role's automount reasserts /home on its timeout cycle, shadowing the home dataset and breaking home-dir access and SSH login. Customer variants never applied it, so no upgrade migration handling is needed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
prakashsurya
added a commit
that referenced
this pull request
Jun 1, 2026
… /home Re-implements the upgrade-path migration from #756: - common.sh: add an idempotent migrate_export_home_to_home() that repoints the home dataset's /etc/fstab entry and affected /etc/passwd home directories from /export/home to /home and mounts /home, leaving the old /export/home mount live until reboot. Self-guards on the fstab entry, so it is a no-op once migrated or inside an already-/home upgrade container. - execute: replace #756's inline whole-file sed (which ran early) with a single guarded call to the function, placed late -- after the package phase and set-bootfs, before the nodev/nosuid block that hardens the /home entry it creates. - execute: drop the '! systemd-detect-virt -qc' guard around the nodev/nosuid fstab hardening. Unlike set-bootfs (which rewrites the host boot pointer and must stay host-only), this is a plain fstab edit whose inner grep checks already make it idempotent and a no-op where the options are present; running it regardless is safe and consistent with the unguarded migration call. - delphix-ldap: stop adding the '/home auto_home -nobrowse' autofs map. This dev-only role's automount reasserts /home on its timeout cycle, shadowing the home dataset and breaking home-dir access and SSH login. Customer variants never applied it, so no upgrade migration handling is needed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
prakashsurya
added a commit
that referenced
this pull request
Jun 1, 2026
… /home Re-implements the upgrade-path migration from #756: - common.sh: add an idempotent migrate_export_home_to_home() that repoints the home dataset's /etc/fstab entry and affected /etc/passwd home directories from /export/home to /home and mounts /home, leaving the old /export/home mount live until reboot. Self-guards on the fstab entry, so it is a no-op once migrated or inside an already-/home upgrade container. - execute: replace #756's inline whole-file sed (which ran early) with a single unconditional call to the function, placed late -- after the package phase and set-bootfs, before the nodev/nosuid block that hardens the /home entry it creates. No CURRENT_VERSION guard is needed: /etc/fstab maps the home dataset to /export/home only on an in-place upgrade of a pre-change engine, so the function's own fstab guard fully covers every other context (fresh installs and upgrade containers use the /home template). - execute: drop the '! systemd-detect-virt -qc' guard around the nodev/nosuid fstab hardening. Unlike set-bootfs (which rewrites the host boot pointer and must stay host-only), this is a plain fstab edit whose inner grep checks already make it idempotent and a no-op where the options are present; running it regardless is safe and consistent with the unguarded migration call. - delphix-ldap: stop adding the '/home auto_home -nobrowse' autofs map. This dev-only role's automount reasserts /home on its timeout cycle, shadowing the home dataset and breaking home-dir access and SSH login. Customer variants never applied it, so no upgrade migration handling is needed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
prakashsurya
added a commit
that referenced
this pull request
Jun 1, 2026
… /home Re-implements the upgrade-path migration from #756: - common.sh: add an idempotent migrate_export_home_to_home() that repoints the home dataset's /etc/fstab entry and affected /etc/passwd home directories from /export/home to /home and mounts /home, leaving the old /export/home mount live until reboot. Self-guards on the fstab entry, so it is a no-op once migrated or inside an already-/home upgrade container. - common.sh: add harden_home_mount_options(), which ensures the /home fstab entry carries nodev,nosuid for CIS compliance. Idempotent and a no-op where the options are already present. - execute: replace #756's inline whole-file sed (which ran early) with a single unconditional call to migrate_export_home_to_home(), placed late -- after the package phase and set-bootfs, before the hardening call. No CURRENT_VERSION guard is needed: /etc/fstab maps the home dataset to /export/home only on an in-place upgrade of a pre-change engine, so the function's own fstab guard covers every other context. - execute: replace #756's inline nodev/nosuid block with a call to harden_home_mount_options(). Drop the '! systemd-detect-virt -qc' guard it had: unlike set-bootfs (which rewrites the host boot pointer and must stay host-only), this is a plain fstab edit whose checks already make it idempotent and a no-op where the options are present, so running it regardless is safe and consistent with the migration call. - delphix-ldap: stop adding the '/home auto_home -nobrowse' autofs map. This dev-only role's automount reasserts /home on its timeout cycle, shadowing the home dataset and breaking home-dir access and SSH login. Customer variants never applied it, so no upgrade migration handling is needed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
CIS is looking or a single home directory filesystem mounted at the
/homelocation, currently we have the home dataset is mounted on/export/homeDue to that we see the below issues in the CIS Report
Mounting the home dataset to `/home`.Solution
Testing Done
I have worked on suggestions on PR(s) and posted new changes -
The major changes are
Build: https://selfservice-jenkins.eng-tools-prd.aws.delphixcloud.com/job/appliance-build-orchestrator-pre-push/14047/console 🟢
Manual Upgrade with a unstructured source mounted and a vdb created. Upgrades are tested from 2026.3.0.0 to develop[s3://dev-de-images/builds/jenkins-selfservice/appliance-build/develop/pre-push/6578/upgrade-artifacts/internal-qa.upgrade.tar]
fstab for upgraded engines, has nosuid and nodev ✅
New Engine: sr-dev01.dlpxdc.co
✳️ ✳️ ✳️ ✳️ ✳️ New SCA scan updates [Please note that with Ubuntu 24.04 , there are changes in the CIS test, we have Ran the CIS Scans now with a new policy. The controls 7402 , 7403, 14601 and 13248 are not present in the new policy instead we have 3 new controls.]
Compliance_Report_cisScanReport01_perfr3sr2_20260116.pdf
Build:
git ab-pre-push: appliance-build-orchestrator-pre-push/12953/ - ✅New Engine
Here, In a new engine we have successfully overcome the issue of backup dir creation problem observed with the last build.
Manual Upgrades
sudo lsof +f -- /export/homeresults below shows that all active file handles are actually pointing to:/home/delphix. This means:The
/export/home -> /homeis a symbolic link pointing from /export/home to /home. This means: