WPF2B_EVENT_BLOCK_COUNTRY

Attempted access from a blocked country.

Premium only

Premium listener: WPF2B_EVENT_BLOCK_COUNTRY.

Premium emits this event when a request’s resolved country appears in WP_FAIL2BAN_EX_BLOCK_COUNTRIES. The request is denied with HTTP 403.

Countries assigned to the HTTP 451 list use WPF2B_EVENT_BLOCK_COUNTRY_451. A fail-closed denial when the country cannot be resolved uses WPF2B_EVENT_BLOCK_COUNTRY_UNKNOWN.

syslog

Facility

WP_FAIL2BAN_EX_BLOCK_COUNTRIES_LOG

Level

NOTICE

Example

Blocked access 403 from country 'FR' on fqdn.example.com from 192.0.42.1

fail2ban

Filter

wordpress-hard.conf

Rule

Blocked access <F-HTTP_STATUS>\d\d\d</F-HTTP_STATUS> from country '<F-ISO_CODE>..</F-ISO_CODE>'<_tail>

EventData

country

ISO 3166-1 alpha-2 code [1]

History

Changed in version 6.0.0: Added F-ISO_CODE tag.

Added in version 4.3.0.

Footnotes