How IP access control works
How Laramin decides whether an IP address may sign in, how Blocked IPs and IP Rules relate, which rule wins, and what the policy mode, auto-block and break-glass settings change.
- Applies to
- Core 12.0 and later
- Who can do this
- Administrator, Platform owner
On this page
In short
Laramin keeps one list of IP rules. Each rule allows or blocks an IP address or CIDR range, either for everyone, for one role or for one user. When someone signs in, Laramin checks their IP address against the most specific rules that apply to them. An explicit block always wins.
How it works
One list, two screens
Blocked IPs and IP Rules edit the same list:
- Configurations › Security › IP Rules shows every rule: allow and block, global, role and user.
- Configurations › Security › Blocked IPs is a shortcut that shows only global block rules. A blocked IP you add there also appears in IP Rules, with Type set to Block and Scope set to Global.
Only rules whose status is Active (in IP Rules) or Blocked (in Blocked IPs) count. An Inactive or Released rule is ignored, but it stays in the list.
When the check runs
Laramin checks the IP address:
- when someone signs in to the admin, before their password is accepted,
- when someone signs up on the sign-up form, with Allow public registration on, before the account is created. This needs Core 12.8.7 or later,
- when someone signs in to your mobile app with their password, before the password is accepted, and each time the app renews its sign-in. This needs Core 12.8.5 or later,
- when someone enters their two-factor code in your mobile app, before the code is checked, and when someone signs up in your mobile app, before the account is created and again before their emailed code is checked. This needs Core 12.8.6 or later,
- when someone signs in with Google or another provider, on the website, the admin or your mobile app, once the provider has said who they are and before they're signed in. This needs Social Login 2.1.2 or later. From Social Login 2.1.3, it's checked before a first sign-in creates an account, so a refused address leaves no new account behind,
- when an app or integration signs in or signs up through the web API (
/api/andv1/ web/ login /api/), before the password is checked or the account is created. This needs Core 12.8.7 or later, andv1/ web/ register - on every request to the REST API.
If an IP rule refuses a sign-in, the person sees: Access denied from your network address. Please contact your administrator. A social sign-in or a mobile app sign-in that's refused gets the same message, and isn't asked for a two-factor code first. From Core 12.8.6, so does a mobile app sign-up, which then creates no account, and a request to the REST API, which answers 403 with the error code UNAUTHORIZED. From Core 12.8.7, so does the sign-up form, where the message appears under the email field and no account is created or emailed, and the web API's sign-in and sign-up, which issue no token. Someone who is already signed in to the admin when you add a rule isn't signed out. The rule applies the next time they sign in. Your mobile app is refused from that address on its next request, and can't renew its sign-in there.
Which rules apply
Laramin looks at three levels, from most specific to least:

- User rules. If the person has any active rules with Scope set to User, only those rules decide.
- Role rules. Otherwise, if any of their roles have active rules, only those rules decide. Laramin uses the person's global roles, not roles they hold only inside a team.
- Global rules and the policy mode. If neither applies, the global rules decide.
At the user or role level:
- An IP address that matches a block rule is refused.
- If there are allow rules at that level, the IP address must match one of them.
- If there are only block rules and none match, the IP address is allowed.
At the global level:
- A global block rule that matches always refuses, whatever the mode.
- With IP policy mode set to Block-list only (the default), every other IP address is allowed.
- With IP policy mode set to Allow-list only, the IP address must match a global allow rule.
If the email address entered at sign-in doesn't belong to a user, only the global rules apply. The same goes for signing up, on the sign-up form, in your mobile app or through the web API: the account doesn't exist yet. Once it does, entering the emailed code is checked against its own rules too. A social sign-in is checked for the account the provider names, so that account's user and role rules apply, as after its password. A first social sign-in, which would create an account, is checked against the global rules: no user or role rule can name an account that doesn't exist yet.
Careful: Social Login 2.1.1 and earlier didn't check IP rules, so a blocked address could sign in with a provider. Update Social Login to 2.1.2. Social Login 2.1.2 still created the account of a refused first sign-in before refusing it; 2.1.3 creates nothing.
Core 12.8.4 and earlier didn't check IP rules when the mobile app signed in with a password or renewed its sign-in, so a blocked address still got a session there. Update Core to 12.8.5. Core 12.8.5 still let a refused address sign up in the app, and finish a sign-in at the two-factor code step it had started from an allowed address. Update Core to 12.8.6. Core 12.8.6 and earlier let a refused address sign up on the sign-up form, and get a token from the web API's sign-in and sign-up. Update Core to 12.8.7.
Example
Your office uses 10.0.0.0/24. You set IP policy mode to Allow-list only and add a global Allow rule for 10.0.0.0/24. Staff can now sign in only from the office. Your accountant works from home, so you add a User rule that allows their home address. Because they now have a user rule, that rule decides for them, and the office range no longer applies to them.
Break-glass for super admins
With Super-admin break-glass bypass on (the default), a super admin can sign in from an IP address that isn't on an allow list. It doesn't override a block rule that matches their address.
Automatic blocking
With Auto-block suspicious IPs on (the default), Laramin counts failed sign-ins from each IP address. When one address reaches the Auto-block threshold (10 by default) within 10 minutes, Laramin adds a global block rule for it. The rule's reason reads "Auto-blocked after repeated failed login attempts. Expires at: …", using the Auto-block duration (minutes) setting.
An automatic block lifts by itself at its expiry time, shown in the Expires column of IP Rules. Blocks you add yourself never expire. To let an address in sooner, release it.
Account lockout is separate
Brute-force protection locks an account or an IP address for Lockout duration (minutes) after Max login attempts failures. That lockout isn't an IP rule. You won't find it in either list, and it ends by itself. See Someone is locked out by an IP rule.
How it relates to
- Security settings: the policy mode, auto-block and break-glass switches. See Security settings.
- Permissions: Blocked IPs use
feature.and IP Rules usecore. blocked_ip. * feature.. Both are part of the standard Administrator role. Because the two screens edit the same list, someone who can delete IP rules can also remove blocked IPs.core. ip_rule. *
Next steps
Thanks. That helps us decide what to write next.
Thanks for telling us what was missing.
You already answered for this article today. Thanks.
We got a lot of answers from your network just now. Try again in a few minutes.
We couldn't send that. Check your connection and try again.
Links in this article
Printed from help.bsscn.com. The online article may have changed since.