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.
Where the database comes from
Section titled “Where the database comes from”The Source card has one choice, Where the database comes from:
| Choice | What it means |
|---|---|
| DB-IP Lite (free) | The default. No account needed; country and network (ASN) databases, a new version every month. |
| MaxMind | Your MaxMind account — GeoLite2 (free) or paid GeoIP2. Enter the Account ID and Licence key. The checksum MaxMind publishes is verified on every download. |
| IPinfo | Your IPinfo Lite Access token: country and ASN in one file. |
| Own files only | For servers without internet access: nothing is downloaded, you upload .mmdb files by hand. |
| Off | GeoIP 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.
Automatic updates
Section titled “Automatic updates”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.
Every file is checked before it is used
Section titled “Every file is checked before it is used”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
.mmdbof 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.
Air-gapped installations
Section titled “Air-gapped installations”-
Choose Own files only.
-
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.
-
On the Database files tab click Upload and choose the
.mmdbor.mmdb.gzfile (up to 200 MB). It is checked exactly like a download. -
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).
Check IP
Section titled “Check IP”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.
Attribution
Section titled “Attribution”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.
Using countries in rules
Section titled “Using countries in rules”-
Create one or more country lists under Infrastructure ▸ Objects ▸ Countries.
-
In a global or application rule, switch off Any country on the Country card and add the lists.
-
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.
The approving device
Section titled “The approving device”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.
UDP check (STUN) for Web Push
Section titled “UDP check (STUN) for Web Push”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.
Switching GeoIP off
Section titled “Switching GeoIP off”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.
Alerts
Section titled “Alerts”| Alert | When |
|---|---|
| Country database out of date | the country file in use is older than 60 days |
| Rules use GeoIP but no country database is loaded | an enabled rule has a Country condition while no country file is installed — every country would be Unknown |
| Job failure | the daily update failed repeatedly |
Alerts resolve by themselves when the condition clears. See Alerts.
Permissions
Section titled “Permissions”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.