SV-257583r960963_rule
V-257583
SRG-APP-000141-CTR-000315
CNTR-OS-001010
CAT I
10
Apply the machine config to disable SSHD service by executing following:
for mcpool in $(oc get mcp -oname | sed "s:.*/::" ); do
echo "apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
name: 80-sshd-service-disable-$mcpool
labels:
machineconfiguration.openshift.io/role: $mcpool
spec:
config:
ignition:
version: 3.1.0
systemd:
units:
- name: sshd.service
enabled: false
" | oc apply -f -
done
Verify the SSHD service is inactive and disabled by executing the following:
for node in $(oc get node -oname); do oc debug $node -- chroot /host /bin/bash -c 'echo -n "$HOSTNAME "; systemctl is-enabled sshd.service; systemctl is-active sshd.service' 2>/dev/null; done
If the SSHD service is either active or enabled this is a finding.
V-257583
False
CNTR-OS-001010
Verify the SSHD service is inactive and disabled by executing the following:
for node in $(oc get node -oname); do oc debug $node -- chroot /host /bin/bash -c 'echo -n "$HOSTNAME "; systemctl is-enabled sshd.service; systemctl is-active sshd.service' 2>/dev/null; done
If the SSHD service is either active or enabled this is a finding.
M
5547