Cross-Border Service Access Control: Geography, Entity, and Ownership Penetration
This article explains how to design access control for cross-border online services across location, entity identity, and ownership/control relationships. It covers conflicting location signals, entity registration and operating locations, ownership penetration with thresholds and cycle detection, unified enforcement across multiple entry points, policy versioning, and misjudgment/appeal handling.
1. Background
In the past, most online services applied geographic restrictions based on a single factor: where the request came from. The server used the IP address to determine the visitor’s country or region and denied service when the location matched a restricted list. This approach is simple to implement, but it only answers “where is the person?” It does not answer “who is using the service, who controls them, and through which channel are they using it?”
Recently, some service terms have begun to extend the scope of determination to the entity level. The same service may be offered to individual users, enterprise accounts, instances distributed by third-party cloud platforms, and authorized reseller channels. Checking only IP addresses cannot cover these scenarios, and compliance risk increases accordingly. For developers, the problem becomes how to handle three types of information in one system: location, entity, and control relationships.
2. Three Dimensions of Access Determination
2.1 User Location
User location usually cannot rely on a single signal. Common signals include:
- Geolocation results from IP addresses, whose accuracy depends on geographic databases and varies by network environment;
- The country or region registered when the account was created;
- The issuing country of the payment method or the billing address;
- Time zone and language settings of the device and browser, used only as supporting references.
These signals may conflict. For example, an employee traveling abroad may have an IP address showing an overseas location while the account is registered domestically. In such cases, the system should produce a result according to a defined priority rather than arbitrarily selecting one signal. The rules need to specify the weight or priority of each signal and record which signals were used in each determination so that the decision can be reviewed later.
Proxy services and VPNs can distort IP-based geolocation. Therefore, the system should not treat “IP shows an available region” as a sufficient condition. For high-risk scenarios, it may require more evidence or route the case to manual review.
2.2 Entity Attribution
Entity attribution answers “who is this organization?” The determination usually involves three fields:
- Registration location: the country or region where the company registration authority is located;
- Headquarters location: where the actual management core is located;
- Operating location: where the main business operations and personnel are located.
These three may not align. A company may be registered in one place but operate from another, which is common in cross-border structures. The rules need to clarify the role of each field in the determination, for example, “deny if any field matches a restricted region” or “use headquarters location as the basis.” Once the rules are established, the three fields should be stored separately in the data model to avoid traceability problems later.
2.3 Ownership Penetration and Control Relationships
Ownership penetration is the most complex part. It requires tracing upward along the shareholding chain to find the ultimate holding entity or actual controller, and then determining whether the conditions are met according to the rules.
Penetration needs to handle the following issues:
- Direct and indirect holdings: indirect ownership percentages are usually calculated by multiplying the ownership percentages at each layer; the specific calculation method should follow the applicable rules;
- Aggregated holdings by multiple shareholders: the rules may require adding the percentages of multiple shareholders in the same region;
- Control relationships: in addition to ownership percentages, contractual control, board appointment rights, and other arrangements may also constitute control;
- Circular ownership: ownership structures may contain circular relationships, and the algorithm needs to detect cycles and set termination conditions.
The ownership percentage threshold, maximum penetration depth, and criteria for determining control relationships should be established by legal and compliance teams according to applicable rules. Developers should turn these rules into configurable parameters and should not assume values on their own.
3. Unified Policy Across Multiple Entry Points
The same service is often provided through multiple entry points. Common entry points include:
- Official websites and consoles;
- Application programming interfaces (APIs);
- Developer tools and command-line clients;
- Integrations with third-party cloud platforms;
- Services provided by authorized resellers.
If determination is performed only at the website entry point, other entry points become bypass paths. The correct approach is to push access determination down to a unified gateway or authentication layer so that all entry points share the same policy.
Request → Access layer (unified authentication) → Access decision service → Business service↑Policy repository / Entity data / Geographic data
For third-party channels, the boundaries of responsibility also need to be clarified in contracts and interfaces: which party collects entity information, which party enforces the determination, and which party stores determination records. If responsibilities are unclear, the policy can easily break down along the chain.
4. Determination Flow Design
Below is a general determination example. The code is intended only to illustrate the structure; field names and thresholds are examples.
from dataclasses import dataclass, fieldMAX_DEPTH = 5 # Maximum penetration depth, determined by configuration@dataclassclass Holding:holder_region: strholder_is_entity: boolpercent: float # Ownership percentage, 0 to 100holder_id: str | None = None@dataclassclass Organization:org_id: strregistration_region: strheadquarters_region: strholdings: list[Holding] = field(default_factory=list)@dataclassclass PolicyConfig:restricted_regions: set[str]majority_threshold: float # Configured by the compliance teammax_penetration_depth: intdef evaluate_org(org: Organization, policy: PolicyConfig) -> tuple[bool, str]:if org.registration_region in policy.restricted_regions:return False, "registration_region_restricted"if org.headquarters_region in policy.restricted_regions:return False, "headquarters_region_restricted"restricted_share = sum(h.percent for h in org.holdingsif h.holder_region in policy.restricted_regions)if restricted_share >= policy.majority_threshold:return False, "ownership_restricted"return True, "allowed"
This code only demonstrates the determination for direct holdings. A real system needs recursive penetration and must handle circular references. The approach is as follows:
def penetrate(org_id, graph, depth=0, visited=None):visited = visited or set()if depth > MAX_DEPTH or org_id in visited:return []visited.add(org_id)results = []for holding in graph.get(org_id, []):results.append(holding)if holding.holder_is_entity and holding.holder_id:results.extend(penetrate(holding.holder_id, graph, depth + 1, visited))return results
Three points require attention during implementation. First, recursion must have a depth limit to prevent unlimited expansion. Second, the visited set is used to skip circular ownership. Third, penetration results should retain path information so that the basis for a determination can be explained during audits.
5. Rule Versions and Effective Management
Access rules change over time. The effective date, scope of application, and explanatory notes for each rule need to be placed under version management. Recommended practices include:
- Each rule version has a unique identifier and effective time;
- Determination records store the rule version number and input snapshot used at the time;
- New versions are first rolled out gradually on a small scale, and the false positive rate is observed before a full switch;
- A rollback path is retained so that the previous version can be restored if problems occur.
Some updates are only clarifications of existing terms. The system should be able to distinguish such changes from new restrictions and note the basis in the change log. This allows business teams to quickly determine during review whether a denial decision was consistent with the rules in effect at the time.
6. Misjudgments and Appeals
Any data-based determination will have errors. Geolocation errors, outdated entity information, and lagging ownership data can all cause compliant users to be incorrectly denied. The system needs a clear appeal path:
- Return a stable error code in the denial response rather than a vague message;
- Users
