MODULES / CORE

Login IP Restriction

Limit member access to this company by trusted IPv4 or IPv6 addresses and CIDR ranges.

Overview

Module idask_login_ip_restriction
Version1.0.0
Who uses itAnyone who uses the screens listed below.
InstalledOn demand, from Settings → Modules. Anything it needs is installed with it.

Where to find it

Settings / Users & accessLogin IP restrictions

The menu entries appear once the module is installed and your role allows them.

How it links to other modules

  • Needs: Core
  • Works better with: no other module in particular
  • Needed by: no other module

A module that is needed cannot be turned off while the module that needs it is on.

Details

Login IP Restriction

Port of D:/Odoo18/sparkosol/custom-addons.odoo18/ask_login_ip_restriction, adapted to ASKERP's company isolation. A company administrator with member-management permission can maintain an IPv4/IPv6 allowlist for each company member. CIDR ranges are normalized and validated on the server.

Install Login IP Restriction from Settings > Modules, then open Settings > Login IP restrictions. Restrictions apply only to the company where they were configured. Enabling a restriction for yourself requires the current address to be trusted first; this avoids accidental self-lockout.

Client addresses are accepted only from the header named by ASKERP_CLIENT_IP_HEADER. Configure the trusted reverse proxy to overwrite that header with the connection address. ASKERP intentionally ignores X-Forwarded-For, X-Real-IP, and Cloudflare headers unless the operator explicitly selects one as the trusted header. If no valid address is available, an enabled allowlist fails closed.

The email sign-in endpoint denies sign-in when every company the account belongs to has an active IP policy and none permits the request address. Authenticated access to each company is checked again in web company context, server actions, and company-scoped APIs; an allowed or unrestricted company remains usable when another tenant has a different policy. Restrictions are audited and company-isolated with PostgreSQL RLS. Disabling the module stops enforcement but retains policies for reinstall.

Migration 0098_login_ip_restriction.sql adds the company-scoped policy and network tables. No Odoo code or proxy-trust defaults are copied.

Login IP Restriction | ASKERP Docs