Skip to content

Tuning cPHulk thresholds without locking out legitimate users

Concrete cPHulk threshold values that match a real cPanel workload, plus what each setting actually does to the brute-force window and the lockout duration.

cPHulk’s defaults are reasonable but conservative — they generate enough lockouts on a busy host to keep support busy and not enough on a quiet one to catch the slow brute force. The values that matter are the per-IP and per-account thresholds, the time windows, and the country-block list. Here’s how we tune them.

What’s happening

cPHulk has two protection layers: Brute Force Protection (per account) and IP Based Brute Force Protection (per source IP). Each has a “current period” (default 5 minutes) and a “history period” (default 24 hours), with separate failed-attempt counts for each. The 24-hour layer is what catches slow brute force; the 5-minute layer catches the loud kind. Both have to be on for the protection to be complete.

How to verify

cphulk_status
whmapi1 cphulk_status_check
cat /var/cpanel/hulkd/conf
whmapi1 list_cphulk_records
whmapi1 cphulk_get_brutes

cphulk_get_brutes and list_cphulk_records give you the actual lockout history, which is the data you need to tune.

The fix

  1. Per-IP, current period: ip_brute_force_period_mins = 5, ip_max_failures_per_period = 6. Six attempts in five minutes from one IP is enough to trigger.
  2. Per-IP, history: ip_brute_force_period_mins = 1440 (24h), max_failures_byip = 30. Catches the slow drip attack.
  3. Per-account, current period: brute_force_period_mins = 5, max_failures_per_period = 8. Account locks more aggressively than IP because legitimate users do not fail 8 times in 5 minutes.
  4. Lockout duration: mark_as_brute = 1 plus command_to_run_on_brute_force = "" (do not auto-add to firewall — let CSF own that). Default lockout of 1 day is appropriate for the 24h tier.
  5. Country block: WHM > cPHulk > Countries is opinionated. Block countries where you legitimately have no users, but whitelist any country you have customers in. Adding ungrounded country blocks generates customer-service tickets.
  6. Whitelist office and management IPs in WHM > cPHulk > Allowlist Management. cPHulk’s allowlist is independent of CSF’s.
  7. Review weekly for the first month, then monthly. If cphulk_get_brutes returns mostly the same IPs each week, your block is working but they are persistent — consider moving them to CSF’s permanent deny list.

Stack Harbor tunes cPHulk on takeover and reviews monthly under cPanel server management.