Child pages
  • WHM API 1 Functions - load_cphulk_config
Skip to end of metadata
Go to start of metadata

Description

This function returns cPHulk's current settings.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/load_cphulk_config?api.version=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/load_cphulk_config?api.version=1
 Command Line
whmapi1 load_cphulk_config 


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command. 

 Output (JSON)
{
  "data": {
    "cphulk_config": {
      "is_enabled": 1,
      "ip_brute_force_period_mins": 15,
      "max_failures": 15,
      "brute_force_period_sec": 300,
      "lookback_period_min": 360,
      "mark_as_brute": 30,
      "ip_brute_force_period_sec": 900,
      "lookback_time": 21600,
      "brute_force_period_mins": 5,
      "notify_on_brute": "0",
      "notify_on_root_login": 0,
      "max_failures_byip": 5
    }
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "load_cphulk_config"
  }
}
 Output (XML)
<result>
    <data>
        <cphulk_config>
            <is_enabled>1</is_enabled>
            <ip_brute_force_period_mins>15</ip_brute_force_period_mins>
            <max_failures>15</max_failures>
            <brute_force_period_sec>300</brute_force_period_sec>
            <lookback_period_min>360</lookback_period_min>
            <mark_as_brute>30</mark_as_brute>
            <ip_brute_force_period_sec>900</ip_brute_force_period_sec>
            <lookback_time>21600</lookback_time>
            <brute_force_period_mins>5</brute_force_period_mins>
            <notify_on_brute>0</notify_on_brute>
            <notify_on_root_login>0</notify_on_root_login>
            <max_failures_byip>5</max_failures_byip>
        </cphulk_config>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>load_cphulk_config</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
is_enabledBooleanWhether the cPHulk service is enabled.
  • 1 — cPHulk is enabled.
  • 0 — cPhulk is disabled.
1
ip_brute_force_period_minsintegerThe number of minutes during which cPHulk measures an attacker's login attempts.A valid integer, measured in minutes.15
ip_brute_force_period_secintegerThe number of seconds during which cPHulk measures an attacker's login attempts.A valid integer, measured in seconds.300
brute_force_period_minsintegerThe number of minutes during which cPHulk measures all login attempts to a specific user's account.A valid integer, measured in minutes.5
brute_force_period_secintegerThe number of seconds over which cPHulk measures all login attempts to a specific user's account.A valid integer, measured in seconds.360
max_failuresintegerThe maximum number of failures that cPHulk will allow per account within the defined time range.A valid integer.30
max_failures_byipintegerThe maximum number of failures that cPHulk will allow per account from a specific IP address within the defined time range.A valid integer.5
mark_as_bruteintegerThe maximum number of failures that cPHulk will allow per account from a specific IP address before the system locks out that address for two weeks.A valid integer.30
lookback_period_minintegerThe number of minutes during which cPHulk counts failed logins against a user.A valid integer.360
lookback_timeintegerThe number of seconds during which cPHulk counts failed logins against a user.A valid integer.21600
notify_on_bruteBooleanWhether cPHulk will send a notification when it detects a brute force attack.
  • 1 — Send the notification.
  • 0 — Do not send the notification.
1
notify_on_root_loginBooleanWhether 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.
1