Software /
code /
prosody-modules
Diff
mod_firewall/README.markdown @ 5727:ad5c77793750
mod_firewall: Add FROM COUNTRY condition based on GeoIP DB
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 12 Nov 2023 16:37:47 +0100 |
parent | 5726:0ac4545cb4f9 |
child | 5862:1ae8f7b3787a |
line wrap: on
line diff
--- a/mod_firewall/README.markdown Sun Nov 12 16:14:09 2023 +0100 +++ b/mod_firewall/README.markdown Sun Nov 12 16:37:47 2023 +0100 @@ -301,6 +301,31 @@ stanza. It is not advisable to perform access control or similar rules on JIDs in these chains (see the [chain documentation](#chains) for more info). +#### GeoIP matching + + Condition Matches + ---------------- -------------------------------------------------------------- + `FROM COUNTRY` Two or three letter country code looked up in GeoIP database + +This condition uses a GeoIP database to look up the origin country of +the IP attached to the current session. + +For example: + + # 3 letter country code + FROM COUNTRY: SWE + + # or 2 letter + FROM COUNTRY: SE + + # Explicit + FROM COUNTRY: code=SE + FROM COUNTRY: code3=SWE + +**Note:** This requires that the `lua-geoip` and `geoip-database` +packages are installed (on Debian, package names may differ on other +operating systems). + #### INSPECT INSPECT takes a 'path' through the stanza to get a string (an attribute