[MokoCBRegGuard] [FEATURE] GeoIP country filtering #22

Open
opened 2026-06-02 19:31:35 +00:00 by jmiller · 1 comment
Owner

Migrated from MokoCBRegGuard#18

Feature Description

Integrate GeoIP lookup to allow country-level filtering of registrations.

Problem or Use Case

Some communities serve specific geographic regions. The existing rDNS hosting-provider check identifies VPNs/proxies but cannot determine the registrant's country. Sites receiving spam waves from specific countries have no way to flag or block by geography.

Proposed Solution

Integrate a lightweight GeoIP service:

  • Option A: MaxMind GeoLite2 local database (no external API call, requires periodic DB update)
  • Option B: ip-api.com free tier (external call, 45 req/min limit)

Add plugin parameters:

  • enable_geoip_check — toggle
  • allowed_countries — comma-separated ISO country codes (if set, only these pass)
  • blocked_countries — comma-separated ISO country codes to flag
  • geoip_provider — select between available providers

Generate GEO_BLOCKED flag (weight: 2) when country matches blocked list or is outside allowed list.

Alternative Solutions

  • Server-level GeoIP blocking (too broad — blocks all traffic, not just registrations)
  • Manual IP research by moderators (does not scale)

Benefits

  • Who: Region-specific communities, sites experiencing geographic spam waves
  • Problem solved: Automated geographic risk assessment without blocking all traffic from a country
  • Value: Targeted registration filtering that complements existing checks

Implementation Details (Optional)

  • New params in cbregguard.xml
  • New RegGuardHelper::checkGeoIP() static method
  • Graceful fallback if GeoIP lookup fails (no registration disruption)
  • Consider caching results to minimize API calls

Relevant Standards

  • Security best practices
  • Code quality standards

Checklist

  • I have searched for similar feature requests before creating this one
  • I have clearly described the use case and benefits
  • I have considered alternative solutions
  • This feature aligns with the project's goals and scope
> Migrated from MokoCBRegGuard#18 ## Feature Description Integrate GeoIP lookup to allow country-level filtering of registrations. ## Problem or Use Case Some communities serve specific geographic regions. The existing rDNS hosting-provider check identifies VPNs/proxies but cannot determine the registrant's country. Sites receiving spam waves from specific countries have no way to flag or block by geography. ## Proposed Solution Integrate a lightweight GeoIP service: - Option A: MaxMind GeoLite2 local database (no external API call, requires periodic DB update) - Option B: ip-api.com free tier (external call, 45 req/min limit) Add plugin parameters: - `enable_geoip_check` — toggle - `allowed_countries` — comma-separated ISO country codes (if set, only these pass) - `blocked_countries` — comma-separated ISO country codes to flag - `geoip_provider` — select between available providers Generate `GEO_BLOCKED` flag (weight: 2) when country matches blocked list or is outside allowed list. ## Alternative Solutions - Server-level GeoIP blocking (too broad — blocks all traffic, not just registrations) - Manual IP research by moderators (does not scale) ## Benefits - **Who:** Region-specific communities, sites experiencing geographic spam waves - **Problem solved:** Automated geographic risk assessment without blocking all traffic from a country - **Value:** Targeted registration filtering that complements existing checks ## Implementation Details (Optional) - New params in `cbregguard.xml` - New `RegGuardHelper::checkGeoIP()` static method - Graceful fallback if GeoIP lookup fails (no registration disruption) - Consider caching results to minimize API calls ## Relevant Standards - [x] Security best practices - [x] Code quality standards ## Checklist - [x] I have searched for similar feature requests before creating this one - [x] I have clearly described the use case and benefits - [x] I have considered alternative solutions - [x] This feature aligns with the project's goals and scope
jmiller added the enhancementregguard labels 2026-06-02 19:52:06 +00:00
Author
Owner

Built: RegGuardHelper.checkGeoIP() — ip-api.com lookup, allow/block country lists.

Built: RegGuardHelper.checkGeoIP() — ip-api.com lookup, allow/block country lists.
jmiller added the pending: testing label 2026-06-02 20:44:31 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoJoomCommunity#22