Resources /
Blog

Securing Salesforce API Integrations: Authentication, Rate Limits, and Monitoring

Submit your details to get a book

Min Read
Resources /
Blog

Securing Salesforce API Integrations: Authentication, Rate Limits, and Monitoring

Download

Submit your details to get a book

Min Read

A pipeline service account with broad OAuth scope can access production data without triggering an alert. When logs expire quickly, an audit team can struggle to reconstruct that access. For DevOps engineers managing CI/CD pipelines and compliance managers preparing for audits, those gaps create deployment anxiety and audit exposure.

This article provides a practical framework for securing Salesforce API integrations across three critical dimensions: authentication architecture, rate limit management, and production monitoring. DevOps engineers will gain configuration guidance for the Spring '26 External Client Apps migration, and compliance managers will gain a control mapping for audit preparation.

The threat surface is significant for Salesforce API integrations. Security misconfiguration ranks as the most widespread API vulnerability with severe technical impact in the OWASP API Security Top 10. That risk applies directly to Salesforce integrations that rely on broad OAuth scope, aging endpoints, or weak app configuration. Vulnerability exploitation as an initial access vector increased 34% year-over-year in confirmed breaches. That trend raises the stakes for exposed Salesforce integration paths and service accounts.

Salesforce releases three API versions annually. Integrations pinned to old versions may use deprecated endpoints that lack current security controls. Salesforce API security requires a layered operating model that goes beyond native platform controls.

Why Standard Salesforce Tools Fall Short

Standard Salesforce tools leave gaps across authentication governance, rate limit allocation, and monitoring retention. Those limitations affect every control area covered in this article.

  • Authentication: Salesforce does not enforce OAuth scope boundaries at the organization policy level. Any connected app or External Client App can be configured with broad scope unless administrators restrict it manually.
  • Rate limits: Salesforce API monitoring operates on a volume-threshold model. Alerts fire when daily API limits are approached, but there is no native mechanism to allocate quota per integration or detect when a single workload is consuming a disproportionate share. Credential theft, unauthorized access, and hijacked automation can occur without breaching the daily request limit.
  • Monitoring: Real-time streaming events have only 3-day retention. Connected app identifiers in event logs are not human-readable by default. Compliance teams must map them manually before they can reconstruct data access sequences.

Authentication Architecture for CI/CD Pipelines

Authentication decisions set the security posture for every downstream API operation in a CI/CD pipeline. The right OAuth flow, credential pattern, and app model reduce both access risk and operational drift.

Migrate to External Client Apps

New integrations should use External Client Apps. That shift matters because creation restrictions apply to connected apps as of Spring '26.

Existing connected apps continue to function. Starting with the Spring '26 session ID change, session IDs can no longer be sent in outbound messages. Build all new CI/CD pipeline integrations and server-to-server automations against External Client Apps.

Select the Right OAuth Flow

For CI/CD pipelines and headless automation, the JWT Bearer Flow authenticates by signing a JSON Web Token with a private key. No shared secret is transmitted. That makes it more secure than the Client Credentials Flow. Configuration requires uploading a digital certificate to the External Client App. It also requires setting Permitted Users to "Admin Approved Users that are pre-authorized". Assign the integration user an API Only User restriction.

Store the Consumer Key as a CI/CD environment variable. Never hardcode credentials. Use a dedicated integration user license for service accounts rather than full Salesforce licenses.

Manage Token Lifecycle

Token handling directly affects the security posture of every integration credential. Use the following documented practices:

  • Request one token per 20 minutes
  • Cache and reuse tokens until near expiry
  • Refresh proactively 5 minutes before expiry using the expires_in value
  • Store refresh tokens on external servers and keep access tokens in memory only

Token rotation and secret updates require coordinated operational processes across downstream integrations. That gap creates risk for organizations with rotation policies mandated by security frameworks.

Managing Rate Limits Without Breaking Integrations

Rate limits are a shared capacity problem, not an integration-specific guardrail. Teams need allocation discipline and retry controls so one workload does not starve another.

The daily API request limit is a shared pool that covers REST, SOAP, and Bulk APIs within a rolling 24-hour period. Understanding the allocation model helps teams plan capacity effectively. These strategies apply to routine operations and peak-load scenarios.

The allocation formula for paid editions is 100,000 base calls plus per-license allocations plus purchased add-ons. An Enterprise Edition organization with 15 Salesforce licenses receives 115,000 requests per day. Production organizations have a limit of 25 concurrent requests that exceed 20 seconds.

Implement these strategies to stay within limits:

  1. Use Composite Requests to bundle multiple operations into a single API call, reducing round-trips against the daily pool
  2. Use Bulk API 2.0 for operations exceeding 2,000 records instead of issuing thousands of individual REST calls
  3. Implement exponential backoff with jitter on retries to prevent thundering herd failures
  4. Read the limit header returned on every REST API response for real-time consumption data without consuming an additional API call
  5. Finish query pagination promptly, but note that current Salesforce API documentation states there isn't a limit on the number of open query cursors per user

Configure API notifications at configurable percentage thresholds using the same limit-monitoring endpoint. Plan capacity with project teams before deploying new large integrations. Purchase additional API calls in 10,000-per-day increments when necessary.

Limit headers and API notifications provide consumption visibility, but they do not capture the full picture of what integrations are doing in production. That requires a dedicated monitoring program.

Building a Production Monitoring Program

Production monitoring requires multiple Salesforce mechanisms plus external retention. That combination supports both near-real-time detection and later investigation.

Shield Event Monitoring

Shield Event Monitoring provides access to 80 event types across three modes:

  • Core Event Monitoring delivers batch log files with hours of latency
  • Real-Time Event Monitoring surfaces approximately 20 additional event types via Streaming API
  • Event Log Objects (Beta) apply 15-minute latency for Hyperforce customers only
  • Example: Stream ApiEvent and LoginEvent types in real time to detect unusual service account activity, then correlate with batch logs for full request history

Transaction Security Policies

Transaction Security Policies enable automated responses to specific events:

  • Configure one policy per event using either the Condition Builder or Apex
  • Policies can block actions, require multi-factor authentication, or send notifications
  • Example: Block report exports that exceed 1,000 rows and notify the security team when triggered

Login Forensics and Analytics

Login Forensics via the LoginEvent object supports detection rules, and the Analytics app in CRM Analytics provides visualizations for performance troubleshooting and security incident analysis:

  • Define detection rules based on login frequency, source IP, and user lists
  • Use CRM Analytics dashboards to visualize login patterns and identify anomalies
  • Example: Alert on five failed login attempts within three minutes for users on a VIP list

Log Field Coverage

NIST SP 800-228 specifies minimum API log fields:

  • Timestamp
  • Client ID
  • Request/response status
  • Endpoint identifier

Use those fields to assess whether Salesforce Event Monitoring output covers the records needed for API investigations.

Compliance Requirements for API Security

API security controls map directly to audit requirements, so teams should document them against the frameworks auditors already use. A consolidated view reduces rework during reviews.

Four frameworks apply most frequently to Salesforce API integrations:

  • NIST SP 800-53 Rev. 5 controls IA-2 and IA-8 govern authentication controls for both human users and external system service principals. AC-6 mandates least privilege. That directly governs OAuth scope restriction in Salesforce integrations.
  • HIPAA 45 CFR §164.312 requires security controls for any API endpoint accessing ePHI in Salesforce Health Cloud.
  • GDPR Article 25 mandates privacy by design, requiring API responses to minimize personal data fields from inception. Article 32 requires ongoing testing and evaluation of security measures.
  • SOX Section 404 requires effectiveness assessments of controls over financial reporting, including role-based access control and secure development lifecycle practices per SEC documentation.

These frameworks all emphasize auditability and ongoing monitoring. Because native retention varies by mechanism, the external log pipelines described in the monitoring section above are essential for meeting these frameworks' auditability requirements.

Closing API Security Gaps Across Salesforce Environments

Connected app deprecation isn't a future concern — it's a migration already underway. Every integration still running on legacy patterns accumulates technical debt that compounds with each Salesforce release cycle and widens the gap auditors will scrutinize.

The organizations that move first gain a structural advantage: tighter OAuth scopes, predictable rate limit governance, and monitoring pipelines that satisfy auditors before they ask. Those who wait inherit a backlog of credential remediations, quota firefighting, and compliance gaps that only grow more expensive to close.

The framework in this article gives you the controls. What's left is operationalizing them across every deployment. Flosum embeds policy enforcement, metadata automation, and audit trail generation directly into your Salesforce deployment workflows — so security controls ship with your code, not after it. Complete change documentation means your next audit starts with evidence already in place. Request a demo with Flosum and see how that works before your next release window.

FAQ

What is the safest Salesforce authentication approach for CI/CD pipelines?

The JWT Bearer Flow is recommended for CI/CD pipelines and headless automation. It authenticates using asymmetric key signing, eliminating shared secret transmission across the network.

Why are Salesforce API limits difficult to manage across integrations?

Salesforce allocates API requests as a shared pool across all integration types without per-app quotas. Without native allocation controls, any single integration can consume capacity needed by others.

How long are real-time monitoring events retained?

Real-time streaming events have 3-day retention in Salesforce. That short window is why teams often send logs to external systems for longer-term investigation.

What should compliance teams document for API security?

The article maps API security controls to applicable frameworks. Core areas include authentication, least privilege, auditability, monitoring, and documented change control.

How does Flosum fit into this process?

Flosum embeds security and compliance controls directly into Salesforce deployment workflows, including automated pipelines, policy enforcement, and audit trail generation. Those capabilities help standardize controls across Salesforce environments.

Table Of Contents
Author
Stay Up-to-Date
Get flosum.com news in your inbox.

Thank you for subscribing