Debian GNU/Linux · Services

Disable the autofs automounter

When it fails: The autofs automounter can mount file systems on demand. Removable media or network shares get mounted whenever someone accesses a path.

CB-DEB-SVC-021mediumactiveautomatedautomated fixprofile serverprofile desktop-hardened

As released in v0.1.0 beta · pre-release. Current state.

Description

autofs mounts file systems (local devices, NFS or SMB shares) when a path under its maps is accessed, and unmounts them when idle.

The control passes when autofs.service is masked or not installed at all.

The control is in the server profile and in the hardened desktop profile: on standard desktops, on-demand mounts are an expected feature.

Rationale

Automatic mounting of removable media lets anyone with physical access bring in files or malicious file system images; automatic network mounts reach shares that the administrator may not expect.

Impact

File systems listed in the autofs maps are no longer mounted on demand: mount them through /etc/fstab instead. Systems that rely on autofs, such as home directories on NFS, must exclude this control in their tailoring file.

Audit

Run systemctl is-enabled autofs.service. It must print masked, or fail because the unit does not exist.

Automated: every check must pass. Scanners report each check by its id.

autofs

autofs automounter.

unit: autofs.service
state: masked

Remediation

Run systemctl mask --now autofs.service, or apt purge autofs if the package is not needed.

Restartnone
Disruptionlow

Rollback

Run systemctl unmask autofs.service then systemctl enable --now autofs.service.

autofs

Generated from check autofs: the engine writes the fix for every output, it sets the expected value and the check runs again after.

Each release turns these fixes into remediate.sh and an Ansible role per profile: dry run by default, a fix runs only when its check fails.

References

Mappings

FrameworkIDRelationNote
ANSSI-BP-028 - Recommandations de configuration d'un système GNU/Linux2.0R62partialR62 asks to disable every unneeded service; this control covers autofs.
NIST SP 800-53 Rev. 55.1.1CM-7partial
NIST SP 800-53 Rev. 55.1.1MP-7related

How this control relates to the other framework's: equivalent, stricter, looser, partial or related.

Threats mitigated

People and lifecycle

Authors
Verified2026-10-18 by Sn0wAlice on 12, Proxmox VM, Debian 12 genericcloud image, kernel 6.1.0-54-cloud-amd64. Fresh image passes; with autofs installed the check fails, fix masks, audit passes after reboot; tested with profiles server-hardened and desktop-hardened.
Verified2026-10-18 by Sn0wAlice on 13, Proxmox VM, Debian 13 genericcloud image, kernel 6.12.113+deb13-cloud-amd64. Fresh image passes; with autofs installed the check fails, fix masks, audit passes after reboot; tested with profiles server-hardened and desktop-hardened.
Introduced inv0.1.0
Created, updated2026-10-18, 2026-10-18
Translationsfr