Skip to content

Disable Squid

An XCCDF Rule

Description

The squid service can be disabled with the following command:
$ sudo systemctl mask --now squid.service

Rationale

Running proxy server software provides a network-based avenue of attack, and should be removed if not needed.

ID
xccdf_org.ssgproject.content_rule_service_squid_disabled
Severity
Unknown
Updated

Remediation Templates

OS Build Blueprint

[customizations.services]
masked = ["squid"]

A Puppet Snippet

include disable_squid
class disable_squid {
  service {'squid':
    enable => false,
    ensure => 'stopped',
  }
}

An Ansible Snippet

- name: Gather the package facts
  package_facts:
    manager: auto
  tags:
  - disable_strategy
  - low_complexity

A Shell Script

# Remediation is applicable only in certain platforms
if ( rpm --quiet -q squid && rpm --quiet -q kernel ); then
SYSTEMCTL_EXEC='/usr/bin/systemctl'
"$SYSTEMCTL_EXEC" stop 'squid.service'
"$SYSTEMCTL_EXEC" disable 'squid.service'
"$SYSTEMCTL_EXEC" mask 'squid.service'