latestOpenAPI 3.0.2cPanel License2026-08-106251554.3 MB

3da41671c02c

cPHulk
Settings

Save login security configuration settings

This function modifies cPHulk's configuration settings.

get/save_cphulk_config

Query parameters

block_brute_force_with_firewall0 | 1

Whether to use the server firewall to block brute force attacks.

  • 1 — Use the firewall.
  • 0 — Do not use the firewall.
block_excessive_brute_force_with_firewall0 | 1

Whether to use the server firewall to block excessive brute force attacks.

  • 1 — Use the firewall.
  • 0 — Do not use the firewall.
brute_force_period_minsinteger
Example:5

The number of minutes over which cPHulk measures all login attempts to a specific user's account.

command_to_run_on_brute_forcestring

The command to run when an IP address triggers brute force protection.

Note:

For a list of commands, read the Command variables section of our cPHulk Brute Force Protection documentation.

command_to_run_on_excessive_brute_forcestring

The command to run when the system blocks an IP address for a one day period.

Note:

For a list of commands, read the Command variables section of our cPHulk Brute Force Protection documentation.

ip_based_protection0 | 1
Example:1

Whether to enable IP address-based protection on all requests.

  • 1 — Enable IP-based protection.
  • 0 — Disable IP-based protection.

Note:

If you set this parameter to 0, you cannot use the following parameters:

  • block_brute_force_with_firewall
  • block_excessive_brute_force_with_firewall
  • ip_brute_force_period_mins
ip_brute_force_period_minsinteger
Example:15

The number of minutes in which cPHulk measures an attacker's login attempts.

lookback_period_mininteger
Example:360

The number of minutes over which cPHulk counts failed logins against a user.

mark_as_bruteinteger
Example:30

The maximum number of failures from a specific IP address before cPHulk blocks that address for a two-week period.

max_failuresinteger
Example:30

The maximum number of failures that cPHulk allows per account within the defined time range.

max_failures_byipinteger
Example:5

The maximum number of failures from a specific IP address before cPHulk locks out that address.

notify_on_brute0 | 1

Whether cPHulk will send a notification when it detects a brute force attack.

  • 1 — Send the notification.
  • 0 — Do not send the notification.
notify_on_root_login0 | 1

Whether cPHulk will send a notification when the root user successfully logs in from an IP address that is not on the whitelist.

  • 1 — Send the notification.
  • 0 — Do not send the notification.
notify_on_root_login_for_known_netblock0 | 1

Whether cPHulk sends a notification upon successful root login when the IP address is not on the whitelist, but from a known netblock.

  • 1 — Send the notification.
  • 0 — Do not send the notification.
skip_enabled_check0 | 1

Whether to skip checking if cPHulk runs on the server.

  • 1 — Don't check cPHulk's status.
  • 0 — Check cPHulk's status.

Note:

If cPHulk is disabled, the function returns the following message: cPHulk is disabled on the server.

username_based_protection0 | 1

Whether to enable username-based protection on all requests.

  • 1 — Enable.
  • 0 — Disable.
username_based_protection_for_root0 | 1

Whether to allow username-based protection to lock out the root user.

  • 1 — Allow.
  • 0 — Do not allow.
username_based_protection_local_origin0 | 1
Example:1

Whether to enable username-based protection only on requests that originate from a local IP address.

  • 1 — Enable.
  • 0 — Disable.

Response

HTTP Request was successful.

Example response

{
  "data": {
    "cphulk_config": {
      "brute_force_period_mins": 5,
      "brute_force_period_sec": 300,
      "can_temp_ban_firewall": 1,
      "ip_based_protection": 1,
      "ip_brute_force_period_mins": 15,
      "ip_brute_force_period_sec": 900,
      "is_enabled": 1,
      "lookback_period_min": 360,
      "lookback_time": 21600,
      "mark_as_brute": 30,
      "max_failures": 30,
      "max_failures_byip": 5,
      "username_based_protection_local_origin": 1
    },
    "restart_ssh": 1
  },
  "metadata": {
    "command": "save_cphulk_config",
    "reason": "OK",
    "result": 1,
    "version": 1
  }
}