Table of contents

A customer signs in, opens a report and downloads a spreadsheet. The feature works. The security question is whether that same customer can request someone else’s spreadsheet by changing a record identifier—or receive it because a shared cache returns the wrong result.

For a SaaS business, that boundary matters to customer trust, incident response and the ability to explain how customer information is protected. Encryption and a private database help protect the infrastructure. They do not decide which customer may see a particular invoice.

Start with one customer-sensitive workflow.

Trace it from the initial request to the final download. At each step, identify who makes the access decision and what evidence proves the decision works.

The customer boundary is a product promise

A tenant is the customer organization or other unit whose data and permissions your product separates. A person may belong to several tenants; an administrator may have narrower permissions than their title suggests. Your authorization model must express those relationships explicitly.

Authentication establishes who is calling. Tenant authorization determines whether that identity may perform this action on this customer’s resource. A tenant ID in a URL or header is a selection to validate, not proof of access. OWASP recommends binding tenant context to verified identity and current membership or service authorization. [1]

Make the rule concrete: a caller needs permission for the selected tenant, the requested operation and the target object. Reject missing or invalid context. An opaque object ID can make guessing harder, but it cannot replace those checks.

Follow one export through the product

Consider a hypothetical reporting product used by Customer A and Customer B. A user from A requests an export. The API queues a job, a worker queries records, stores a file and returns a download link. The following review plan is an illustrative engineering recommendation, not a description of a deployed customer environment.

Where a customer boundary can fail
BoundaryFailure to look forControl to verify
APIThe user can substitute B’s report ID.Authorize the object and action within A’s verified context; cover reads, writes, lists and bulk routes.
DatabaseOne query omits the tenant constraint.Constrain data access centrally and consider database policies as another layer; check the actual runtime role.
CacheA shared report key serves B’s result to A.Authorize before cache access. Scope keys by tenant and, when needed, user or permission context.
WorkerA retry runs with missing or stale context.Authenticate producers, validate tenant scope and authorize the worker operation; carry context through retries.
File downloadA caller requests a link for another tenant’s file.Authorize the exact object before signing. Restrict method and lifetime; define revocation behavior.
Support toolingA global service account becomes a shortcut.Separate privileged workflows, constrain the selected tenant and record attributable access.

These boundaries remain relevant even when each component uses the same cloud account. A cache prefix or storage directory organizes data; enforcement still depends on authorization and the permissions behind it. OWASP covers these application, cache, messaging and storage failure modes. [1]

Do not lose the decision in the queue

The worker should know which tenant it is operating for, who or what requested the operation, and which action was authorized. A tenant ID inside a message is insufficient if an unauthorized producer can publish that message.

Decide what should happen when a user loses access while an export is waiting. For a user-requested sensitive export, a sensible design is to check current permission before execution and again before granting download access. System-owned scheduled work may need a different service policy. Document that distinction and test it.

Export lifecycle: authorize request, validate worker scope, constrain output, authorize delivery. Revocation must be considered while work is waiting.
Original export review model. Each checkpoint has its own enforcement responsibility. Open full-size diagram.

A signed download link is a bearer capability: someone holding it may be able to use it until it expires or another control invalidates it. Rechecking membership when issuing the link does not automatically revoke an already-issued link. Choose expiry and delivery mechanisms that match the sensitivity of the export.

Choose a boundary your team can operate

Isolation can use shared resources with policy enforcement, dedicated resources, or a combination. AWS’s SaaS isolation guidance describes multiple strategies rather than a single universal architecture. [2] Choose based on data sensitivity, customer commitments, operational capacity and the consequences of a mistake.

Architecture choices and their operating costs
ModelWhat it can provideWhat your team still owns
Shared tablesEfficient shared infrastructure with row and application policies.Policy coverage, trusted context, pooled-connection handling and negative tests.
Separate database or accountAdditional resource and credential boundaries.Provisioning, migrations, backups and restrictions on shared administrative paths.
HybridDedicated resources for selected workloads or customer requirements.An explicit map of which data uses which boundary, including shared supporting services.
PostgreSQL row-level security needs the right role.

PostgreSQL documents that superusers and roles with BYPASSRLS bypass row security; table owners normally bypass it too. FORCE ROW LEVEL SECURITY subjects an owner to policies, but does not constrain superusers or BYPASSRLS roles. Check the role used by the running application, not just a development test. [3]

When policies depend on connection context, establish it for each transaction and ensure it cannot leak into the next customer’s work through a reused connection. Test inserts and updates as well as reads. Database policies also do not protect a file already copied into object storage or a cached response outside the database.

Availability belongs in this review too. One tenant’s large export should not exhaust the worker fleet for everyone else. Set limits at the bottleneck—queued work, concurrent jobs or database connections—and test representative load. Per-tenant limits should work alongside overall service limits.

Prove the boundary with two test customers

Create two synthetic tenants with distinct records in an authorized test environment. Add a second user with fewer permissions inside Customer A. That tests both separation between customers and permissions within one customer. Pair every rejection test with an allowed operation so a completely broken feature cannot pass as a secure one.

Suggested regression tests for an export workflow
TestExpected evidence
Use A’s identity with B’s object ID.No B data in the response, export or side effects; the allowed A request succeeds.
Change tenant selectors in headers, path and payload.The server validates membership and rejects unauthorized selections consistently.
Warm the cache as B, then request as A.No cross-tenant cache hit; appropriate user-level restrictions also hold.
Remove tenant context from a job; replay or retry it.The worker rejects invalid scope without falling back to an unscoped query.
Revoke access while an export waits.Execution and delivery follow the documented revocation policy.
Reuse a pooled connection after B’s transaction.A cannot inherit B’s context; missing context fails closed.
Request B’s download link as A.The signing endpoint rejects it; no usable link or protected metadata is returned.
Run a large A export alongside B’s normal work.B stays within the agreed performance target under the tested load.

Retain the build identifier, test identities, expected decision and observed result. Check response bodies, generated files and unintended writes—not only status codes. Record enough tenant, actor and decision context to investigate a failure, while keeping tokens and sensitive document contents out of logs.

Add these cases to the release checks for the workflow. Extend coverage when a new API, cache, worker or integration changes the path. Passing this matrix is evidence for the tested paths and conditions; it does not establish that every possible access path is secure.

Your tenant-isolation checklist

Use this in a product and engineering review. Check a box when you can show evidence. Selections are local to this page and are not saved or submitted.

Evidence to bring to the review
Make the next review small enough to finish.

Pick one export or download path. Assign an owner, draw its boundaries and add the first cross-tenant regression test. Then follow the same method through the remaining sensitive workflows.

For a broader view of operating product security, read Your product runs your business. What keeps it secure? To discuss a scoped review, explore Truva’s security services.

Sources

Primary documentation reviewed 28 October 2026. Diagrams, review tables and test scenarios are original illustrative guidance based on these sources.

  1. OWASP, Multi-Tenant Application Security Cheat Sheet: tenant context, authorization, cache, storage, worker and resource boundaries.
  2. AWS, SaaS Tenant Isolation Strategies: isolation choices for shared and dedicated environments.
  3. PostgreSQL, Row Security Policies: policy behavior, privileged roles and owner bypass.