Resources /
Blog

How to Prevent Salesforce Data Loss: 8 Controls, Cause by Cause

Submit your details to get a book

8
Min Read
Resources /
Blog

How to Prevent Salesforce Data Loss: 8 Controls, Cause by Cause

Download

Submit your details to get a book

8
Min Read
Shield with a check mark linked to database and warning tiles, illustrating ways to prevent Salesforce data loss
Shield with a check mark linked to database and warning tiles, illustrating ways to prevent Salesforce data loss

To prevent Salesforce data loss, pair each common cause with two controls: a Salesforce setting that stops it, such as scoped permissions, validation rules or MFA, and one that limits the damage, such as field history and an off-platform backup. Most incidents start inside the organization on an ordinary Tuesday, with Data Loader columns off by one, a dropped field or an over-permissioned integration user.

This guide is for Salesforce admins and architects who want to protect Salesforce data before anything has to be restored. It takes eight common causes and walks through the settings behind both controls.

Why is securing your Salesforce data your job and not Salesforce's?

Salesforce backs up its own platform under the shared responsibility model. Data security inside your organization, from protecting records to deciding who gets to change them, is on you, so a bad import is your incident, not theirs.

If you want the why, our post on the common causes goes into it. Program planning for security and compliance leads, data classification and encryption included, lives in our data protection best practices guide.

Which Salesforce control stops each cause of data loss?

Every row in the table pairs a cause with two layers of control, one that makes it less likely and one that limits the impact when it occurs anyway. The setting paths for each come right after.

Cause of data lossWhat it looks likeControl that prevents itControl that limits the impact
1. Bad Data Loader jobAn update overwrites a field on thousands of recordsAPI Enabled only for named users, validation rules on key fieldsField History Tracking and an export taken just before the load
2. Mass deleteA user deletes records that looked like duplicatesDelete object permission and Modify All Data kept to a short listRecycle Bin and Data Loader Export All
3. Deployment removes a fieldA release deletes a field or changes a flow in productionSandbox testing and a validation deploy before releaseA metadata snapshot taken before the release
4. Integration overwrites dataA sync with an incorrect mapping runs every nightA dedicated integration user scoped to what it writesField history on whatever it syncs and a watch on API usage
5. Migration mistakeChild records land on the wrong parentsExternal IDs and a rehearsal in a sandboxA snapshot of the affected objects before cutover
6. Faulty automationA trigger or flow updates records it shouldn't touchApex tests and sandbox testing with realistic dataField history and a restore point from before the release
7. Malicious insiderA leaving employee exports or deletes recordsTight access controls, with View All Data and Modify All Data reviewedSetup Audit Trail exports and Event Monitoring (Shield)
8. Compromised accountA stolen login is used to export or change dataMFA, security keys for admins and login IP rangesShort admin sessions and an off-platform backup

How do you set up each control in your Salesforce environment?

Start with the rows that look like your last incident or near miss, since those are the ones you already know can happen. Only the Salesforce Shield security tools cost extra.

1. Bad Data Loader jobs

Data Loader talks to the API, and anyone holding API Enabled can call any Salesforce API at all.

Keep that permission in a permission set assigned to the people who run loads, not on a profile everyone shares. Add validation rules where a value should never be blank or out of range, so a bad row fails on insert or update instead of saving.

For recovery, turn on Salesforce Field History Tracking for whatever your loads touch most. Standard tracking covers 20 fields per object for 18 months, and an export taken right before the load gives you a clean file to restore from.

2. Mass deletes

Be stingy with Delete, an object permission in the Salesforce data security model, and stingier still with Modify All Data. That one gives full write access to all records regardless of sharing, and it can restore records deleted by anyone.

Deleted records sit in the Salesforce Recycle Bin for 15 days by default, or 30 if Support activates Extended Recycle Bin Retention. To catch soft-deleted rows, use Data Loader's Export All, which includes soft-deleted records.

Get what you need back before that window closes. Our blog post on Recycle Bin retention explains how to do it.

3. Deployments that remove a field

Delete a field and its values go with it, recoverable from Deleted Fields for only 15 days, and anything that still depends on it, from reports to integrations, can break. Test every release in a sandbox first, then run a validation deploy against production.

Right before each release, export your metadata and commit it to version control, so you can see exactly what changed. The commands are in our guide to backing up metadata.

4. Integrations that overwrite data

Secure each integration with its own login-restricted user, scoped to what it writes. Because field-level security and sharing still apply over the API, a sync can't overwrite anything it can't edit.

Review the OAuth access of your Salesforce connected apps as well, because a compromised token inherits the app's permissions. Track history on synced fields, and keep monitoring the daily API pool for sudden spikes.

5. Migration mistakes

Bad ID mappings are a common migration error, and they attach child records to the wrong parents. Hold each source ID in a unique custom External ID field and children can be matched on it.

Rehearse the full load in a sandbox, then export the affected records before cutover. Load order is in our migration best practices, and Data Migrator handles moves between orgs.

6. Automation errors

One bad condition in a trigger or flow can quietly update every record it touches. Before go-live, test automation in a sandbox environment with production-like data, edge cases included.

Apex comes with a safeguard built in: production deploys need 75% org-wide test coverage. But coverage only proves the code ran, so write assertions that check the records it shouldn't touch come out unchanged.

7. Insider threats

Least privilege first: find non-admin users with View All Data or Modify All Data and strip whatever they don't need. Freeze the account the day someone hands in notice.

Setup Audit Trail only holds 180 days of configuration changes, so export it on a regular schedule. If you have Salesforce Shield, Event Monitoring tracks logins and API calls, and our post on internal threats covers backup design for insider risk.

8. Compromised accounts

Multi-factor authentication (MFA) has been required for direct Salesforce logins since February 1, 2022. Salesforce now also enforces phishing-resistant MFA (passkeys or security keys) for admins and other privileged users, so turn those methods on under Setup > Identity Verification.

Set Login IP Ranges on the admin profile so a stolen password can't be used from off-network. Shorten admin session timeouts, too, and lock integration users to set IP ranges and hours.

If unauthorized access happens anyway, your audit logs show what changed. A copy kept off the platform puts it back.

What catches the problems your controls miss?

Controls only reduce the risk. Someone with the right permissions can still make a bad change, and then you restore from backups, meaning copies of data and metadata stored outside the org.

Our data protection guide covers Salesforce backup best practices, and the post on what a backup solution should cover sets the scope. Tie both back to your backup and recovery strategy and your retention policies.

How often should teams review these security controls?

Permissions drift as people change roles. Once a quarter, list everyone with Modify All Data, View All Data, API Enabled and Delete on key objects, then compare that with who actually needs it.

Check field history tracking, connected app tokens and your last restore drill too. Our guide to testing a disaster recovery plan covers the drill, and risk and governance shows the release side of Flosum.

Where does Flosum fit?

Flosum Backup & Archive backs up records, metadata, files and attachments, with granular point-in-time restore at field, record or full-org level. That's most of the "limits the impact" column covered.

Flosum's deployment options page covers where each app runs. Backup & Archive is a Flosum Cloud App, hosted by Flosum or kept in your own AWS, Google Cloud, Azure or private cloud.

FAQs

What's the first control to set up?

Pick the cause behind your last incident or near miss and set up its two controls first. With no history to go on, narrow who holds API Enabled, Delete and Modify All Data, the permissions behind bad loads and mass deletes.

Does Salesforce protect my data from being deleted?

Only partly: deleted records stay in the Recycle Bin for 15 days, or 30 with Support's help. Beyond that, the shared responsibility model makes protecting your org's data your job.

Which permission causes the most data loss risk?

Modify All Data. It gives full write access to all records regardless of sharing, can restore anyone's deletions, and belongs with a few admins whose list you review quarterly.

Can validation rules prevent data loss?

They block bad values from saving, on API inserts and updates too, though a wrong value that looks valid gets through, and so does a delete. So pair them with field history and a backup.

How do you prevent data loss from integrations?

Give each integration its own user, limited to the objects and fields it writes, since field-level security still applies over the API. Then track history on synced fields and watch API usage for spikes.

Is MFA enough to stop account takeover?

It's the floor: Salesforce has required it for direct logins since 2022, and now requires phishing-resistant MFA, such as passkeys or security keys, for admins and other privileged users. Add login IP ranges too.

Do I still need backups if these controls are in place?

Yes, because controls only make data loss less likely. Someone with the right permissions can still make the wrong change, and you'll only restore it from a backup outside the org.

Book a demo to see a field-level restore in Flosum Backup & Archive.

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

Thank you for subscribing

Ship Salesforce changes faster
Teams on Flosum report 40% higher development velocity and 75%
fewer merge conflicts.
Free to start  |  No credit card required