Linux distributions
TMA-ALINUX3-1.8.4
Ensure GDM automount is configured
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.
Méthode de vérification
Méthode d'audit: Commande shell
alt0() { command -v gsettings >/dev/null 2>&1 || { echo "step1: gsettings not installed"; return 1; }; o=$(bash -c 'gsettings writable org.gnome.desktop.media-handling automount' 2>&1); printf '%s\n' "$o" | tr -s ' \t' ' ' | sed 's/^ //;s/ $//' | grep -Fxq -- false || { echo step1: missing false; return 1; }; command -v gsettings >/dev/null 2>&1 || { echo "step2: gsettings not installed"; return 1; }; o=$(bash -c 'gsettings writable org.gnome.desktop.media-handling automount-open' 2>&1); printf '%s\n' "$o" | tr -s ' \t' ' ' | sed 's/^ //;s/ $//' | grep -Fxq -- false || { echo step2: missing false; return 1; }; command -v gsettings >/dev/null 2>&1 || { echo "step3: gsettings not installed"; return 1; }; o=$(bash -c 'gsettings get org.gnome.desktop.media-handling automount' 2>&1); printf '%s\n' "$o" | tr -s ' \t' ' ' | sed 's/^ //;s/ $//' | grep -Fxq -- false || { echo step3: missing false; return 1; }; command -v gsettings >/dev/null 2>&1 || { echo "step4: gsettings not installed"; return 1; }; o=$(bash -c 'gsettings get org.gnome.desktop.media-handling automount-open' 2>&1); printf '%s\n' "$o" | tr -s ' \t' ' ' | sed 's/^ //;s/ $//' | grep -Fxq -- false || { echo step4: missing false; return 1; }; }; if alt0; then echo compliant; fi- Sortie attendue
compliant
Méthode de correction
Méthode de correction: Recommandation ou correctif d'infrastructure
1. Create or edit the file /etc/dconf/profile/user and add the following lines if they do not exist: user-db:user system-db:local Example: #!/usr/bin/env bash { l_dir="/etc/dconf/profile/" [ ! -d "$l_dir" ] && mkdir /etc/dconf/profile/ ! grep -Psq '^\h*user-db:user\b' "$l_dir/user" && \ printf '%s\n' "" "user-db:user" >> "$l_dir/user" ! grep -Psq '^\h*system-db:local\b' "$l_dir/user" && \ sed -ri '/^\s*user-db:user/a system-db:local' "$l_dir/user" } 2. Run the following command to create the /etc/dconf/db/local.d/ and /etc/dconf/db/local.d/locks/ directories if either does not exist: # [ ! -d "/etc/dconf/db/local.d/locks/" ] && mkdir -p /etc/dconf/db/local.d/locks/ 3. Create or edit a file i…
Propriétés
- Systèmes d'exploitation
- alinux-3
- Étiquettes
- cis-convertedlinux
- Référence
- CIS Alibaba Cloud Linux 3 Benchmark v2.0.0 - 1.8.4
Vérifier cet hôte
Exécutez cette commande sur une machine que vous êtes autorisé à auditer. L'analyse est en lecture seule.
tmaegis scan --target linux