Configuring Fail2Ban Settings

Use the set-settings operation to change the Fail2Ban settings.

In this chapter:

Request Packet Structure

Samples

 

Request Packet Structure

A request XML packet changing the Fail2Ban settings includes the set-settings operation node:

<packet>
<ip-ban>
  <set-settings>
  ...
  </set-settings>
</ip-ban>
</packet>

 

A graphical representation of the set-settings node is as follows:

Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_input.svg.

  • ban-period, optional

    Specifies the time interval in seconds during which an IP address is banned. When this period is over, the IP address is automatically unbanned.

  • ban-time-window, optional

    Specifies the time interval in seconds during which the system counts the number of unsuccessful login attempts and other unwanted actions from an IP address.

  • max-retries, optional.

    Specifies the number of failed login attempts from an IP address. When this number is exceeded, the IP address is banned.

 

Samples

This request sets the ban period, the ban time window and the number of retries:

<packet>
  <ip-ban>
    <set-settings>
      <ban-period>600</ban-period>
      <ban-time-window>600</ban-time-window>
      <max-retries>5</max-retries>
    </set-settings>
  </ip-ban>
</packet>

A response packet can look as follows:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
  <ip-ban>
    <set-settings>
      <result>
        <status>ok</status>
      </result>
    </set-settings>
  </ip-ban>
</packet>
 

Leave your feedback on this topic here

If you have questions or need support, please visit the Plesk forum or contact your hosting provider.
The comments below are for feedback on the documentation only. No timely answers or help will be provided.