DaletGuard supports civilians affected by armed conflict through Families Beyond War. All sides, no political affiliation. About our humanitarian work

CRM Data Isolation in Multi-Tenant Products

CRM data isolation means that one customer can never read another customer's records, even through a bug in your code. In DaletPipe the database enforces that rule with row-level security, forced on every tenant table and set for each request. Three database roles and nine capabilities add further layers around that core, and every call is checked on the server. This article walks through each layer, shows where a team can go wrong and names the checks for each mistake. Read it as a review checklist, and ask your team to show each control working against two separate test tenants.

Why is CRM data isolation harder than it looks at first?

A CRM integration layer holds tokens and reads every customer's contacts, deals and notes. In fact, one missing filter in one query can show a customer another customer's data. The damage is large, and the cause is often a single line.

Read each claim with care. Test each claim on your own data.

Design crm data isolation in layers so one bug cannot expose a customer. Also, a capability check runs in the API on every call.

Application code alone is a weak guard. Developers forget filters, new routes skip middleware and support tools reach into the database. Thus, a strong design makes the database refuse the wrong query, whatever the code asks for.

What risks must a layered plan cover for a tenant?

Four risks matter most for a CRM layer.

Keep crm data isolation notes next to the database roles.

Ask how crm data isolation is enforced when you compare vendors. Notably, a failed location check returns not found.

  • A caller reads rows that belong to another tenant.
  • A caller acts on a connection in another location.
  • A browser receives a provider secret.
  • A forged webhook body is accepted.
Illustration of lock, shield, people for crm data isolation
Key takeaway

CRM data isolation works in layers. The database, the capability check, the location check and the secret store each stop a different mistake.

How does row-level security guard the data of each tenant?

Every tenant table has row-level security enabled and forced. Indeed, each request opens a session and sets the current tenant as a database setting. The database then filters every query by tenant, whatever the application code asks for.

Keep your own notes for later. Ask for the code behind each claim.

Each step is recorded with its date.

Each route declares the capability check that it needs.

Review the worker role with extra care.

The API connects with a role that is not a superuser and cannot bypass row-level security. Also, a superuser or a bypass role would bypass isolation without a sound. DaletPipe checks the role at startup and logs a critical message if it finds one that bypasses the policy.

Which three database roles split the duties in this system?

The owner role runs migrations. Likewise, the restricted API role serves requests and stays bound by row-level security. A separate worker role can see across tenants so that schedulers can find due work.

Strong crm data isolation makes the database refuse the wrong query. Overall, each route declares the capability check that it needs.

Production mode requires a dedicated worker database URL when workers are on. Moreover, the cross-tenant view exists to list work and not to read customer data freely. Tenant work done by a worker still runs inside a tenant-scoped transaction.

Why does a worker role need extra care in review?

It is the one role that crosses tenants, so a mistake there matters most. Review which queries it may run and which tables it may touch. Test that no customer data path uses it.

Short checks beat long debates. Write down what you find.

Design crm data isolation in layers so one bug cannot expose a customer.

Write crm data isolation tests into the release checklist. In fact, a location check compares the connection with the caller.

How do capability checks limit what each caller can do?

The API recognizes nine capabilities, such as connections read, connections write, sync run and records read. Indeed, each tenant data route declares the one it needs. Also, the server refuses a call without it. Also, a caller with an unknown capability name is rejected outright.

A failed location check returns not found.

A capability check runs in the API on every call.

These checks run in the API. Therefore, a modified interface cannot grant itself wider rights. Roles such as analyst or auditor are built by combining capabilities in your own host and not inside DaletPipe.

DaletPipe connections list screen
For example, the connections list screen of DaletPipe.

How do location checks narrow what a caller may see?

Every new connection requires an exact commercial location. Thus, on each call, the server compares that location with the caller's granted locations. Only a caller with the all-locations capability skips the comparison.

Share the result with your team. Check the facts again each quarter.

Test crm data isolation with two tenants before every launch. Indeed, a capability check runs in the API on every call.

A mismatch returns not found and not forbidden. Therefore, a caller learns nothing about records outside its scope. Besides, the same check covers sync runs, records, mappings, receipts and evidence. The user interface offers hints, and hints are not authorization.

How are provider secrets kept out of reach of browsers?

DaletPipe stores no CRM secret. A connection holds coordinates that point to DaletAuth, and tokens come from DaletAuth when a call needs one. Likewise, they are cached briefly with a 60 second safety margin. Also, the browser never receives a provider secret.

Every change is reviewed by a second person.

Row-level security filters every query by tenant.

Share crm data isolation results with security reviewers. In addition, a failed location check returns not found.

Outbound webhook secrets are sealed with AES-256-GCM before storage. Also, the sealing key comes from a deployment setting. A sealed value cannot be moved to another subscription.

The reason is that the tenant and subscription are bound into it. In fact, use a different secret for each subscription.

Which guards in production refuse a risky setup at start?

Production mode validates its own configuration at startup. It refuses wildcard origins and wildcard trusted hosts, a placeholder DaletAuth key and workers without a dedicated worker database URL. Interactive API documentation pages are not served.

Plain words help every reviewer. Small steps are easy to audit.

Each route declares the capability check that it needs.

Illustration for CRM Data Isolation in Multi-Tenant Products

How do you test CRM data isolation with two tenants?

Create two tenants with one connection each, in different locations. Call every route with tenant A and ask for the identifiers of tenant B. Indeed, every answer should be not found. Also, the database should return no rows when you query it as tenant A.

Review crm data isolation again after every migration. Also, a location check compares the connection with the caller.

Repeat the test for each capability and for a caller with narrow locations. Thus, write the results in your review file with the date. Run the test again after every migration and every change to the worker role. Treat crm data isolation as a release gate.

Which parts does a product team supply around this design?

Clear crm data isolation claims name who owns each part. DaletPipe provides nine capabilities, and you build roles such as analyst or auditor from them. Besides, the in-house DaletGuard CRM embeds the workspace as a separate host.

Ask one person to own each check. Record every answer in writing.

Therefore, your own product supplies its user interface and the tenant headers. Also, confirm the controls on your own test tenants.

The worker role sees across tenants to find due work.

The worker role sees across tenants to find due work. Likewise, a location check compares the connection with the caller.

The security controls page lists each control in full. In addition, the build or buy guide shows how isolation weighs in the choice of a path. Also, the credential custody article explains how DaletAuth keeps provider keys.

A diagram of 3 connected steps, each with a small drawing: Row-level security, Worker role, Capability.

What questions do readers ask about this topic most often?

Does row-level security replace checks in application code?

No, it is the last line of defense, and the application still checks capabilities and locations. The layers work together, so a bug in one layer does not expose data.

What can the worker role see?

It sees across tenants so that schedulers can find due work. It exists to list work, and tenant work done by a worker still runs inside a tenant-scoped transaction.

Why does a location mismatch return not found?

A forbidden answer would confirm that the record exists. A not found answer tells the caller nothing about records outside its scope.

How should our team confirm the security controls?

The controls are described against the code, and your team confirms them on two test tenants before launch.

See how DaletPipe fits the providers your team uses today

Book a short meeting for a walkthrough with your own providers in mind, or join an in-person class to learn the method first.