Disable Samba
An XCCDF Rule
Description
The smb
service can be disabled with the following command:
$ sudo systemctl mask --now smb.service
Rationale
Running a Samba server provides a network-based avenue of attack, and should be disabled if not needed.
- ID
- xccdf_org.ssgproject.content_rule_service_smb_disabled
- Severity
- Low
- References
- Updated
Remediation - OS Build Blueprint
[customizations.services]
masked = ["smb"]
Remediation - Kubernetes Patch
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
spec:
config:
ignition:
version: 3.1.0
Remediation - Puppet
include disable_smb
class disable_smb {
service {'smb':
enable => false,
ensure => 'stopped',
Remediation - script:kickstart
service disable smb
Remediation - Ansible
- name: Gather the package facts
package_facts:
manager: auto
tags:
- CCE-82759-2
- disable_strategy
Remediation - Shell Script
# Remediation is applicable only in certain platforms
if rpm --quiet -q kernel; then
SYSTEMCTL_EXEC='/usr/bin/systemctl'
"$SYSTEMCTL_EXEC" stop 'smb.service'
"$SYSTEMCTL_EXEC" disable 'smb.service'