Skip to content

GeoIP

OkYouIn can tell which country a sign-in comes from and use it in the Country condition of global and application rules. It can also hold the phone that approves a push to the same countries, and record the country of every sign-in in the logs.

Lookups are offline: OkYouIn keeps a GeoIP database file (.mmdb) of its own and looks addresses up locally. No sign-in ever causes a request to an outside service, and nothing about your users is sent anywhere. The only outbound traffic is the database download itself — and you can switch that off and upload files by hand.

Open Settings ▸ Integrations ▸ GeoIP.

The Source card has one choice, Where the database comes from:

ChoiceWhat it means
DB-IP Lite (free)The default. No account needed; country and network (ASN) databases, a new version every month.
MaxMindYour MaxMind account — GeoLite2 (free) or paid GeoIP2. Enter the Account ID and Licence key. The checksum MaxMind publishes is verified on every download.
IPinfoYour IPinfo Lite Access token: country and ASN in one file.
Own files onlyFor servers without internet access: nothing is downloaded, you upload .mmdb files by hand.
OffGeoIP is switched off entirely. See Switching GeoIP off.

DB-IP Lite is on by default on a new installation, so countries start appearing in the logs right away. Because no rule uses a Country condition until you write one, this changes no decision.

The technical fields of each source (the DB-IP download URL for an internal mirror, MaxMind edition names, the IPinfo URL) are under Show more. Downloads honour the server’s outbound proxy configuration.

For the three download sources, Update automatically fetches a new version once a day (at 04:40 by default — the time is changed on Settings ▸ System ▸ Workers). If the installed file is already current, nothing is downloaded. Update now runs the update at once; the card shows the run’s progress, the last result, the next run and the installed country and ASN versions. Last update opens the update history — the last 20 runs, each expandable to the steps it took and why it stopped.

Switching Update automatically off is the same as Own files only.

Whether downloaded or uploaded, a database is only installed after it passes these checks:

  • downloaded over HTTPS only; the provider’s checksum is verified where the provider publishes one (MaxMind, IPinfo);
  • it opens as a valid .mmdb of the expected type;
  • known test addresses resolve to the expected country and network;
  • it is not less than half the size of the file it replaces. A download that shrinks that much is kept aside as a Refused download — the file in use keeps working — until you choose Install anyway or Discard.

The previous version of every file is kept: Roll back puts it back in one click.

  1. Choose Own files only.

  2. On a machine with internet access, download a country database from your provider (DB-IP, MaxMind GeoLite2 / GeoIP2 Country or City, or IPinfo Lite), and optionally an ASN database.

  3. On the Database files tab click Upload and choose the .mmdb or .mmdb.gz file (up to 200 MB). It is checked exactly like a download.

  4. Repeat every month or so. A warning alert appears when the country file in use is older than 60 days.

An uploaded file wins for its kind (country, or network) until you delete it: automatic downloads, from any source, never replace an upload. This also lets a customer with a paid file keep using it while the free download stays as a fallback. The Database files tab shows, per kind, which file answers now and why — uploaded, selected source, or fallback (the selected source has no file for it).

The Check IP card looks up one address: its country, network, and which file answered. Useful when a user reports being refused — paste the address from the log.

The free databases are licensed under terms that require attribution where their results are shown. OkYouIn shows the required line at the bottom of the Database files card, and on the event details in the logs next to a country, for the database that answered at the time of that sign-in.

  1. Create one or more country lists under Infrastructure ▸ Objects ▸ Countries.

  2. In a global or application rule, switch off Any country on the Country card and add the lists.

  3. Test with the policy tester: enter a client IP and the result shows the address’s country, network and which database answered, and for each rule whether the Country condition passed.

The country is looked up from the same end-user address the Source condition uses. If an application does not send that address, its country is always Unknown.

Private and reserved addresses are Local network; an address that cannot be located — no database, not in the database, or no address at all — is Unknown. Neither is ever matched by a list that does not contain it. See Country lists for what this means for Allow and Deny rules.

The logs store the country and network of each sign-in as seen at that moment, together with the database version that answered. Later database updates never rewrite old entries. The Access log can be filtered by country, and the dashboard has a Sign-ins by country widget.

A Country rule checks the address of the device the user signs in from. With a push, someone else’s phone could approve — or a stolen password could be used in an allowed country while the attacker’s own phone sits elsewhere. So OkYouIn also checks the device that approves:

  • When a sign-in is allowed by a rule with a Country condition and MFA is asked, the countries of that rule (the global Allow rule, and the application rule, if it has one too) are remembered with the push.
  • An Approve from the OkYouIn web app push or from an e-mail link is checked against them. If the approving device’s address is outside them, the approval is turned into a denial.
  • The user only sees “This approval could not be verified. Contact your administrator.” The reason and both addresses with their countries are in the log entry.

Editing the rule or its lists while a push is waiting changes nothing for that push: the check uses the lists as they were when the sign-in was decided.

A phone can show an allowed country by sending its browser traffic through a proxy in that country. The UDP check catches the common form of this trick: while the user reads the approval request, the web app sends a few UDP packets straight to OkYouIn, and OkYouIn compares the country of the packets’ address with the country of the page’s HTTP address.

It is configured in the Web Push provider settings (Settings ▸ System ▸ MFA Settings, Web Push), with four modes — Off (default), Record only, Deny on mismatch (soft) and Strict deny — and needs UDP port 3478 reachable from the internet. See OkYouIn web app push for the modes, what it does and does not catch, and how to test it.

Choosing Off turns GeoIP off entirely: every address is Local network or Unknown, nothing is downloaded, and nothing is looked up.

A Country condition cannot work while GeoIP is off, and treating it as Any would silently remove the restriction from Allow rules. So OkYouIn disables the rules that use a Country condition, after asking you:

  • The Source card always shows Used by N rules — every global and application rule with a Country condition, enabled or not.
  • Choosing Off while some of them are enabled asks “These N rules will be disabled because they use GeoIP”. Confirm, and they are disabled and marked Disabled: GeoIP off in the rule tables.
  • While GeoIP is off, such a rule cannot be enabled or saved as enabled.
  • Choosing a source again asks whether to Enable all the rules that were disabled this way, or Leave disabled.

The database files are kept while GeoIP is off, so switching back on works at once.

AlertWhen
Country database out of datethe country file in use is older than 60 days
Rules use GeoIP but no country database is loadedan enabled rule has a Country condition while no country file is installed — every country would be Unknown
Job failurethe daily update failed repeatedly

Alerts resolve by themselves when the condition clears. See Alerts.

GeoIP settings use the Settings permissions (view, edit). Country lists have their own Country lists section. Whoever may see a log entry also sees its country — there is no separate permission for geo data.