This function modifies a single cPHulk configuration settings as specified.
key required | string The configuration key for the setting to set/modify. It should be one of the following:
Example: key=is_enabled |
required | string or integer The new value for the specified key. The allowable value depends on which key is being set. For the following keys, the value must be 0 or 1:
For the following keys, the value must be an integer which specifies a number of minutes or seconds:
These keys require the value to be a string containing a command to be run: (For a list of commands, read the Command Variables section of our cPHulk Brute Force Protection documentation.)
These keys require the value to be a string containing a comma-separated list of country codes:
(For a list of countries, run the WHM API 1
The following keys require an integer representing a maximum number of failures
Example: value=1 |
HTTP Request was successful.
object | |
object |
whmapi1 --output=jsonpretty \ set_cphulk_config_key key=is_enabled value=1
{- "data": {
- "cphulk_config": {
- "block_brute_force_with_firewall": 0,
- "block_excessive_brute_force_with_firewall": 0,
- "brute_force_period_mins": 5,
- "brute_force_period_sec": 300,
- "can_temp_ban_firewall": 1,
- "command_to_run_on_brute_force": "",
- "command_to_run_on_excessive_brute_force": "",
- "country_blacklist": "PK,BR",
- "country_whitelist": "US,AU",
- "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,
- "notify_on_brute": 0,
- "notify_on_root_login": 0,
- "notify_on_root_login_for_known_netblock": 0,
- "username_based_protection": 0,
- "username_based_protection_for_root": 0,
- "username_based_protection_local_origin": 1
}
}, - "metadata": {
- "command": "set_cphulk_config_key",
- "reason": "OK",
- "result": 1,
- "version": 1
}
}