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

# Save login security configuration settings

`GET /save_cphulk_config`

This function modifies cPHulk's configuration settings.

## Query parameters

- `block_brute_force_with_firewall` 0 | 1
- `block_excessive_brute_force_with_firewall` 0 | 1
- `brute_force_period_mins` integer
- `command_to_run_on_brute_force` string
- `command_to_run_on_excessive_brute_force` string
- `ip_based_protection` 0 | 1
- `ip_brute_force_period_mins` integer
- `lookback_period_min` integer
- `mark_as_brute` integer
- `max_failures` integer
- `max_failures_byip` integer
- `notify_on_brute` 0 | 1
- `notify_on_root_login` 0 | 1
- `notify_on_root_login_for_known_netblock` 0 | 1
- `skip_enabled_check` 0 | 1
- `username_based_protection` 0 | 1
- `username_based_protection_for_root` 0 | 1
- `username_based_protection_local_origin` 0 | 1

## Response `200`

HTTP Request was successful.

- object
  - `data` object
    - `cphulk_config` object — An object containing 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.
      - `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.
      - `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.
    - `restart_ssh` 0 | 1 — Whether the system disabled UseDNS in the `sshd.conf` file and restarted the `sshd` daemon to allow cPHulk to add IP addresses to the whitelist. **Note:** This return **only** appears if the `UseDNS` setting is `yes` in the `/etc/ssh/sshd_config` file. Because UseDNS and cPHulk are incompatible, the system sets the `UseDNS` setting to `no` when you enable cPHulk. * `1` - Disabled UseDNS in the `sshd` daemon and restarted the `sshd` service. * `0` - Did **not** alter the `sshd.conf` file or restart the `sshd` service.
    - `warning` string, nullable — A warning message about the restart. **Note:** The function **only** returns this value if the `restart_ssh` return's value is `1`.
  - `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)
