Skip to content

Check tenant isolation in a SaaS application

A concrete test plan for data access, exports and background jobs across separate customer contexts.

Nora Henning2 min read
Divided tray with pink and green card stacks in separate compartments.

Define the customer context first

A tenant is a separate customer context in your application. It need not be one person or always an entire company. Define which data belongs together, who can be a member and which tasks each role may perform there. One user account can have several memberships; signing in alone does not select an authorised data scope.

Microsoft distinguishes a logical tenant from a technical deployment. A dedicated database and shared tables create different operational and access-control requirements. Neither option replaces checking every intended access path.

A test plan with two fictional customer contexts

Plan the following cases with synthetic data in a separate test environment. These are expected results, not a completed security test. The contexts are named TA and TB. Job SV-12 belongs to TA; job SV-41 belongs to TB. Each test account has the intended job permissions only in its own context.

Access under test

Action

Expected result

Authorised account in TA

Read SV-12

Only its own job data permitted for this role appears.

The same account in TA

Read or change SV-41 directly, or retrieve its attachment

No data from TB is returned or changed.

Account in TA

Search and export

Results and file contain no data from TB.

Account from TB, then account from TA

Use the same server-side cache access path

TA receives no results previously stored for TB.

Account in TA

Queue an export, revoke access before processing

The background job checks again and is rejected under this test rule.

Check data and actual changes on the server. A hidden button does not demonstrate isolation. Also use a known object identifier from another context: a hard-to-guess identifier must not be the only access barrier.

Carry the boundary through the whole workflow

OWASP calls for server-verified tenant context and appropriate authorisation. Context identifiers sent by a client are selectors, not permissions. Check current membership, the permitted action and ownership of the target object. If required context is missing, the application must not fall back to an unrestricted query.

Include attachments, tenant-dependent cache keys, exports and delayed processing. Background jobs need trustworthy propagation of context and authorisation, with appropriate checks during processing. Define how rights revoked in the meantime are handled.

Public, global content does not need an artificial tenant requirement. Cross-context platform tasks do need an identity explicitly authorised for them and traceable access. Record the expected result, actual finding and correction separately for each case. Repeat affected checks when access paths or roles change.

Sources

Written by

  • Nora HenningEditor for IT SecurityNora Henning looks after the editorial content on IT security at ASES. She writes about application security and explains how access rights and the protection of company data are connected.

Follow ASES

Read more

All articles

Software Development with ASES

Custom software, web and mobile apps