Skip to content

CNF-25994: Blacklist unused filesystem kernel modules - #289

Closed
sebrandon1 wants to merge 1 commit into
coreos:mainfrom
sebrandon1:hardening/blacklist-unused-filesystems
Closed

CNF-25994: Blacklist unused filesystem kernel modules#289
sebrandon1 wants to merge 1 commit into
coreos:mainfrom
sebrandon1:hardening/blacklist-unused-filesystems

Conversation

@sebrandon1

@sebrandon1 sebrandon1 commented Jul 21, 2026

Copy link
Copy Markdown

Jira: CNF-25994

Summary

Add a modprobe configuration to prevent loading of 5 filesystem kernel modules
that have no legitimate use on a container host OS:

  • cramfs — compressed ROM filesystem (embedded Linux only)
  • freevxfs — Veritas filesystem
  • hfs — legacy Mac filesystem
  • hfsplus — Mac OS Extended filesystem
  • jffs2 — Journalling Flash File System v2 (raw flash devices only)

These modules represent attack surface with zero functional value on RHCOS.
Disabling them is a CIS Benchmark RHEL 9 v2.0.0
Level 1 Server requirement (Section 1.1.1).

What is excluded

  • squashfs — actively used by CoreOS for live PXE rootfs
  • udf — used by Azure/Hyper-V Ignition for provisioning config (removed from v1 per reviewer feedback)
  • usb-storage — needed for BMC virtual media and bare-metal provisioning

Precedent and evidence

Existing RHCOS module blacklisting:

Red Hat internal adoption:

  • Red Hat IT disabled cramfs on internal infrastructure for CIS/STIG compliance (STIG V-230498)

Active CVEs in these modules:

Kernel module blacklisting on OCP in production:

  • The irdma module blacklist is already deployed across telco RAN clusters to prevent E810 NIC degraded profiles — established pattern of module_blacklist on OCP SNO

Industry security guidance:

  • RHIVOS (Red Hat In-Vehicle OS) conducted a formal kernel filesystem risk assessment and implemented module whitelisting, stating: "an attacker cannot load the unexpected modules into the kernel, and thus exploit security problems in kernel code that is otherwise unused"
  • CoreOS tracker #249 discusses kernel module management approaches
  • FCOS tracker #2152 — active discussion (May 2026) among FCOS/RHCOS maintainers on denylisting unused kernel modules by default, citing vulnerability exploitation via auto-loading. Fedora already blacklists 10 similar modules
  • secureblue runs in production with all five of these modules blacklisted

Customer demand:

  • Telco customers (e.g., Bell Mobility) have requested CIS-compliant kernel module controls on OCP, including module loading audit and hardening

Testing

Verified on OCP 4.22 (MNO, 3 master + 2 worker) and OCP 4.21 (SNO) that
blacklisting these 5 modules causes no functional regressions. These modules
are not loaded by default on RHCOS and have no consumers in the container
host stack.

References

Assisted by: Claude (Anthropic)

@openshift-ci-robot

openshift-ci-robot commented Jul 21, 2026

Copy link
Copy Markdown

@sebrandon1: This pull request references CNF-25994 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Jira: CNF-25994

Summary

Add a modprobe configuration to prevent loading of 5 filesystem kernel modules
that have no legitimate use on a container host OS:

  • cramfs — compressed ROM filesystem (embedded Linux only)
  • freevxfs — Veritas filesystem
  • hfs — legacy Mac filesystem
  • hfsplus — Mac OS Extended filesystem
  • jffs2 — Journalling Flash File System v2 (raw flash devices only)

These modules represent attack surface with zero functional value on RHCOS.
Disabling them is a CIS Benchmark RHEL 9 v2.0.0
Level 1 Server requirement (Section 1.1.1).

What is excluded

  • squashfs — actively used by CoreOS for live PXE rootfs
  • udf — used by Azure/Hyper-V Ignition for provisioning config (removed from v1 per reviewer feedback)
  • usb-storage — needed for BMC virtual media and bare-metal provisioning

Precedent and evidence

Existing RHCOS module blacklisting:

Red Hat internal adoption:

  • Red Hat IT disabled cramfs on internal infrastructure for CIS/STIG compliance (STIG V-230498)

Active CVEs in these modules:

Kernel module blacklisting on OCP in production:

  • The irdma module blacklist is already deployed across telco RAN clusters to prevent E810 NIC degraded profiles — established pattern of module_blacklist on OCP SNO

Industry security guidance:

  • RHIVOS (Red Hat In-Vehicle OS) conducted a formal kernel filesystem risk assessment and implemented module whitelisting, stating: "an attacker cannot load the unexpected modules into the kernel, and thus exploit security problems in kernel code that is otherwise unused"
  • CoreOS tracker #249 discusses kernel module management approaches
  • FCOS tracker #2152 — active discussion (May 2026) among FCOS/RHCOS maintainers on denylisting unused kernel modules by default, citing vulnerability exploitation via auto-loading. Fedora already blacklists 10 similar modules
  • secureblue runs in production with all five of these modules blacklisted

Customer demand:

  • Telco customers (e.g., Bell Mobility) have requested CIS-compliant kernel module controls on OCP, including module loading audit and hardening

Testing

Verified on OCP 4.22 (MNO, 3 master + 2 worker) and OCP 4.21 (SNO) that
blacklisting these 5 modules causes no functional regressions. These modules
are not loaded by default on RHCOS and have no consumers in the container
host stack.

References

Assisted by: Claude (Anthropic)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sebrandon1
Once this PR has been reviewed and has the lgtm label, please assign tlbueno for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Hi @sebrandon1. Thanks for your PR.

I'm waiting for a coreos member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@sebrandon1

Copy link
Copy Markdown
Author

@jlebon This is a fresh PR replacing #288 (which had broken branch history after a force-push). Same content with your review feedback addressed:

  1. Commit message — full context with module list, rationale, exclusions, CIS reference
  2. Assisted-by attributionAssisted-by: Claude (Anthropic) in commit message and PR description
  3. UDF removed — dropped from the blacklist per your Azure Ignition finding (ignition/azure.go#L59-L62). Now 5 modules, UDF listed in exclusions.

sebrandon1 added a commit to sebrandon1/compliance-scripts that referenced this pull request Jul 23, 2026
Retire release-tied hardening epics (CNF-22573, CNF-23530, CNF-25781)
and clear all associated Jira story and telco-reference PR references
from tracking data. Going forward, Jiras are only created for groups
with active upstream PRs.

tracking-5_0.json:
- Set epic to CNF-26078 (Telco Upstream Hardening)
- H2: link CNF-22661 (ComplianceAsCode/content#14602)
- M21: link CNF-25994 (coreos/rhel-coreos-config#289)
- Clear telco-reference PRs from M5, M9, M10
- Clear closed CNF-21196 from M2

tracking.json, tracking-4_22.json, tracking-4_21.json:
- Clear all Jira and PR references (all stories closed)
- Preserve status, upstream research, and verdict data
@travier

travier commented Jul 27, 2026

Copy link
Copy Markdown
Member

Related to coreos/fedora-coreos-tracker#2152. We should maybe do that upstream first?

Add a modprobe configuration to prevent loading of 5 filesystem kernel
modules that have no legitimate use on a container host OS:

- cramfs (compressed ROM filesystem, embedded Linux only)
- freevxfs (Veritas filesystem)
- hfs (legacy Mac filesystem)
- hfsplus (Mac OS Extended filesystem)
- jffs2 (Journalling Flash File System v2, raw flash devices only)

These modules represent unnecessary attack surface on RHCOS. Disabling
them is a CIS Benchmark RHEL 9 v2.0.0 Level 1 Server requirement
(Section 1.1.1).

Uses the `install <module> /bin/true` pattern (same as the existing
nouveau blacklist in overlay.d/02fcos-nouveau) to prevent loading
entirely rather than just blacklisting from autoload.

Excluded from this list:
- squashfs: actively used by CoreOS for live PXE rootfs
- udf: used by Azure/Hyper-V Ignition for provisioning config
- usb-storage: needed for BMC virtual media and bare-metal provisioning

Assisted-by: Claude (Anthropic)
@sebrandon1
sebrandon1 force-pushed the hardening/blacklist-unused-filesystems branch from 769a0f5 to d941c7b Compare July 31, 2026 02:35
@dustymabe

dustymabe commented Jul 31, 2026

Copy link
Copy Markdown
Member

I think my stance on this is that coreos/rhel-coreos-config is the RHEL layer and openshift/os is the OCP Node layer.

Today we have:

  • rhel-bootc -> rhel-coreos-config (bootimages) -> openshift/os (OCP Node Layer)

Over time IMO we should be trying to minimize what's in rhel-coreos-config.

The logic goes like this:

  1. If this change makes sense for all of RHEL -> implement in rhel-bootc
  2. If this change makes sense only for OCP -> implement in openshift/os

Now, there could be exceptions. For example if RHEL won't accept a change and for some reason implementing it at the openshift/os layer doesn't actually achieve the goal. Then we could implement it at the rhel-coreos-config layer, but I'd prefer to not start there.


Related to @travier's comment:

Related to coreos/fedora-coreos-tracker#2152. We should maybe do that upstream first?

I kind of feel the same way upstream as I do downstream (i.e. my comment above) even though things are slightly different. I still argue if we want these "security hardening" features we should implement them in Fedora either for all of Fedora OR for a subset of Fedora where a generalization can be made (like "definitely don't need this kernel module on Server use cases").

@sebrandon1

Copy link
Copy Markdown
Author

Interesting! Good to know the flow/hierarchy of things. I'm willing to try whatever. I can try opening up this PR in openshift/os.

@sebrandon1

Copy link
Copy Markdown
Author

Opened the equivalent PR at the OCP node layer per @dustymabe's guidance: openshift/os#1951

@sebrandon1

Copy link
Copy Markdown
Author

Closing in favor of: openshift/os#1951

@sebrandon1 sebrandon1 closed this Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants