Debian GNU/Linux · Services

Disable the SNMP agent and trap receiver when they are not used

When it fails: An SNMP agent or trap receiver can run on a system that is not monitored through SNMP. SNMP versions 1 and 2c authenticate with a clear-text community string and reveal detailed system information.

CB-DEB-SVC-006mediumactiveautomatedautomated fixprofile core

Description

Net-SNMP provides the agent snmpd, which answers monitoring queries on UDP port 161, and the trap receiver snmptrapd (snmptrapd.service and snmptrapd.socket) on UDP port 162.

The control passes when each unit is masked or not installed at all.

A unit that does not exist counts as compliant, so removing the package is an equally valid fix.

Rationale

With SNMPv1 and v2c, anyone who sniffs or guesses the community string reads the process list, network configuration and installed software, and may change settings if write access is configured. The agent is also remotely reachable code.

Impact

Masking a unit stops it and prevents it from starting again. The snmpget/snmpwalk client tools are not affected. Systems monitored through SNMP must exclude this control in their tailoring file and use SNMPv3 with authentication and encryption.

Audit

For each unit, run systemctl is-enabled <unit>. It must print masked, or fail because the unit does not exist: snmpd.service, snmptrapd.service, snmptrapd.socket.

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

snmpd

SNMP agent.

unit: snmpd.service
state: masked

snmptrapd

SNMP trap receiver.

unit: snmptrapd.service
state: masked

snmptrapd-socket

SNMP trap receiver socket activation.

unit: snmptrapd.socket
state: masked

Remediation

Stop and mask each unit that is installed: systemctl mask --now <unit>. If the packages are not needed at all, remove them instead: apt purge snmpd snmptrapd.

Restartnone
Disruptionlow

Rollback

Run systemctl unmask <unit> then systemctl enable --now <unit>.

snmpd

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

snmptrapd-socket

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

snmptrapd

Generated from check snmptrapd: 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 SNMP.
NIST SP 800-53 Rev. 55.1.1CM-7partial

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 snmpd and snmptrapd installed the checks fail, fix masks, audit passes after reboot; snmpd still purges cleanly.
Verified2026-10-18 by Sn0wAlice on 13, Proxmox VM, Debian 13 genericcloud image, kernel 6.12.113+deb13-cloud-amd64. Fresh image passes; with snmpd and snmptrapd installed the checks fail, fix masks, audit passes after reboot; snmpd still purges cleanly.
Introduced inv0.1.0
Created, updated2026-10-18, 2026-10-18
Translationsfr