CIS HAProxy 2.8 Benchmark

Secure configuration guidelines for HAProxy 2.8 LTS load balancer and reverse proxy

v1.0.0 January 2025

Overview

▶

This CIS Benchmark provides prescriptive guidance for establishing a secure configuration posture for HAProxy 2.8 LTS. Recommendations cover installation hardening, TLS configuration, access control lists, logging, security headers, and health check configuration for production load balancing environments.

~100Recommendations
6Sections
2Profile Levels
SectionAreaFocus
1InstallationInstall, global settings
2TLS / SSLTLS config, certificates
3Access ControlACLs, rate limiting
4LoggingSyslog, statistics
5HeadersResponse headers, filtering
6ResilienceHealth checks, timeouts

Profile Definitions

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

1 — Installation & Configuration

▶

1.1 Installation

▶
1.1.1 Ensure HAProxy Runs Under a Dedicated User (Automated)
L1 Auto
Description

This recommendation verifies that HAProxy Runs Under a Dedicated User on the HAProxy 2.8 load balancer. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to hAProxy Runs Under a Dedicated User may leave the HAProxy 2.8 load balancer vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
ps -ef | grep haproxy
# Should run as 'haproxy' user, not root
grep -E '^(user|group)' /etc/haproxy/haproxy.cfg
Remediation
# In /etc/haproxy/haproxy.cfg global section:
global
    user    haproxy
    group   haproxy
1.1.2 Ensure HAProxy Is the Latest Stable Version (Manual)
L1 Manual
Description

This recommendation verifies that HAProxy Is the Latest Stable Version on the HAProxy 2.8 load balancer. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to hAProxy Is the Latest Stable Version may leave the HAProxy 2.8 load balancer vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
haproxy -v
# Compare with https://www.haproxy.org/
Remediation
# Update to latest 2.8.x patch:
dnf update haproxy   # RHEL/Rocky
apt upgrade haproxy  # Debian/Ubuntu
1.1.3 Ensure Configuration File Permissions Are Restrictive (Automated)
L1 Auto
Description

File and directory permissions for Configuration File should be set to Restrictive. Overly permissive access controls can allow unauthorized users to read, modify, or execute sensitive files, potentially compromising the HAProxy 2.8 load balancer.

Rationale

Incorrect permissions on Configuration File could allow unauthorized reading, writing, or execution of critical files. Proper file permissions are a foundational control that prevents privilege escalation and data tampering.

Audit
stat -c '%a %U:%G' /etc/haproxy/haproxy.cfg
# Should be 640 root:haproxy or 600 root:root
Remediation
chown root:haproxy /etc/haproxy/haproxy.cfg
chmod 640 /etc/haproxy/haproxy.cfg

1.2 Global Settings

▶
1.2.1 Ensure Chroot Is Configured (Automated)
L1 Auto
Description

This recommendation addresses the proper configuration of Chroot on the HAProxy 2.8 load balancer. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

Misconfiguration of Chroot can lead to security gaps that may be exploited by attackers. A properly configured HAProxy 2.8 load balancer reduces exposure to both known vulnerabilities and configuration drift.

Audit
grep -i chroot /etc/haproxy/haproxy.cfg
Remediation
# In /etc/haproxy/haproxy.cfg global section:
global
    chroot /var/lib/haproxy
1.2.2 Ensure Daemon Mode Is Enabled (Automated)
L1 Auto
Description

This setting controls whether Daemon Mode is enabled on the HAProxy 2.8 load balancer. Enabling this feature strengthens the security posture by enforcing the recommended configuration via haproxy.cfg or HAProxy runtime API.

Rationale

Without Daemon Mode enabled, the HAProxy 2.8 load balancer may lack critical protections against known attack vectors. Enabling this control mitigates risk and aligns the deployment with industry-accepted security baselines.

Audit
grep -E '^[[:space:]]*daemon' /etc/haproxy/haproxy.cfg
Remediation
# In /etc/haproxy/haproxy.cfg global section:
global
    daemon
1.2.3 Ensure maxconn Is Set Appropriately (Automated)
L1 Auto
Description

This recommendation verifies that maxconn Is Set Appropriately on the HAProxy 2.8 load balancer. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to maxconn Is Set Appropriately may leave the HAProxy 2.8 load balancer vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep maxconn /etc/haproxy/haproxy.cfg
Remediation
# Set global and per-frontend maxconn:
global
    maxconn 50000

frontend http-in
    maxconn 10000

2 — TLS / SSL

▶

2.1 TLS Configuration

▶
2.1.1 Ensure Minimum TLS Version Is 1.2 (Automated)
L1 Auto
Description

This recommendation verifies that Minimum TLS Version Is 1.2 on the HAProxy 2.8 load balancer. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to minimum TLS Version Is 1.2 may leave the HAProxy 2.8 load balancer vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep -i ssl-min-ver /etc/haproxy/haproxy.cfg
# Or in bind line: ssl-min-ver TLSv1.2
Remediation
# In global or bind directive:
global
    ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets

# Or per-frontend:
bind *:443 ssl crt /etc/haproxy/certs/ ssl-min-ver TLSv1.2
2.1.2 Ensure Strong Cipher Suites Are Used (Automated)
L1 Auto
Description

This recommendation verifies that Strong Cipher Suites Are Used on the HAProxy 2.8 load balancer. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to strong Cipher Suites Are Used may leave the HAProxy 2.8 load balancer vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep -i ssl-default-bind-ciphers /etc/haproxy/haproxy.cfg
Remediation
global
    ssl-default-bind-ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305
    ssl-default-bind-ciphersuites TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
2.1.3 Ensure HSTS Is Enabled (Automated)
L1 Auto
Description

This setting controls whether HSTS is enabled on the HAProxy 2.8 load balancer. Enabling this feature strengthens the security posture by enforcing the recommended configuration via haproxy.cfg or HAProxy runtime API.

Rationale

Without HSTS enabled, the HAProxy 2.8 load balancer may lack critical protections against known attack vectors. Enabling this control mitigates risk and aligns the deployment with industry-accepted security baselines.

Audit
grep -i 'Strict-Transport-Security' /etc/haproxy/haproxy.cfg
Remediation
frontend https-in
    http-response set-header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"

2.2 Certificate Management

▶
2.2.1 Ensure SSL Certificate File Permissions Are Restrictive (Automated)
L1 Auto
Description

File and directory permissions for SSL Certificate File should be set to Restrictive. Overly permissive access controls can allow unauthorized users to read, modify, or execute sensitive files, potentially compromising the HAProxy 2.8 load balancer.

Rationale

Incorrect permissions on SSL Certificate File could allow unauthorized reading, writing, or execution of critical files. Proper file permissions are a foundational control that prevents privilege escalation and data tampering.

Audit
stat -c '%a %U:%G' /etc/haproxy/certs/*.pem
# Should be 600 root:root or 640 root:haproxy
Remediation
chown root:haproxy /etc/haproxy/certs/*.pem
chmod 640 /etc/haproxy/certs/*.pem
2.2.2 Ensure OCSP Stapling Is Enabled (Automated)
L2 Auto
Description

This setting controls whether OCSP Stapling is enabled on the HAProxy 2.8 load balancer. Enabling this feature strengthens the security posture by enforcing the recommended configuration via haproxy.cfg or HAProxy runtime API.

Rationale

Without OCSP Stapling enabled, the HAProxy 2.8 load balancer may lack critical protections against known attack vectors. Enabling this control mitigates risk and aligns the deployment with industry-accepted security baselines.

Audit
grep -i 'ocsp-update' /etc/haproxy/haproxy.cfg
Remediation
# In bind line:
bind *:443 ssl crt /etc/haproxy/certs/ ocsp-update on

3 — Access Control

▶

3.1 ACLs & Restrictions

▶
3.1.1 Ensure Management Interfaces Are Restricted by IP (Automated)
L1 Auto
Description

This recommendation verifies that Management Interfaces Are Restricted by IP on the HAProxy 2.8 load balancer. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to management Interfaces Are Restricted by IP may leave the HAProxy 2.8 load balancer vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check stats/admin frontend for ACL restrictions:
grep -A5 'stats' /etc/haproxy/haproxy.cfg | grep -i 'acl\|http-request deny'
Remediation
listen stats
    bind 127.0.0.1:8404
    stats enable
    stats uri /stats
    acl allowed_mgmt src 10.0.0.0/8 172.16.0.0/12
    http-request deny unless allowed_mgmt
3.1.2 Ensure Default Backend Returns 403 (Automated)
L1 Auto
Description

This recommendation verifies that Default Backend Returns 403 on the HAProxy 2.8 load balancer. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to default Backend Returns 403 may leave the HAProxy 2.8 load balancer vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep -i 'default_backend' /etc/haproxy/haproxy.cfg
Remediation
backend deny-all
    http-request deny deny_status 403

frontend http-in
    default_backend deny-all

3.2 Rate Limiting

▶
3.2.1 Ensure Connection Rate Limiting Is Configured (Automated)
L1 Auto
Description

This recommendation addresses the proper configuration of Connection Rate Limiting on the HAProxy 2.8 load balancer. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

Misconfiguration of Connection Rate Limiting can lead to security gaps that may be exploited by attackers. A properly configured HAProxy 2.8 load balancer reduces exposure to both known vulnerabilities and configuration drift.

Audit
grep -i 'stick-table\|sc_conn_rate\|sc_http_req_rate' /etc/haproxy/haproxy.cfg
Remediation
frontend http-in
    stick-table type ip size 100k expire 30s store conn_rate(10s),http_req_rate(10s)
    tcp-request connection track-sc0 src
    tcp-request connection reject if { sc_conn_rate(0) gt 100 }
    http-request deny deny_status 429 if { sc_http_req_rate(0) gt 200 }
3.2.2 Ensure Slowloris Protection Is Configured (Automated)
L1 Auto
Description

This recommendation addresses the proper configuration of Slowloris Protection on the HAProxy 2.8 load balancer. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

Misconfiguration of Slowloris Protection can lead to security gaps that may be exploited by attackers. A properly configured HAProxy 2.8 load balancer reduces exposure to both known vulnerabilities and configuration drift.

Audit
grep -i 'timeout http-request' /etc/haproxy/haproxy.cfg
Remediation
defaults
    timeout http-request 10s
    timeout http-keep-alive 10s

4 — Logging & Monitoring

▶

4.1 Logging

▶
4.1.1 Ensure Logging Is Configured (Automated)
L1 Auto
Description

This recommendation addresses the proper configuration of Logging on the HAProxy 2.8 load balancer. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

Misconfiguration of Logging can lead to security gaps that may be exploited by attackers. A properly configured HAProxy 2.8 load balancer reduces exposure to both known vulnerabilities and configuration drift.

Audit
grep -i 'log' /etc/haproxy/haproxy.cfg | head -10
Remediation
global
    log /dev/log local0
    log /dev/log local1 notice

defaults
    log global
    option httplog
4.1.2 Ensure Custom Log Format Includes Client IP and Headers (Automated)
L1 Auto
Description

This recommendation verifies that Custom Log Format Includes Client IP and Headers on the HAProxy 2.8 load balancer. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to custom Log Format Includes Client IP and Headers may leave the HAProxy 2.8 load balancer vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep -i 'log-format' /etc/haproxy/haproxy.cfg
Remediation
defaults
    log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r"

4.2 Statistics & Monitoring

▶
4.2.1 Ensure Stats Page Is Protected with Authentication (Automated)
L1 Auto
Description

This recommendation verifies that Stats Page Is Protected with Authentication on the HAProxy 2.8 load balancer. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to stats Page Is Protected with Authentication may leave the HAProxy 2.8 load balancer vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep -A10 'stats enable' /etc/haproxy/haproxy.cfg | grep 'stats auth'
Remediation
listen stats
    stats enable
    stats hide-version
    stats realm HAProxy\ Statistics
    stats auth admin:StrongP@ssw0rd!
    stats refresh 30s
4.2.2 Ensure Stats Admin Mode Is Disabled in Production (Automated)
L1 Auto
Description

This recommendation verifies that Stats Admin Mode Is Disabled in Production on the HAProxy 2.8 load balancer. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to stats Admin Mode Is Disabled in Production may leave the HAProxy 2.8 load balancer vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep -i 'stats admin' /etc/haproxy/haproxy.cfg
# Should not be present or should be restricted
Remediation
# Remove or restrict stats admin:
# stats admin if LOCALHOST  ← only from localhost

5 — Security Headers

▶

5.1 Response Headers

▶
5.1.1 Ensure X-Frame-Options Is Set (Automated)
L1 Auto
Description

This recommendation verifies that X-Frame-Options Is Set on the HAProxy 2.8 load balancer. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to x-Frame-Options Is Set may leave the HAProxy 2.8 load balancer vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep -i 'X-Frame-Options' /etc/haproxy/haproxy.cfg
Remediation
frontend https-in
    http-response set-header X-Frame-Options "SAMEORIGIN"
5.1.2 Ensure X-Content-Type-Options Is Set (Automated)
L1 Auto
Description

This recommendation verifies that X-Content-Type-Options Is Set on the HAProxy 2.8 load balancer. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to x-Content-Type-Options Is Set may leave the HAProxy 2.8 load balancer vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep -i 'X-Content-Type-Options' /etc/haproxy/haproxy.cfg
Remediation
frontend https-in
    http-response set-header X-Content-Type-Options "nosniff"
5.1.3 Ensure Server Header Is Hidden (Automated)
L1 Auto
Description

This recommendation verifies that Server Header Is Hidden on the HAProxy 2.8 load balancer. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to server Header Is Hidden may leave the HAProxy 2.8 load balancer vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
curl -sI https://example.com | grep -i server
Remediation
frontend https-in
    http-response del-header Server
    http-response del-header X-Powered-By

5.2 Request Filtering

▶
5.2.1 Ensure Suspicious HTTP Methods Are Blocked (Automated)
L1 Auto
Description

This recommendation verifies that Suspicious HTTP Methods Are Blocked on the HAProxy 2.8 load balancer. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to suspicious HTTP Methods Are Blocked may leave the HAProxy 2.8 load balancer vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep -i 'method' /etc/haproxy/haproxy.cfg | grep -i 'acl\|deny'
Remediation
frontend http-in
    acl valid_method method GET HEAD POST PUT DELETE PATCH OPTIONS
    http-request deny unless valid_method
5.2.2 Ensure Large Request Headers Are Rejected (Automated)
L1 Auto
Description

This recommendation verifies that Large Request Headers Are Rejected on the HAProxy 2.8 load balancer. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to large Request Headers Are Rejected may leave the HAProxy 2.8 load balancer vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep -i 'tune.maxrewrite\|tune.bufsize' /etc/haproxy/haproxy.cfg
Remediation
global
    tune.bufsize 16384
    tune.maxrewrite 1024

6 — Health Checks & Resilience

▶

6.1 Health Checks

▶
6.1.1 Ensure Backend Health Checks Are Configured (Automated)
L1 Auto
Description

This recommendation addresses the proper configuration of Backend Health Checks on the HAProxy 2.8 load balancer. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

Misconfiguration of Backend Health Checks can lead to security gaps that may be exploited by attackers. A properly configured HAProxy 2.8 load balancer reduces exposure to both known vulnerabilities and configuration drift.

Audit
grep -i 'option httpchk\|check' /etc/haproxy/haproxy.cfg
Remediation
backend app_servers
    option httpchk GET /health
    http-check expect status 200
    server app1 10.0.1.10:8080 check inter 5s fall 3 rise 2
    server app2 10.0.1.11:8080 check inter 5s fall 3 rise 2

6.2 Timeouts & Limits

▶
6.2.1 Ensure All Timeouts Are Explicitly Set (Automated)
L1 Auto
Description

This recommendation configures the timeout for All on the HAProxy 2.8 load balancer. Appropriate timeout values limit the window of opportunity for attacks and ensure resources are released in a timely manner.

Rationale

Failure to all Timeouts Are Explicitly Set may leave the HAProxy 2.8 load balancer vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep -E 'timeout (connect|client|server|http-request|http-keep-alive|queue)' /etc/haproxy/haproxy.cfg
Remediation
defaults
    timeout connect 5s
    timeout client  30s
    timeout server  30s
    timeout http-request 10s
    timeout http-keep-alive 10s
    timeout queue 30s
    timeout tunnel 3600s
6.2.2 Ensure Connection Retries Are Limited (Automated)
L1 Auto
Description

This setting ensures that Connection Retries is limited on the HAProxy 2.8 load balancer. Restricting this capability limits potential abuse and enforces the principle of least privilege across the environment.

Rationale

Unrestricted Connection Retries could allow unauthorized users or processes to perform actions beyond their intended scope. Applying least-privilege principles to the HAProxy 2.8 load balancer is essential for defense in depth.

Audit
grep -i 'retries' /etc/haproxy/haproxy.cfg
Remediation
defaults
    retries 3
    option redispatch