Skip to content

Warn when the configured GeoIP database (.mmdb) is out of date #237

Open

Description

@codeling

Problem

The GeoIP features (risk score by country, "Information for IP Address") read a MaxMind .mmdb file that the administrator downloads and configures. Nothing tells them when it gets old. MaxMind publishes new GeoLite2 versions twice a week (Tuesdays and Fridays); addresses are reassigned all the time, so an old file gets less and less accurate. It only feeds the risk score and the address information (not a security boundary), so this is a quality and compliance problem rather than a vulnerability - but a silently stale file makes the country signal wrong without anyone noticing, and the licence terms of the database used may require keeping it current (to be checked against the current GeoLite2 EULA; I could not confirm a specific number of days from MaxMind's own text).

(The reader code that parses the file is a different matter: it is tracked in composer.lock and checked by CI, see #236.)

Idea

The age is in the file: build_epoch of the MaxMind DB metadata (Reader::metadata()->buildEpoch, available in the bundled reader).

  • GeoHelper::getDatabaseInfo($path): type, build date, age in days (null if unreadable). Cheap: only the metadata is read.
  • Component
    • Settings, next to "GeoIP database path": "Database built: 2026-09-01 (36 days ago)", with a hint on how to update (geoipupdate).
    • Admin pages: a warning message when the file is older than 30 days and an error when older than 90 days, or when a path is configured but unreadable.
  • Plugin
    • Daily maintenance: log a WARNING once a day while the file is older than the limit; optionally mail the notification addresses once a week ("reminder").
    • Setting "Ignore the country signal when the database is older than N days" (default: off, so nothing changes silently).
  • No automatic download: that needs the administrator's MaxMind licence key. Document geoipupdate + cron in the README instead (already done in Security review fixes (plugin): GeoIP reader tracking, .htaccess, data bounds, token hashing #236).

Tests

tests/Support/MmdbBuilder.php (added in #236) can write test databases; add a build_epoch parameter to produce old and new files.

Open questions

  • Thresholds (30/90 days proposed).
  • Mail reminder: worth the extra setting, or are the admin page warning and the log entry enough?

🤖 Generated with Claude Code

https://claude.ai/code/session_01LhhhdjhErC9ZiaS4HyRjsh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions