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.
| Restart | none |
| Disruption | low |
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
- autofs(8), Debian manual pages Debian, vendor-doc, accessed 2026-10-18
- ANSSI-BP-028 v2.0 - Recommandations de configuration d'un système GNU/Linux (R62) ANSSI, guide, accessed 2026-10-18
Mappings
| Framework | ID | Relation | Note |
|---|---|---|---|
| ANSSI-BP-028 - Recommandations de configuration d'un système GNU/Linux2.0 | R62 | partial | R62 asks to disable every unneeded service; this control covers autofs. |
| NIST SP 800-53 Rev. 55.1.1 | CM-7 | partial | |
| NIST SP 800-53 Rev. 55.1.1 | MP-7 | related |
How this control relates to the other framework's: equivalent, stricter, looser, partial or related.
Threats mitigated
| Taxonomy | ID |
|---|---|
| MITRE ATT&CK | T1091 |
| MITRE ATT&CK | T1200 |
People and lifecycle
| Authors |
|
| Verified | 2026-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. |
| Verified | 2026-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 in | v0.1.0 |
| Created, updated | 2026-10-18, 2026-10-18 |
| Translations | fr |