1.1.1.3 Ensure hfs kernel module is not available

Information

The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems.

Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it.

Solution

Unload and disable the hfs kernel module.

- Run the following commands to unload the hfs kernel module:

modprobe -r hfs 2>/dev/null
rmmod hfs 2>/dev/null <xhtml:ol start="2"> - Perform the following to disable the hfs kernel module:

Create a file ending inconf with install hfs /bin/false in the /etc/modprobe.d/ directory.

Example:

# printf '%s\n' "" "install hfs /bin/false" >> /etc/modprobe.d/60-hfs.conf

Create a file ending inconf with blacklist hfs in the /etc/modprobe.d/ directory.

Example:

printf '%s\n' "" "blacklist hfs" >> /etc/modprobe.d/60-hfs.conf

See Also

https://workbench.cisecurity.org/benchmarks/23597