Threat modeling a Salesforce integration means mapping what the integration can reach, who or what can call it, how data moves across each hop, and what happens when a step fails. Do this before any connection is built, then turn each finding into a control with a named owner.
Scope the integration before drawing the diagram
Start by naming the two systems, the direction of each call, and the business event that starts the flow. An integration that pushes order records on a nightly schedule has a different threat surface from one that reacts to a record change in real time, or from one that exposes an endpoint that outside systems call. List the objects, fields and actions the integration touches, and mark the ones that hold personal or financial data. Anything left out at this stage tends to show up later as an unreviewed side channel, so state the boundary plainly: which team owns each end, and where responsibility passes from one side to the other.
Capture what the integration is allowed to change, not just what it reads. A sync that creates contact records has a much smaller blast radius than one that can reassign record ownership, delete rows, or start an approval. Write permissions define the worst case in your model, because a compromised integration can do whatever its credentials allow.
Scope also decides where you test. Run the flow against a sandbox that mirrors the production configuration before you rely on the model, and plan how often that sandbox is refreshed. For planning the refresh cycle, see sandbox refresh planning.
Map identity for each caller in the flow
Identity is where many integration problems begin, so model it early. For each flow, identify who or what authenticates: a dedicated integration user, a connected app acting for a person, a middleware platform, or a service account in the other system. Each identity needs a clear answer to three questions. How does it prove who it is? What can it reach once inside? How would you notice if it were used from somewhere unexpected?
Give each integration its own integration user rather than a person’s login. Because that user has its own permission set, its access can be limited to the objects and fields the flow needs, and its activity can be audited apart from human activity. For outbound calls, keep credentials in named credentials instead of hard-coded values or ordinary configuration. For API authentication, favor OAuth 2.0 or JWT over reusable static secrets. Record the login constraints as part of the model too, including any IP ranges and login hours that apply to the integration user.
Start the permission set from nothing and add object, field and record access where the flow needs it. A common gap is an integration user that picked up broad access during build or testing and kept it after go-live. Put that user on the same access review cycle you use for people, and tie each review back to the flow’s entry in your model. For a method of building those sets, see permission set design for small teams.
Trace data across each hop and storage point
For each hop, write down what data crosses it and which path it takes. Include middleware, message queues, file drops, staging tables, and any spreadsheet an operator downloads to check a run. Data exposure often happens at a hop nobody drew, so walk the full route from source to destination and back again.
At each point, check three things. Confirm the traffic is encrypted in transit, using TLS for HTTP calls and the equivalent for file transfer or messaging. Decide where the data rests after it arrives and who can read that store. Then check logs, because request and response bodies often end up in debug logs, middleware dashboards, or error notifications, and those copies are easy to forget. Decide which fields must be masked or left out of logs before the flow goes live.
Classification changes the answer. Fields holding personal or payment-related information need field-level controls, so the integration user should not read fields the flow does not use. Check object, field and record-level security together, and check masking wherever the data appears in a view. If the receiving system has weaker controls than the sending system, the weaker one sets your real risk, so the model has to cover both ends.
Model failure modes and hostile inputs
A threat model should describe failure, not only the happy path. For each flow, ask four questions. What happens if the remote system is down for an hour? What happens when it returns a malformed payload? What happens when the same message arrives twice? What happens when a crafted value reaches a formula, a query, or a line of custom code?
Validation and custom code are part of the attack surface. Apex that runs in user mode applies the running user’s object and field permissions in code, which limits what a crafted input can reach. Where a handler builds a dynamic query from an inbound value, treat that value as untrusted and bind it rather than concatenating it into the query string. Write these as design requirements so developers see them before they write the handler.
Records that fail validation are a normal part of integration traffic, and the model should say how they are handled. A rejected record may need to go to a queue, return an error to the caller, or raise an alert, and each choice has different consequences for the other system. For the rules that tend to cause this, see validation rules without breaking integrations. Limits matter too, because a retry loop can push a flow into platform limits and affect other work in the same org. Review governor limits for admins before you set retry counts.
Retries and duplicates need a plan. A message retried without an identity check can create a second record or repeat an action such as sending a notice. Decide how each flow recognizes a repeated message, what it does when it sees one, and who gets alerted when the flow stops. Recovery belongs in the model as well. Restoring data after loss or corruption usually falls to your team rather than the platform, so name the person who runs that restore and test the procedure before you need it.
Turn findings into controls with named owners
A threat model is only as good as its follow-up. Record each finding as a row in a simple register: the flow, the risk, the control, and the owner. The control should be something you can check, such as a named credential, a narrower permission set, an IP restriction on the integration user, a field removed from logs, or a duplicate check in the handler.
Use the following list as a go-live gate. A flow is ready when:
- Each side of the flow has a named owner who signed off on the scope.
- Each identity has its own user or credential, with the smallest permission set that works.
- Each hop is encrypted in transit and has a documented storage location.
- Logs exclude the fields classified as sensitive.
- Malformed, rejected, and duplicate messages each have a defined response.
- Someone has tested the restore plan for the data the flow writes.
Monitoring closes the loop. Turn on the event and audit logging your edition and licenses support, and forward those logs to your security information tool if you run one. Agree on alerts before launch, such as a login from an unexpected network range, a sudden jump in API calls, or a permission change on the integration user. Without signals like these, the model records what you intended but cannot show whether the controls still work.
For help planning this work, see Salesforce implementation.
Questions about threat modeling Salesforce integrations
How long does a threat model for one integration take?
For a single flow with one identity, a working session with the owners of both systems usually produces a first version. The longer part is collecting the facts the session depends on, such as the fields in scope and the credentials in use, so gather those before the meeting.
Does a read-only integration need a threat model?
Yes. A flow that only reads can still expose personal data, especially when the integration user can see fields it does not need, or when the data is copied into logs or a downstream store. The read side of the model is often shorter, but identity, transit, and storage still need review.
Can the integration run under an administrator’s login during testing?
Testing under a personal login hides the access the integration will actually have, so the results can mislead. Build and test with the dedicated integration user and its intended permission set from the start, so the tests reflect the production setup.
Who should join the modeling session?
Include the developer who builds the flow, the Salesforce administrator who manages permissions, the owner of the other system, and whoever handles security or privacy questions in your organization. Someone from the team that runs support for the integration should also attend, since they will see the failure modes first.
When should the model be reviewed again?
Review it at go-live, when the scope changes, when a new object or field joins the flow, when permissions on the integration user change, and when credentials are rotated. Note the review date in the register so the next owner knows when the last check happened.