Skip to content

2.1.15 Ensure snmp services are not in use

Audit#

Run the following command to verify snmpd is not installed:

# dpkg-query -s snmpd &>/dev/null && echo "snmpd is installed"
Nothing should be returned.

- OR - - IF - the package is required for dependencies: Run the following command to verify snmpd.service is not enabled:

# systemctl is-enabled snmpd.service 2>/dev/null | grep 'enabled'
Nothing should be returned.

Run the following command to verify the snmpd.service is not active:

# systemctl is-active snmpd.service 2>/dev/null | grep '^active'
Nothing should be returned.

Note: If the package is required for a dependency - Ensure the dependent package is approved by local site policy - Ensure stopping and masking the service and/or socket meets local site policy

Remediation#

Run the following commands to stop snmpd.service and remove the snmpd package:

# systemctl stop snmpd.service
# apt purge snmpd

- OR - if the package is required for dependencies: Run the following commands to stop and mask the snmpd.service:

# systemctl stop snmpd.service
# systemctl mask snmpd.service