IP Relaxation And Restriction
The Three Controls (Do Not Confuse Them)
| Control |
Where |
Effect |
| Profile → Login IP Ranges |
Profile (edition-dependent — see below) |
Hard block. A login from outside the range is refused. |
| Network Access → Trusted IP Ranges |
Setup → Network Access |
Soft relaxation. Skips the device-activation identity challenge. Logins from outside are still permitted. |
Connected App → ipRelaxation |
Connected App → OAuth Policies |
Decides whether this app honours the org's IP restrictions. Can cancel the profile block entirely. |
Using Trusted IP Ranges as a hard control is the single most common
misconfiguration in this domain, and it produces an org that reads as locked down
and is not. Trusted ranges govern device activation:
Device activation challenges a login from an unrecognised browser/device or from
outside a trusted IP range — quoted from the Security Guide, with the interaction
between the two triggers, in references/gotchas.md.
— Salesforce Security Guide, Device Activation
Outside a trusted range the login is challenged, not refused.
Before Starting
Separate the populations. Integration identities (static address, no human
to lock out) and human identities (mobile, travelling, changing ISPs) need
different controls. Almost every bad outcome in this domain comes from applying
the integration control to a human population.
Confirm where Login IP Ranges live in this edition. Enterprise, Unlimited,
Performance, and Developer manage them on profiles. Group and Personal manage
them on the Session Settings page. Professional depends on whether the "Edit
Profiles & Page Layouts" org preference is enabled.
Get static egress in writing, both address families. A partner who answers
"our egress is 203.0.113.10" has answered about IPv4 only.
Inventory connected apps. A single app with ipRelaxation set to BYPASS
cancels the profile design you are about to write.
Core Concepts
Login IP Ranges
Entered as inclusive start/end pairs; a single address is the same value in both
fields. Available as loginIpRanges (ProfileLoginIpRange[]) in the Profile
metadata type since API 17.0. Viewing needs View Setup and Configuration;
editing and deleting need Manage Profiles and Permission Sets.
Address-family rule, verbatim:
"The IP addresses in a range must be either IPv4 or IPv6 ... A range can't include
IP addresses both inside and outside of the IPv4-mapped IPv6 address space."
So a dual-stack partner needs two ranges, not one. Note also: "Partner User profiles
are limited to five IP addresses. To increase this limit, contact Salesforce."
Login-time vs per-request enforcement
By default the check happens at login. The org-wide switch that makes it
continuous:
Setup → Session Settings → [x] Enforce login IP ranges on every request
"This option affects all user profiles that have login IP restrictions."
That sentence is the whole risk. It activates every Login IP Range in the org
simultaneously, including ranges on profiles nobody has reviewed in years.
Connected App ipRelaxation
Required field, four values:
| Value |
Effect |
ENFORCE (default) |
"Enforces the IP restrictions configured for the org, such as the IP ranges assigned to a user profile." |
BYPASS |
"Allows a user to run this app without org IP restrictions." |
BYPASS_2FACTOR |
Bypasses when the app has its own allowed IP list and uses the web server OAuth flow; or, with no app IP list, when the user completes identity verification from a new browser or device. |
ENFORCE_RELAXREFRESH |
Enforces the restriction, "however, this option bypasses these restrictions when the connected app uses refresh tokens to get access tokens." |
Any value other than ENFORCE is a documented hole in the profile restriction and
needs a named approver.
Interaction with MFA
Trusted IP Ranges suppress the device-activation challenge. They do not remove
MFA, which Salesforce requires unconditionally: "To safeguard access to your
network, Salesforce requires that all logins use multi-factor authentication (MFA)."
Treating a trusted range as a partial MFA exemption is a misreading of both
features.
Interaction with SSO
The identity provider authenticates first; Salesforce still evaluates its own
profile ranges when the assertion arrives. The address Salesforce evaluates is the
one that reaches Salesforce, which behind a proxy may not be the user's origin. Read
it from Setup → Login History: the Source IP column "stores the client IP
address of the request that first reaches Salesforce during a login," and the
Forwarded for IP column carries X-Forwarded-For — but "This column doesn't get
populated for OAuth and single sign-on logins," so for SSO, Source IP is all you
have.
Common Patterns
Pattern A — hard-lock the integration profile
One dedicated profile per integration, ranges scoped to the partner's provisioned
NAT (primary and DR), every range carrying a description with the owner and the
renewal date. This is where IP restriction is strongest and cheapest.
Pattern B — trusted ranges for offices, MFA everywhere
Network Access ranges for office and VPN egress to cut verification friction. MFA
stays on for everyone. No profile ranges on human profiles.
Pattern C — per-app relaxation instead of per-profile loosening
When one profile serves both a stable integration and travelling humans, keep the
profile restriction and set the humans' connected app to a documented non-ENFORCE
value — rather than deleting the profile restriction and protecting nothing.
Pattern D — dual-range rotation
When a partner address changes: add the new range, keep the old, let the partner
cut over, confirm 72 hours of clean logins, then remove the old range as a separate
change. Never a same-day swap.
Decision Guidance
| Situation |
Control |
| Integration user, partner has provisioned static egress |
Profile Login IP Ranges, scoped to that profile only |
| Integration user, partner cannot provide static egress |
Not available. Say so, and carry the posture with a dedicated user, minimal permissions, short-lived tokens, and query-volume monitoring |
| Human users, office and VPN networks known |
Network Access Trusted IP Ranges (friction only) + MFA |
| System Administrator profile |
No IP block. MFA, short session, login alerting, break-glass admin |
| Session replay is in the threat model |
Session Settings → Enforce login IP ranges on every request, after an inventory and a sandbox rehearsal |
| One profile serves integrations and travelling humans |
Keep the profile restriction; adjust the app's ipRelaxation with an approver |
| Background job refreshes tokens from a rotating egress |
ENFORCE_RELAXREFRESH, recorded as a documented hole |
| Public Site guest profile |
Not an IP problem — harden with object/field permissions and sharing |
Recommended Workflow
- Map profiles to personas and classify each as integration or human. Only
integration profiles are candidates for a hard block.
- Catalogue egress addresses per office, VPN, and partner, in both IPv4 and
IPv6, with a named owner and a renewal date for each.
- Apply Profile Login IP Ranges to integration profiles only, one profile per
integration, with a
description on every range.
- Configure Network Access Trusted IP Ranges for office and VPN egress to
reduce device-activation friction. Do not treat this as a restriction.
- Audit
ipRelaxation on every connected app. Anything other than ENFORCE
needs a written justification and an approver, recorded alongside the profile
design.
- Leave the System Administrator profile unrestricted and protect it with MFA,
a short session timeout, and Login History alerting. Keep one monitored
break-glass admin.
- Write the rotation and break-glass runbook before enforcing, then enable and
monitor login failures for integration identities for the first two weeks.
Review Checklist
Salesforce-Specific Gotchas
Full detail with quotes in references/gotchas.md.
- Trusted IP Ranges block nothing — they suppress the device-activation
challenge.
- Login IP Ranges are checked at login, not on every request, until the
org-wide Session Settings switch is on.
- A connected app can cancel your profile restriction via
ipRelaxation.
- A range cannot straddle the IPv4-mapped IPv6 boundary.
- Where Login IP Ranges live depends on the edition.
- IP-restricting a Site guest profile forces private static-resource caching,
with a documented tail of up to 45 days on reversal.
- Cloud-hosted partners often have no static egress unless it was contracted.
- SSO changes where the restriction applies, not whether it does — and
Forwarded for IP is empty for SSO and OAuth logins.
- Removing a range does not terminate existing sessions or revoke tokens.
Output Artifacts
| Artifact |
Description |
| Profile-to-persona map |
Every profile classified integration or human, with the control selected for each and the reason |
| IP inventory |
Address, family, owner, renewal date, and source (contract clause or partner confirmation) for every range |
| Connected app relaxation audit |
Every app's ipRelaxation value, with a justification and approver for anything other than ENFORCE |
| Rotation runbook |
Dual-range overlap procedure with the confirmation window and the separate removal change |
| Break-glass procedure |
The unrestricted admin identity, where its credentials live, and what alerting watches it |
Related Skills
security/mfa-enforcement-patterns — the identity-side control that carries the
populations IP restriction cannot
security/network-security-and-trusted-ips — the broader network-layer surface,
including CORS and TLS, which this skill explicitly excludes
security/api-only-user-hardening — the integration identity that a hard IP block
is usually protecting
security/session-management-and-timeout — session lifetime and the per-request
enforcement switch's neighbours
1---2name: ip-relaxation-and-restriction3description: Design IP-based access controls: profile login IP ranges, org-wide trusted IPs, IP relaxation per profile, and the interaction with MFA and SSO. Trigger keywords: login IP range, trusted IP, IP relaxation, restricted IP, IP allowlist, login hours. NOT for CSP Trusted Sites, CORS allowlists, TLS requirements, or troubleshooting a CSP violation — use security/network-security-and-trusted-ips.4---56# IP Relaxation And Restriction78## The Three Controls (Do Not Confuse Them)910| Control | Where | Effect |11|---|---|---|12| **Profile → Login IP Ranges** | Profile (edition-dependent — see below) | **Hard block.** A login from outside the range is refused. |13| **Network Access → Trusted IP Ranges** | Setup → Network Access | **Soft relaxation.** Skips the device-activation identity challenge. Logins from outside are still permitted. |14| **Connected App → `ipRelaxation`** | Connected App → OAuth Policies | Decides whether *this app* honours the org's IP restrictions. Can cancel the profile block entirely. |1516Using Trusted IP Ranges as a hard control is the single most common17misconfiguration in this domain, and it produces an org that reads as locked down18and is not. Trusted ranges govern device activation:1920Device activation challenges a login from an unrecognised browser/device *or* from21outside a trusted IP range — quoted from the Security Guide, with the interaction22between the two triggers, in [`references/gotchas.md`](references/gotchas.md).23> — Salesforce Security Guide, *Device Activation*2425Outside a trusted range the login is **challenged, not refused**.2627---2829## Before Starting30311. **Separate the populations.** Integration identities (static address, no human32 to lock out) and human identities (mobile, travelling, changing ISPs) need33 different controls. Almost every bad outcome in this domain comes from applying34 the integration control to a human population.35362. **Confirm where Login IP Ranges live in this edition.** Enterprise, Unlimited,37 Performance, and Developer manage them on profiles. Group and Personal manage38 them on the Session Settings page. Professional depends on whether the "Edit39 Profiles & Page Layouts" org preference is enabled.40413. **Get static egress in writing, both address families.** A partner who answers42 "our egress is 203.0.113.10" has answered about IPv4 only.43444. **Inventory connected apps.** A single app with `ipRelaxation` set to `BYPASS`45 cancels the profile design you are about to write.4647---4849## Core Concepts5051### Login IP Ranges5253Entered as inclusive start/end pairs; a single address is the same value in both54fields. Available as `loginIpRanges` (`ProfileLoginIpRange[]`) in the Profile55metadata type since API 17.0. Viewing needs **View Setup and Configuration**;56editing and deleting need **Manage Profiles and Permission Sets**.5758Address-family rule, verbatim:5960> "The IP addresses in a range must be either IPv4 or IPv6 ... A range can't include61> IP addresses both inside and outside of the IPv4-mapped IPv6 address space."6263So a dual-stack partner needs two ranges, not one. Note also: "Partner User profiles64are limited to five IP addresses. To increase this limit, contact Salesforce."6566### Login-time vs per-request enforcement6768By default the check happens at login. The org-wide switch that makes it69continuous:7071```text72Setup → Session Settings → [x] Enforce login IP ranges on every request73```7475> "This option affects all user profiles that have login IP restrictions."7677That sentence is the whole risk. It activates every Login IP Range in the org78simultaneously, including ranges on profiles nobody has reviewed in years.7980### Connected App `ipRelaxation`8182Required field, four values:8384| Value | Effect |85|---|---|86| `ENFORCE` (default) | "Enforces the IP restrictions configured for the org, such as the IP ranges assigned to a user profile." |87| `BYPASS` | "Allows a user to run this app without org IP restrictions." |88| `BYPASS_2FACTOR` | Bypasses when the app has its own allowed IP list and uses the web server OAuth flow; or, with no app IP list, when the user completes identity verification from a new browser or device. |89| `ENFORCE_RELAXREFRESH` | Enforces the restriction, "however, this option bypasses these restrictions when the connected app uses refresh tokens to get access tokens." |9091Any value other than `ENFORCE` is a documented hole in the profile restriction and92needs a named approver.9394### Interaction with MFA9596Trusted IP Ranges suppress the *device-activation* challenge. They do not remove97MFA, which Salesforce requires unconditionally: "To safeguard access to your98network, Salesforce requires that all logins use multi-factor authentication (MFA)."99Treating a trusted range as a partial MFA exemption is a misreading of both100features.101102### Interaction with SSO103104The identity provider authenticates first; Salesforce still evaluates its own105profile ranges when the assertion arrives. The address Salesforce evaluates is the106one that reaches Salesforce, which behind a proxy may not be the user's origin. Read107it from **Setup → Login History**: the **Source IP** column "stores the client IP108address of the request that first reaches Salesforce during a login," and the109**Forwarded for IP** column carries `X-Forwarded-For` — but "This column doesn't get110populated for OAuth and single sign-on logins," so for SSO, Source IP is all you111have.112113---114115## Common Patterns116117### Pattern A — hard-lock the integration profile118119One dedicated profile per integration, ranges scoped to the partner's provisioned120NAT (primary and DR), every range carrying a `description` with the owner and the121renewal date. This is where IP restriction is strongest and cheapest.122123### Pattern B — trusted ranges for offices, MFA everywhere124125Network Access ranges for office and VPN egress to cut verification friction. MFA126stays on for everyone. No profile ranges on human profiles.127128### Pattern C — per-app relaxation instead of per-profile loosening129130When one profile serves both a stable integration and travelling humans, keep the131profile restriction and set the humans' connected app to a documented non-`ENFORCE`132value — rather than deleting the profile restriction and protecting nothing.133134### Pattern D — dual-range rotation135136When a partner address changes: add the new range, keep the old, let the partner137cut over, confirm 72 hours of clean logins, then remove the old range as a separate138change. Never a same-day swap.139140---141142## Decision Guidance143144| Situation | Control |145|---|---|146| Integration user, partner has provisioned static egress | Profile Login IP Ranges, scoped to that profile only |147| Integration user, partner cannot provide static egress | **Not available.** Say so, and carry the posture with a dedicated user, minimal permissions, short-lived tokens, and query-volume monitoring |148| Human users, office and VPN networks known | Network Access Trusted IP Ranges (friction only) + MFA |149| System Administrator profile | **No IP block.** MFA, short session, login alerting, break-glass admin |150| Session replay is in the threat model | Session Settings → Enforce login IP ranges on every request, after an inventory and a sandbox rehearsal |151| One profile serves integrations and travelling humans | Keep the profile restriction; adjust the app's `ipRelaxation` with an approver |152| Background job refreshes tokens from a rotating egress | `ENFORCE_RELAXREFRESH`, recorded as a documented hole |153| Public Site guest profile | Not an IP problem — harden with object/field permissions and sharing |154155---156157## Recommended Workflow1581591. **Map profiles to personas** and classify each as integration or human. Only160 integration profiles are candidates for a hard block.1612. **Catalogue egress addresses per office, VPN, and partner**, in both IPv4 and162 IPv6, with a named owner and a renewal date for each.1633. **Apply Profile Login IP Ranges to integration profiles only**, one profile per164 integration, with a `description` on every range.1654. **Configure Network Access Trusted IP Ranges for office and VPN egress** to166 reduce device-activation friction. Do not treat this as a restriction.1675. **Audit `ipRelaxation` on every connected app.** Anything other than `ENFORCE`168 needs a written justification and an approver, recorded alongside the profile169 design.1706. **Leave the System Administrator profile unrestricted** and protect it with MFA,171 a short session timeout, and Login History alerting. Keep one monitored172 break-glass admin.1737. **Write the rotation and break-glass runbook before enforcing**, then enable and174 monitor login failures for integration identities for the first two weeks.175176---177178## Review Checklist179180- [ ] Every hard block is on an integration profile, not a human one181- [ ] System Administrator profile has no Login IP Ranges182- [ ] A monitored, MFA-protected break-glass admin exists outside every restriction183- [ ] Every range has a `description` naming its owner and renewal date184- [ ] Dual-stack partners have separate IPv4 and IPv6 ranges185- [ ] No cloud-provider-wide CIDR anywhere in the allow-list186- [ ] `ipRelaxation` audited across all connected apps; non-`ENFORCE` values justified187- [ ] Trusted IP Ranges are documented as friction reduction, not as a restriction188- [ ] MFA is enforced independently of every IP setting189- [ ] If per-request enforcement is on: profile inventory pruned and sandbox-rehearsed190- [ ] Rotation runbook exists with a dual-range overlap window191- [ ] Alerting on login failures for integration identities192193---194195## Salesforce-Specific Gotchas196197Full detail with quotes in [`references/gotchas.md`](references/gotchas.md).1981991. **Trusted IP Ranges block nothing** — they suppress the device-activation200 challenge.2012. **Login IP Ranges are checked at login, not on every request**, until the202 org-wide Session Settings switch is on.2033. **A connected app can cancel your profile restriction** via `ipRelaxation`.2044. **A range cannot straddle the IPv4-mapped IPv6 boundary.**2055. **Where Login IP Ranges live depends on the edition.**2066. **IP-restricting a Site guest profile forces private static-resource caching**,207 with a documented tail of up to 45 days on reversal.2087. **Cloud-hosted partners often have no static egress** unless it was contracted.2098. **SSO changes where the restriction applies, not whether it does** — and210 Forwarded for IP is empty for SSO and OAuth logins.2119. **Removing a range does not terminate existing sessions or revoke tokens.**212213---214215## Output Artifacts216217| Artifact | Description |218|---|---|219| Profile-to-persona map | Every profile classified integration or human, with the control selected for each and the reason |220| IP inventory | Address, family, owner, renewal date, and source (contract clause or partner confirmation) for every range |221| Connected app relaxation audit | Every app's `ipRelaxation` value, with a justification and approver for anything other than `ENFORCE` |222| Rotation runbook | Dual-range overlap procedure with the confirmation window and the separate removal change |223| Break-glass procedure | The unrestricted admin identity, where its credentials live, and what alerting watches it |224225---226227## Related Skills228229- `security/mfa-enforcement-patterns` — the identity-side control that carries the230 populations IP restriction cannot231- `security/network-security-and-trusted-ips` — the broader network-layer surface,232 including CORS and TLS, which this skill explicitly excludes233- `security/api-only-user-hardening` — the integration identity that a hard IP block234 is usually protecting235- `security/session-management-and-timeout` — session lifetime and the per-request236 enforcement switch's neighbours