| name | cis-ubuntu1804-v220-1-1-1-6 |
| description | Ensure mounting of squashfs filesystems is disabled |
| category | cis-storage |
| version | 2.2.0 |
| author | cyberstrike-official |
| tags | ["cis","ubuntu","linux","ubuntu-18.04","filesystem","squashfs","kernel-module"] |
| cis_id | 1.1.1.6 |
| cis_benchmark | CIS Ubuntu Linux 18.04 LTS Benchmark v2.2.0 |
| tech_stack | ["ubuntu","linux"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
Ensure mounting of squashfs filesystems is disabled
Profile
Level 2 - Server / Level 2 - Workstation, Assessment: Automated
Description
The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A squashfs image can be used without having to first decompress the image.
Rationale
Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it.
Impact
As Snap packages utilizes squashfs as a compressed filesystem, disabling squashfs will cause Snap packages to fail.
Snap application packages of software are self-contained and work across a range of Linux distributions. This is unlike traditional Linux package management approaches, like APT or RPM, which require specifically adapted packages per Linux distribution on an application update and delay therefore application deployment from developers to their software's end-user. Snaps themselves have no dependency on any external store ("App store"), can be obtained from any source and can be therefore used for upstream software deployment.
Audit Procedure
Command Line
Run the following script to verify the squashfs module is disabled:
#!/usr/bin/env bash
{
l_output="" l_output2="" l_output3="" l_dl=""
l_mname="squashfs"
l_mtype="fs"
l_searchloc="/lib/modprobe.d/*.conf /usr/local/lib/modprobe.d/*.conf /run/modprobe.d/*.conf /etc/modprobe.d/*.conf"
l_mpath="/lib/modules/**/kernel/$l_mtype"
l_mpname="$(tr '-' ' ' <<< "$l_mname")"
l_mndir="$(tr '-' '/' <<< "$l_mname")"
module_loadable_chk()
{
l_loadable="$(modprobe -n -v "$l_mname")"
[ "$(wc -l <<< )" -gt ] && l_loadable=
grep -Pq -- <<< ;
l_output=
l_output2=
}
()
{
! lsmod | grep > /dev/null 2>&1;
l_output=
l_output2=
}
()
{
l_dl=
modprobe --showconfig | grep -Pq -- ;
l_output=
l_output2=
}
l_mdir ;
[ -d ] && [ -n ];
l_output3=
[ != ] && module_deny_chk
[ = ];
module_loadable_chk
module_loaded_chk
l_output=
[ -n ] && -e
[ -z ];
-e
-e
[ -n ] && -e
}