Disable snmpd Service
An XCCDF Rule
Description
The snmpd
service can be disabled with the following command:
$ sudo systemctl mask --now snmpd.service
Rationale
Running SNMP software provides a network-based avenue of attack, and should be disabled if not needed.
- ID
- xccdf_org.ssgproject.content_rule_service_snmpd_disabled
- Severity
- Low
- References
- Updated
Remediation - Puppet
include disable_snmpd
class disable_snmpd {
service {'snmpd':
enable => false,
ensure => 'stopped',
Remediation - OS Build Blueprint
[customizations.services]
masked = ["snmpd"]
Remediation - Ansible
- name: Gather the package facts
package_facts:
manager: auto
tags:
- CCE-92253-4
- disable_strategy
Remediation - Shell Script
# Remediation is applicable only in certain platforms
if ( rpm --quiet -q net-snmp && rpm --quiet -q kernel-default ); then
SYSTEMCTL_EXEC='/usr/bin/systemctl'
"$SYSTEMCTL_EXEC" stop 'snmpd.service'
"$SYSTEMCTL_EXEC" disable 'snmpd.service'