← Back to Security & Compliance
SEC-008 Security & Compliance 15 min read For: Network & Security Engineers

IP Whitelisting and Network Security in Salesforce

Designing network perimeter boundaries, configuring login IP ranges, and securing API endpoints from unauthorized networks.

VS

Vishal Sharma

Salesforce Architecture Specialist · Updated May 2026

What you will learn in this tutorial
  • Understand the multi-tiered network perimeter security model of the Salesforce platform.
  • Compare the behaviour and operational boundaries of Trusted IP Ranges versus Login IP Ranges.
  • Implement strict IP-based restriction profiles to lock down access to corporate networks.
  • Secure integration endpoints using mutual SSL/TLS authentication and whitelisted external IPs.
  • Track, audit, and analyse login activities to proactively identify network security anomalies.
  • Construct a robust administrative disaster recovery protocol to manage emergency network lockouts.

1. Salesforce Network Perimeter Architecture

For large organisations and financial institutions, securing access to cloud platforms begins at the network layer. Salesforce is a multi-tenant SaaS application operating on public cloud infrastructure and Salesforce-owned data centres. Because it is globally accessible via the public internet, defining clear network perimeters is a vital security requirement. Network security in Salesforce is not governed by a single firewall rule or a physical gate; instead, it is a multi-tiered, software-defined architecture that evaluates the origin of every incoming request before allowing authentication to proceed.

When a client application or an employee attempts to connect to a Salesforce instance, the request passes through several logical checkpoints. These checkpoints include DNS routing, Edge Services (such as My Domain and Salesforce Edge Network), SSL/TLS decryption, and application-level network security evaluations. Architects must understand that network security is evaluated before any user-level authorization (like profile permissions or sharing rules) is verified. If the incoming request originates from an unauthorised IP address or fails TLS compliance checks, the session is terminated immediately, preventing exposure of the login interface or API endpoints.

My Domain plays a pivotal role in this architecture by establishing a unique, custom subdomain for the organisation's Salesforce instance (e.g., mycompany.my.salesforce.com). Beyond brand identity, My Domain acts as a routing control point. It allows organisations to enforce modern security standards, such as restricting login endpoints to single sign-on (SSO) providers, enforcing HTTP Strict Transport Security (HSTS), and disabling default login paths (like login.salesforce.com). This forces all traffic to route through corporate-approved channels where network policies, proxy inspections, and context-aware security tools can be applied before the request ever reaches the Salesforce database container.

In the era of Salesforce Hyperforce, the traditional paradigm of static network whitelisting undergoes a massive shift. Under the legacy infrastructure, organisations could rely on static IP address blocks provided by Salesforce data centres to filter outbound traffic. However, Hyperforce operates on public cloud infrastructure (such as AWS), utilising highly dynamic IP routing and elastic scaling. This means that outbound IP addresses are dynamic and subject to frequent change without notice. Relying on static IP whitelisting for outbound integrations or routing is a major anti-pattern in Hyperforce, as it leads to connection failures. Architects must modernise their network security models, transitioning from static IP whitelisting to secure domain-based filtering, mutual SSL/TLS (mTLS), or utilising Secure Agent gateways that tunnel traffic through a secure endpoint without relying on fixed public IPs.

2. Trusted IP Ranges vs. Profile-Level Login IP Ranges

Within Salesforce, network restrictions are primarily configured using two features that sound similar but behave in fundamentally different ways: Org-Wide Trusted IP Ranges (Network Access) and Profile-Specific Login IP Ranges. Misunderstanding the difference between these two features is a common architectural error that can lead to either critical security gaps or massive user disruption.

Org-Wide Trusted IP Ranges (Network Access): Configured at the global organisation level under Setup -> Security -> Network Access. These ranges represent a list of trusted networks from which users are expected to connect (e.g., corporate office networks). The critical security behaviour to understand is that Org-Wide Trusted IP Ranges do not block access from outside these ranges. If a user attempts to log in from an IP address that is not on the Trusted list, they are not denied entry. Instead, Salesforce triggers a Multi-Factor Authentication (MFA) or identity verification challenge (such as sending a verification code via email or mobile). Once the user successfully completes the verification challenge, they are granted access. Effectively, Org-Wide Trusted IP Ranges act as a trust-elevation tool, allowing users within known corporate offices to log in seamlessly without repetitive verification prompts while requiring active verification for remote or home networks.

Profile-Specific Login IP Ranges: Configured at the Individual Profile level under Setup -> Users -> Profiles -> [Profile Name] -> Login IP Ranges. Unlike the Org-wide settings, Profile-level Login IP Ranges represent a hard security perimeter. If a user's profile is configured with specific Login IP Ranges, Salesforce strictly denies login attempts from any IP address outside those ranges. There is no fallback verification challenge, no MFA prompt, and no bypass. The login attempt is immediately terminated at the perimeter, and the user receives a generic "Invalid Username or Password" message to prevent username validation harvesting. The following table provides a direct architectural comparison of these two features:

Feature Configuration Level Behaviour Outside Range Primary Use Case
Trusted IP Ranges Global Org Level Requires identity verification / MFA challenge Exempting office users from repeated verification prompts.
Login IP Ranges Individual Profile Level Immediate denial of login, no challenge offered Locking down high-privilege admins or API integrations to trusted IPs.

Architects must leverage Profile-level Login IP Ranges for all sensitive roles. System administrators, integration service accounts, and financial controllers should always be assigned to profiles that restrict login access exclusively to secure corporate networks, VPN gateways, and trusted static servers. Allowing these high-privilege profiles to log in from arbitrary home or public networks exposes the entire platform to compromise if a user's local device is compromised or their credentials are harvested via phishing attacks.

3. Securing Enterprise Integration and API Access

While securing user access via the browser is critical, protecting API endpoints and integration channels is equally important. External applications connecting to Salesforce via APIs represent a major attack vector if they are not constrained by strict network security policies. Because API integrations typically execute programmatically without human intervention, they are highly susceptible to credential stuffing and brute-force attacks if left open to the public internet.

To secure inbound API connections, architects must implement a double-locked security pattern. First, the integration user profile must be constrained by specific Login IP Ranges. If the external integration runs from a dedicated enterprise service bus (ESB) or an ETL system hosted in an AWS or Azure virtual private cloud, the static outgoing IP addresses of those gateways must be whitelisted on the integration profile in Salesforce. This ensures that even if the integration's OAuth credentials or passwords are stolen, they cannot be used from an unauthorised network.

Second, for ultra-high security environments, organisations should implement Mutual SSL/TLS (mTLS). In standard TLS, Salesforce presents its certificate to the client to verify its identity, encrypting the channel. In a mutual TLS architecture, both the client and Salesforce verify each other's certificates. Administrators upload the client's public certificate to Salesforce and configure My Domain to require mTLS on specific endpoints (e.g., https://mycompany.my.salesforce.com:8443). This ensures that any API request lacking a valid client-side cryptographic certificate signed by a trusted authority is rejected at the network layer, long before authentication is even attempted. For outbound calls from Salesforce to external APIs, architects must configure Named Credentials to securely handle certificates, routing calls exclusively through corporate-approved APIs.

The technical implementation of mutual TLS (mTLS) in Salesforce is extremely robust, leveraging the standard HTTP handshake with certificate exchange. When an inbound request reaches the Salesforce gateway, the client initiates the TLS session. Salesforce presents its platform certificate, and in response, the client must present a valid, unrevoked client certificate. Salesforce validates this certificate against the Certificate Authority (CA) trust store or the specific certificates uploaded under Setup -> Security -> Mutual Authentication Certificates. If the validation succeeds, the gateway populates the MutualAuthenticationStatus of the session. If the certificate is missing or invalid, the session is terminated before any Apex controller or API code executes. For outbound calls, architects must utilise Named Credentials configured with a client certificate, which instructs the runtime engine to automatically attach the cryptographic signature to the outbound request, ensuring that the target external API can verify the identity of the calling Salesforce instance.

4. Strategic Deployment Patterns for Corporate VPNs and Edge Gateways

Implementing strict IP whitelisting in a modern, distributed enterprise poses significant operational challenges. With the rise of remote working, mobile workforces, and cloud-first application architectures, employees and services are rarely confined within the physical walls of a corporate office. Enforcing static IP ranges can inadvertently disrupt legitimate users who connect from dynamic home ISPs, mobile networks, or client sites. To resolve this tension between security and usability, architects must design comprehensive routing architectures using corporate VPNs and edge gateways.

The standard architectural pattern for securing remote access is to channel all Salesforce-directed network traffic through a centralised corporate Virtual Private Network (VPN) or Secure Access Service Edge (SASE) solution, such as zScaler, Palo Alto Prisma, or Cloudflare Gateway. In this model, the remote worker's local machine establishes an encrypted tunnel to the enterprise VPN. All web requests destined for Salesforce are routed through this secure tunnel and egress from the corporate gateway via a designated pool of static IP addresses. Salesforce is then configured to only permit logins from these static egress IPs. If a user attempts to access Salesforce directly from their home network without activating the corporate VPN, the connection is blocked at the profile level.

For mobile applications, architects should enforce Mobile Device Management (MDM) profiles that push pre-configured secure VPN tunnels (per-app VPNs) to corporate mobile devices. This ensures that when the Salesforce mobile app launches, it automatically establishes a VPN tunnel to the corporate network, routing all API requests through the whitelisted egress IPs. For developers and external contractors, organisations should construct dedicated jump hosts or Virtual Desktop Infrastructure (VDI) environments within the corporate network, whitelisting only the VDI gateway IPs in Salesforce. This prevents code or sensitive data from being extracted to personal devices, maintaining an unbroken chain of custody.

5. Login Auditing, Alerting, and Disaster Recovery Protocols

No network security strategy is complete without comprehensive auditing, real-time threat detection, and disaster recovery planning. IP whitelisting is a powerful control, but it is also highly fragile. A single incorrect CIDR block entered during a routine deployment can lock out the entire administrative team, bringing business operations to a complete standstill. Conversely, undetected network compromises can allow attackers to bypass standard identity verification if IP ranges are loosely defined.

To audit network compliance, security teams must actively monitor the LoginHistory object. This object captures detailed metadata for every login attempt, including the login time, source IP address, login type (UI vs. API), client browser details, and the outcome (Success or Failure). System administrators can query this history to locate perimeter violations. The following SOQL query isolates all failed login attempts caused by IP restriction violations, providing immediate visibility into potential attacks or misconfigured integration clients:

SELECT Id, UserId, User.Username, LoginTime, LoginType, SourceIp, Status, ClientVersion 
FROM LoginHistory 
WHERE Status = 'Failed: IP Limit Exceeded' 
ORDER BY LoginTime DESC

To scale this monitoring, architects should integrate these logs with an enterprise Security Information and Event Management (SIEM) system. Using the Salesforce REST API, security tools can continuously ingest `LoginHistory` records and trigger automated alerts when a spike in failed logins originates from suspicious geographic regions or unknown networks. Real-time transaction security policies can also be written to intercept high-volume logins from unusual ranges.

Finally, organisations must establish a robust "break-glass" administrative recovery protocol to mitigate the risk of permanent lockouts. If the corporate VPN suffers a catastrophic outage and all administrators are locked out of Salesforce due to profile IP restrictions, recovery can be incredibly difficult, often requiring manual escalation to Salesforce Support, which can take hours. To prevent this, organisations must maintain a highly restricted "break-glass" admin account. This account must be exempt from profile-level Login IP Ranges, permitting access from the public internet. However, to secure this backdoor, the account must be protected by physical hardware MFA tokens (such as FIDO2/WebAuthn security keys), require complex multi-character passwords that are rotated frequently, and have its credentials split and stored in a secure physical safe. Furthermore, any login attempt on this break-glass account must immediately trigger high-priority SMS and email alerts to the executive security team, ensuring absolute accountability and transparency.

In addition to runtime alerts, the modification of network access controls itself must be audited with maximum scrutiny. Any change to the Org-Wide Trusted IP Ranges or Profile-Level Login IP Ranges represents a critical security event. Salesforce immediately records these actions in the Setup Audit Trail under the manageIpRanges action in the security section. To prevent unauthorised modifications or "shadow whitelisting" (where an attacker temporarily adds an IP range to exfiltrate data and then removes it), compliance teams must build daily audit reports that search specifically for this action. Furthermore, any modification of high-privilege profiles must trigger a real-time notification to the Chief Information Security Officer (CISO), guaranteeing that no backdoor network pathways are established under the guise of routine maintenance.

Key Takeaways

  • Salesforce network security operates as a multi-tiered perimeter, evaluating the source IP address before verifying credentials or session authorization.
  • Understand the critical difference: Trusted IP Ranges exempt users from MFA challenges, while Profile-Specific Login IP Ranges strictly deny access.
  • Always enforce strict Login IP Ranges on the profiles of system administrators and automated integration service accounts.
  • Implement Mutual TLS (mTLS) for high-security integration endpoints to require client-side cryptographic certificates at the network layer.
  • Route distributed user traffic through corporate VPNs with static egress IPs to align remote workforces with strict whitelisting policies.
  • Maintain a secure break-glass administrator account exempt from IP ranges, protected by physical hardware MFA, to prevent permanent lockout.

Checkpoint: Test Your Understanding

Question 1: What is the immediate result if a user tries to log in from an IP address not listed in their Profile's Login IP Ranges?

A. The user is prompted for Multi-Factor Authentication (MFA).
B. The user is prompted to verify their identity via email.
C. The login attempt is immediately denied without offering any verification challenge.
D. The user's password is automatically reset.

Question 2: What is the primary purpose of configuring Org-Wide Trusted IP Ranges (Network Access)?

A. To completely block all inbound API traffic originating outside the specified ranges.
B. To exempt users logging in from trusted corporate networks from identity verification and MFA challenges.
C. To encrypt all data transmitted between Salesforce and the client browser.
D. To automatically log out users when they exit the corporate office perimeter.

Question 3: What security mechanism should be implemented alongside IP whitelisting to protect programmatic machine-to-machine integrations?

A. Standard username and password authentication without HTTPS.
B. Periodic user password resets via automated Apex scripts.
C. Mutual SSL/TLS (mTLS) with client certificate verification at the gateway level.
D. Disabling Single Sign-On (SSO) for all API integration profiles.

Discussion & Feedback