CIS Squid Proxy Benchmark

Security configuration benchmark for Squid caching proxy server

v1.0.0 03-2025

Overview

▶

This benchmark provides prescriptive guidance for establishing a secure configuration posture for Squid Proxy. It covers access control lists, authentication, TLS configuration, logging, cache management, header stripping, version hiding, and URL filtering.

14Recommendations
7Sections
2Profile Levels
SectionAreaFocus
1Installation & PermissionsProcess user, file permissions
2Access ControlACLs, authentication, network restrictions
3TLS & NetworkTLS configuration, interface binding
4LoggingAccess log format, log rotation
5Cache & HeadersCache limits, header stripping
6HardeningVersion suppression, connection timeouts
7Maintenance & FilteringUpdates, URL/domain filtering

Profile Definitions

▶
ProfileDescriptionIntended Use
L1Level 1 — StandardEssential security for all Squid deployments; minimal performance impact.
L2Level 2 — HardenedAdvanced hardening for PCI-DSS, HIPAA, or high-security environments.

1 — Installation & Permissions

▶

1.1 Process & File Security

▶
1.1.1 Ensure Squid runs as a non-root user (Automated)
L1 Auto
Description

This recommendation verifies that Squid runs as a non-root user on the Squid caching proxy server. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Squid caching proxy server vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Verify Squid runs as a non-root user
ps -eo user,pid,comm | grep squid
grep 'cache_effective_user\|cache_effective_group' /etc/squid/squid.conf
Remediation
# Configure Squid to run as proxy user
# In squid.conf:
cache_effective_user proxy
cache_effective_group proxy
chown -R proxy:proxy /var/spool/squid /var/log/squid
1.1.2 Ensure configuration file permissions are restricted (Automated)
L1 Auto
Description

This setting ensures that configuration file permissions are restricted on the Squid caching proxy server. Restricting this capability limits potential abuse and enforces the principle of least privilege across the environment.

Rationale

Unrestricted access to this capability could allow unauthorized users or processes to perform actions beyond their intended scope. Applying least-privilege principles to the Squid caching proxy server is essential for defense in depth.

Audit
# Check configuration file permissions
stat -c '%a %U %G' /etc/squid/squid.conf
find /etc/squid -type f -exec stat -c '%a %n' {} \;
Remediation
# Restrict configuration permissions
chmod 640 /etc/squid/squid.conf
chown root:proxy /etc/squid/squid.conf
chmod 750 /etc/squid/

2 — Access Control

▶

2.1 ACLs & Authentication

▶
2.1.1 Ensure ACLs restrict access to authorized networks (Automated)
L1 Auto
Description

This recommendation verifies that ACLs restrict access to authorized networks on the Squid caching proxy server. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Squid caching proxy server vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Verify ACLs restrict access
grep -E '^acl|^http_access' /etc/squid/squid.conf | grep -v '^#'
Remediation
# Configure restrictive ACLs
# In squid.conf:
acl localnet src 10.0.0.0/8
acl localnet src 172.16.0.0/12
acl localnet src 192.168.0.0/16
acl SSL_ports port 443
acl Safe_ports port 80 443 21 70 210 280 488 591 777 1025-65535
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localnet
http_access deny all
2.1.2 Ensure proxy authentication is required (Automated)
L2 Auto
Description

This recommendation ensures that proxy authentication is required on the Squid caching proxy server. Enforcing this requirement establishes a minimum security standard and prevents insecure configurations.

Rationale

Without this enforcement, the Squid caching proxy server may accept insecure configurations that weaken overall security posture. Mandating this control ensures consistent protection against common attack vectors.

Audit
# Check if authentication is required
grep -E 'auth_param|proxy_auth' /etc/squid/squid.conf | grep -v '^#'
Remediation
# Configure NCSA authentication
# In squid.conf:
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd
auth_param basic children 5
auth_param basic realm Squid Proxy
auth_param basic credentialsttl 2 hours
acl authenticated proxy_auth REQUIRED
http_access allow authenticated
http_access deny all
# Create password file:
htpasswd -c /etc/squid/passwd first_user

3 — TLS & Network

▶

3.1 Encryption & Binding

▶
3.1.1 Ensure TLS is configured with minimum version 1.2 (Automated)
L1 Auto
Description

This recommendation verifies that TLS is configured with minimum version 1.2 on the Squid caching proxy server. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Squid caching proxy server vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Verify HTTPS/TLS interception certs
grep -E 'ssl_bump|https_port|tls_outgoing' /etc/squid/squid.conf | grep -v '^#'
Remediation
# Configure HTTPS port with TLS
# In squid.conf:
https_port 3129 cert=/etc/squid/certs/proxy.pem key=/etc/squid/certs/proxy-key.pem
tls_outgoing_options min-version=1.2
tls_outgoing_options options=NO_SSLv3,NO_TLSv1,NO_TLSv1_1
3.1.2 Ensure listening port is bound to specific interface (Automated)
L1 Auto
Description

This recommendation verifies that listening port is bound to specific interface on the Squid caching proxy server. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Squid caching proxy server vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Verify listening port is non-default or restricted
grep '^http_port' /etc/squid/squid.conf
ss -tlnp | grep squid
Remediation
# Bind to specific interface and restrict port
# In squid.conf:
http_port 10.0.0.1:3128
# Do NOT use 0.0.0.0:3128

4 — Logging

▶

4.1 Access Logs & Rotation

▶
4.1.1 Ensure detailed access logging is enabled (Automated)
L1 Auto
Description

This recommendation verifies that detailed access logging is enabled on the Squid caching proxy server. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Squid caching proxy server vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check access logging configuration
grep 'access_log\|logformat' /etc/squid/squid.conf | grep -v '^#'
Remediation
# Enable detailed access logging
# In squid.conf:
logformat combined %>a %[ui %[un [%tl] "%rm %ru HTTP/%rv" %>Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh
access_log daemon:/var/log/squid/access.log combined
4.1.2 Ensure log rotation is configured (Automated)
L1 Auto
Description

This recommendation verifies that log rotation is configured on the Squid caching proxy server. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Squid caching proxy server vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check log rotation
cat /etc/logrotate.d/squid
ls -la /var/log/squid/
Remediation
# Configure log rotation
cat > /etc/logrotate.d/squid <<'EOF'
/var/log/squid/*.log {
    daily
    rotate 30
    compress
    delaycompress
    missingok
    notifempty
    postrotate
        squid -k rotate
    endscript
}
EOF

5 — Cache & Headers

▶

5.1 Cache Limits & Header Security

▶
5.1.1 Ensure cache size limits are configured (Automated)
L1 Auto
Description

This recommendation verifies that cache size limits are configured on the Squid caching proxy server. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Squid caching proxy server vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Verify cache size limits
grep -E 'cache_dir|maximum_object_size|cache_mem' /etc/squid/squid.conf | grep -v '^#'
Remediation
# Configure appropriate cache limits
# In squid.conf:
cache_mem 256 MB
maximum_object_size 50 MB
maximum_object_size_in_memory 1 MB
cache_dir ufs /var/spool/squid 10000 16 256
5.1.2 Ensure sensitive headers are stripped (Automated)
L2 Auto
Description

This recommendation verifies that sensitive headers are stripped on the Squid caching proxy server. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Squid caching proxy server vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check if sensitive headers are stripped
grep -E 'request_header_access|reply_header_access' /etc/squid/squid.conf | grep -v '^#'
Remediation
# Strip sensitive headers
# In squid.conf:
request_header_access Via deny all
request_header_access X-Forwarded-For deny all
request_header_access Referer deny all
reply_header_access X-Squid-Error deny all
reply_header_access Server deny all

6 — Hardening

▶

6.1 Information Disclosure & Timeouts

▶
6.1.1 Ensure server version string is suppressed (Automated)
L1 Auto
Description

This recommendation verifies that server version string is suppressed on the Squid caching proxy server. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Squid caching proxy server vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Verify server version string is hidden
grep 'httpd_suppress_version_string\|visible_hostname' /etc/squid/squid.conf | grep -v '^#'
Remediation
# Hide version information
# In squid.conf:
httpd_suppress_version_string on
visible_hostname proxy
6.1.2 Ensure connection timeout limits are configured (Automated)
L1 Auto
Description

This recommendation verifies that connection timeout limits are configured on the Squid caching proxy server. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Squid caching proxy server vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check connection timeout settings
grep -E 'connect_timeout|request_timeout|persistent_request_timeout' /etc/squid/squid.conf | grep -v '^#'
Remediation
# Configure connection timeouts
# In squid.conf:
connect_timeout 30 seconds
request_timeout 60 seconds
persistent_request_timeout 30 seconds
client_lifetime 8 hours
pconn_timeout 30 seconds

7 — Maintenance & Filtering

▶

7.1 Updates & URL Filtering

▶
7.1.1 Ensure Squid is running the latest stable version (Manual)
L1 Manual
Description

This recommendation verifies that Squid is running the latest stable version on the Squid caching proxy server. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Squid caching proxy server vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check Squid version
squid -v | head -3
dpkg -l squid 2>/dev/null || rpm -q squid 2>/dev/null
Remediation
# Update Squid to latest stable
apt-get update && apt-get install --only-upgrade squid
# Or:
yum update squid
7.1.2 Ensure URL/domain filtering is configured (Automated)
L1 Auto
Description

This recommendation verifies that URL/domain filtering is configured on the Squid caching proxy server. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Squid caching proxy server vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Verify blocked sites/domains list exists
grep 'dstdomain\|url_regex\|urlpath_regex' /etc/squid/squid.conf | grep -v '^#'
ls -la /etc/squid/blocked*
Remediation
# Configure URL filtering
# Create blocked domains file:
echo '.malware-domain.com' > /etc/squid/blocked_domains.txt
# In squid.conf:
acl blocked_sites dstdomain "/etc/squid/blocked_domains.txt"
http_access deny blocked_sites