| name | cis-ubuntu1804-v220-1-8-7 |
| description | Ensure GDM disabling automatic mounting of removable media is not overridden |
| category | cis-networking |
| version | 2.2.0 |
| author | cyberstrike-official |
| tags | ["cis","ubuntu","linux","ubuntu-18.04","gdm","gnome","automount","lockdown","dconf"] |
| cis_id | 1.8.7 |
| cis_benchmark | CIS Ubuntu Linux 18.04 LTS Benchmark v2.2.0 |
| tech_stack | ["ubuntu","linux"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
1.8.7 Ensure GDM disabling automatic mounting of removable media is not overridden (Automated)
Profile Applicability
- Level 1 - Server
- Level 2 - Workstation
Description
By default GNOME automatically mounts removable media when inserted as a convenience to the user.
By using the lockdown mode in dconf, you can prevent users from changing specific settings.
To lock down a dconf key or subpath, create a locks subdirectory in the keyfile directory. The files inside this directory contain a list of keys or subpaths to lock. Just as with the keyfiles, you may add any number of files to this directory.
Example Lock File:
# Lock desktop media-handling settings
/org/gnome/desktop/media-handling/automount
/org/gnome/desktop/media-handling/automount-open
Rationale
With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves.
Impact
The use of portable hard drives is very common for workstation users.
Audit Procedure
Command Line
Run the following script to verify disable automatic mounting is locked:
#!/usr/bin/env bash
{
l_pkgoutput=""
if command -v dpkg-query > /dev/null 2>&1; then
l_pq="dpkg-query -s"
elif command -v rpm > /dev/null 2>&1; then
l_pq="rpm -q"
fi
l_pcl="gdm gdm3"
for l_pn in $l_pcl; do
$l_pq "$l_pn" > /dev/null 2>&1 && l_pkgoutput=
[ -n ];
l_output= l_output2=
l_kfd=.
l_kfd2=.
[ -d ];
grep -Piq ;
l_output=
l_output2=
l_output2=
[ -d ];
grep -Piq ;
l_output=
l_output2=
l_output2=
l_output=
[ -n ] && -e
[ -z ];
-e
-e
[ -n ] && -e
}