Skip to content

Fail2Ban Jails

The Jails page allows administrators to manage Fail2Ban jail configurations that define which services are protected and how bans are applied.

Fail2Ban Jails

Overview

URL: /admin/fail2ban-jails

This page is divided into two sections: a custom jails table at the top and a Local Jails list below.

Custom Jails

The top section displays a searchable and paginated table of custom (user-created) jails.

Columns

  • Name - The jail name (e.g., apache-bad-traffic, postfix, sshd). Sortable.
  • Port - The port(s) monitored by the jail (e.g., http, https, ssh). Sortable.
  • Filter - The Fail2Ban filter used to detect violations. Sortable.
  • Action - The action taken when a ban is triggered. Sortable.
  • Log Path - The log file path monitored by the jail (e.g., /var/log/httpd/access_log, /var/log/maillog). Sortable.
  • Enabled - Toggle to enable or disable the jail. Sortable.

Actions

  • Edit - Modify the jail configuration.

Table Features

  • Search - Filter results by name.

Pagination

Results per page can be set to: 5, 10, 25, 50, or All.

Creating a Jail

Click the New Fail2BanJail button to open a dedicated create page (/admin/fail2ban-jails/create) with the following fields:

General

  • Jail Name (required) - A unique name for the jail.
  • Enabled (toggle) - Whether the jail is active. Default: enabled.

Detection

  • Port (required) - The port(s) to monitor (e.g., http, https, ssh).
  • Use custom filter (checkbox) - When checked, reveals a text field for entering a custom filter definition instead of selecting from existing filters.
  • Filter (dropdown) - Select an existing Fail2Ban filter. Shown when "Use custom filter" is unchecked.
  • Log Path (required) - The log file path to monitor (e.g., /var/log/auth.log).

Thresholds

  • Max Retry (optional) - Number of failures before a ban is triggered.
  • Find Time (optional) - Time window (in seconds) in which failures are counted.
  • Ban Time (optional) - Duration (in seconds) of the ban.
  • Use custom action (checkbox) - When checked, reveals a text field for entering a custom action instead of selecting from existing actions.
  • Action (dropdown) - Select an existing Fail2Ban action. Shown when "Use custom action" is unchecked.

Form Actions

  • Create - Save the jail.
  • Create & create another - Save and reset the form for a new jail.
  • Cancel - Close the modal without saving.

Local Jails

The bottom section displays a read-only list of jails installed locally on the server.

Columns

  • Name - The local jail name.

A separate search bar filters the local jails list by name.