Disable Red Hat Network Service (rhnsd)
An XCCDF Rule
Description
The Red Hat Network service automatically queries Red Hat Network servers to determine whether there are any actions that should be executed, such as package updates. This only occurs if the system was registered to an RHN server or satellite and managed as such. Therhnsd
service can be disabled with the following command:
$ sudo systemctl mask --now rhnsd.service
Rationale
Although systems management and patching is extremely important to
system security, management by a system outside the enterprise enclave is not
desirable for some environments. However, if the system is being managed by RHN or
RHN Satellite Server the rhnsd
daemon can remain on.
- ID
- xccdf_org.ssgproject.content_rule_service_rhnsd_disabled
- Severity
- Low
- References
- Updated
Remediation Templates
script:kickstart
service disable rhnsd
A Puppet Snippet
include disable_rhnsd
class disable_rhnsd {
service {'rhnsd':
enable => false,
ensure => 'stopped',
}
}
OS Build Blueprint
[customizations.services]
masked = ["rhnsd"]
An Ansible Snippet
- name: Disable Red Hat Network Service (rhnsd) - Collect systemd Services Present
in the System
ansible.builtin.command: systemctl -q list-unit-files --type service
register: service_exists
changed_when: false
failed_when: service_exists.rc not in [0, 1]
A Kubernetes Patch
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
spec:
config:
ignition:
version: 3.1.0
A Shell Script
# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then
SYSTEMCTL_EXEC='/usr/bin/systemctl'
"$SYSTEMCTL_EXEC" stop 'rhnsd.service'
"$SYSTEMCTL_EXEC" disable 'rhnsd.service'
"$SYSTEMCTL_EXEC" mask 'rhnsd.service'