---
title: "Update login security configuration settings"
method: GET
path: "/set_cphulk_config_key"
tags: ["cPHulk", "Settings"]
---

# Update login security configuration settings

`GET /set_cphulk_config_key`

This function modifies a single cPHulk configuration settings as specified.

## Query parameters

- `key` 'block_brute_force_with_firewall' | 'block_excessive_brute_force_with_firewall' | 'brute_force_period_mins' | 'brute_force_period_sec' | 'command_to_run_on_brute_force' | 'command_to_run_on_excessive_brute_force' | 'country_blacklist' | 'country_whitelist' | 'ip_based_protection' | 'ip_brute_force_period_mins' | 'ip_brute_force_period_sec' | 'is_enabled' | 'lookback_period_min' | 'lookback_time' | 'mark_as_brute' | 'max_failures' | 'max_failures_byip' | 'notify_on_brute' | 'notify_on_root_login' | 'notify_on_root_login_for_known_netblock' | 'username_based_protection' | 'username_based_protection_for_root' | 'username_based_protection_local_origin', required
- `value` union, required
  - string
  - integer

## Response `200`

HTTP Request was successful.

- object
  - `data` object
    - `cphulk_config` object — cPHulk configuration settings.
      - `block_brute_force_with_firewall` 0 | 1 — Whether to use cPanel & WHM's firewall to block brute force attacks. * `1` - Use the firewall. * `0` - Do **not** use the firewall.
      - `block_excessive_brute_force_with_firewall` 0 | 1 — Whether to use cPanel & WHM's firewall to block excessive brute force attacks. * `1` - Use the firewall. * `0` - Do **not** use the firewall.
      - `brute_force_period_mins` integer — The number of minutes over which cPHulk measures all login attempts to a specific user's account.
      - `brute_force_period_sec` integer — The number of seconds over which cPHulk measures all login attempts to a specific user's account.
      - `can_temp_ban_firewall` 0 | 1 — Whether the system firewall can apply temporary IP address bans. * `1` - Can temporarily apply IP address bans. * `0` - Cannot temporarily apply IP address bans. **Note:** If this return's value is 0, then the `ip_based_protection parameter` is **not** available, which means that 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_sec`
      - `command_to_run_on_brute_force` string — The command to run when an IP address triggers brute force protection. - A valid command. - An empty string.
      - `command_to_run_on_excessive_brute_force` string — The command to run when the system blocks an IP address blocked for a one day period. * A valid command. * An empty string.
      - `country_blacklist` string, ISO-3166-1 (alpha-2) — The countries to blacklist. A comma-separated list of valid ISO 3166-1 alpha-2 country codes. This value may be empty.
      - `country_whitelist` string, ISO-3166-1 (alpha-2) — The countries to whitelist. A comma-separated list of valid ISO 3166-1 alpha-2 country codes. This value may be empty.
      - `ip_based_protection` 0 | 1 — Whether IP address-based protection on all requests is enabled. * `1` - Enabled. * `0` - Disabled.
      - `ip_brute_force_period_mins` integer — The number of minutes in which cPHulk measures an attacker's login attempts.
      - `ip_brute_force_period_sec` integer — The number of seconds in which cPHulk measures an attacker's login attempts.
      - `is_enabled` 0 | 1 — Whether the cPHulk service is enabled. * `1` - Enabled. * `0` - Disabled.
      - `lookback_period_min` integer — The number of minutes over which cPHulk counts failed logins against a user.
      - `lookback_time` integer — The number of seconds over which cPHulk counts failed logins against a user.
      - `mark_as_brute` integer — The maximum number of failures from a specific IP address before cPHulk blocks that address for a two-week period.
      - `max_failures` integer — The maximum number of failures that cPHulk allows per account within the defined time range.
      - `max_failures_byip` integer — The maximum number of failures from a specific IP address before cPHulk locks out that address.
      - `notify_on_brute` 0 | 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_login` 0 | 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_netblock` 0 | 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.
      - `username_based_protection` 0 | 1 — Whether username-based protection on all requests is enabled. * `1` - Enabled. * `0` - Disabled.
      - `username_based_protection_for_root` 0 | 1 — Whether username-based protection can lock out the root user. * `1` - Allowed. * `0` - Not allowed.
      - `username_based_protection_local_origin` 0 | 1 — Whether username-based protection only on requests that originate from a local IP address. * `1` - Enabled. * `0` - Disabled.
  - `metadata` object
    - `command` string — The method name called.
    - `reason` string — The reason the API function failed when the `metadata.result` field is 0. This field may display a success message when a function succeeds.
    - `result` 0 | 1 — * `1` - Success * `0` - Failed: Check the reason field for more details.
    - `version` integer — The version of the API function.

---

[API](https://skmtc.net/cpanel/apis/whm-api.md) · [All operations](https://skmtc.net/cpanel/apis/whm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cpanel/whm-api/revisions/3da41671c02c/schema)
