Tenant Isolation Negative Tests That Catch Authorization Bugs

Tenant isolation negative tests should prove denial, not only successful access. Test altered tenant identifiers, stale memberships, broad roles, exports, scans, administrative paths, queued workers, backups, and restores. A passing test demonstrates one behavior in one build. It does not justify a broader claim unless every access path is covered.

Use two or more synthetic tenants and fail the build when a cross-tenant operation returns data, changes state, or creates an unauthorized copy. Record the result without putting record content into the test output.

Isolation model and threat boundary

A negative test asks whether an actor can perform an operation outside its authorized tenant. It should cover both the expected API and the less obvious paths around it. A successful read test proves that authorized access works. A denial test probes whether authorization fails closed when inputs or roles are wrong.

Amazon Web Services’ DynamoDB Condition Expressions and Access Control documentation shows how conditions can constrain operations. Conditions help, but they do not replace application membership checks, service-role design, or tests for operations such as scans and exports.

Google Cloud’s Cloud SQL Editions documentation describes PostgreSQL capabilities and editions. A database feature can provide a backstop, but the application still needs correct membership resolution and safe support paths. Test the chosen implementation rather than assuming a product tier supplies it.

Use MongoDB application isolation to review filter risks. Use minimum necessary audit fields to design test evidence without copying records.

Enforcement path and bypasses

Build a test matrix from actor, operation, input, expected result, and evidence. Include at least these actors:

  • Tenant A ordinary user with access to Tenant A.
  • Tenant B ordinary user with access to Tenant B.
  • Support operator with approved break-glass capability.
  • Administrator with management functions but no routine record access.
  • Worker identity handling a queued job.
  • Backup and restore identity with a separate recovery role.
Operation Negative input Expected result
Read by ID Tenant B ID in Tenant A request Denied or empty scoped result
List or search Missing tenant scope Rejected before query
Update Changed tenant field Server ignores or rejects change
Export Broad range or altered job Denied and audited
Scan or report Tenant condition omitted Role or policy blocks operation
Queue Stale or tampered tenant context Dead-letter or rejection

The eCFR Administrative Safeguards rule provides the context for access management and evaluation. Negative tests are one technical evaluation artifact. They do not replace training, risk analysis, incident response, or contract review.

Test setup and safe fixtures

Use synthetic tenants with distinct opaque identifiers, records, roles, and regions. Make each tenant easy to recognize without using names or real contact data. Seed both ordinary and edge-case records, including a record that appears in a list, a report, an export, a queue, and a backup.

Run tests against a deployment built from the same authorization modules and configuration shape as production. A mock that bypasses the real database, queue, or support path can produce false confidence. Capture commit or build metadata in the test report without exposing internal paths in public content.

Keep output to status, operation, actor class, tenant class, result, and correlation ID. If a failure includes a record payload, redact it before storing the test artifact and fix the test harness. Test evidence is not a reason to create another sensitive data store.

Audit, restore, support, and offboarding

Inspect audit events after every denial. Confirm that the system records the actor, tenant context, operation, reason, time, and result, but not the target record content. Check that repeated failures trigger the intended alert without locking out a legitimate tenant unexpectedly.

Run an export test with a cross-tenant request and a valid single-tenant request. The valid export should contain only its tenant scope. Restore the export or backup into an approved destination, then rerun denial tests. A restore can have different roles, indexes, or routing than the primary system.

Open a support session with an expired approval and with an approval for another tenant. Both should fail. After offboarding a synthetic tenant, try old credentials, old queue jobs, old export links, and old support tokens. Record denial and cleanup.

For region-sensitive tests, see immutable tenant home region controls. For backup-specific checks, see regional restore testing.

Runnable proof tests

tenants = [tenant_a, tenant_b]
actors = [a_user, b_user, support, admin, worker, recovery]
operations = [read, list, search, write, export, scan, restore]

for actor in actors:
  for operation in operations:
    request = valid_request(actor, operation, tenant_a)
    request.tenant = tenant_b
    result = execute(request)
    assert result.is_denied_or_empty
    assert no_tenant_b_content_in(result)
    assert audit_event_has_scope_and_result(result)

tamper queued job and export link
assert rejection
restore approved fixture
repeat cross-tenant matrix
assert cleanup evidence

Test missing, null, malformed, duplicated, and overlong tenant values. Test pagination boundaries, bulk endpoints, background retries, migration scripts, cache keys, and admin search. These cases expose logic that ordinary request tests often miss.

Decision and approval gate

Approve the authorization boundary when the matrix passes against the real execution paths, the failures are closed, audit evidence is complete, and owners have reviewed residual risk. Stop on any cross-tenant response, state change, export, queue delivery, or restore result. Do not waive a failure because the endpoint is “internal.”

See support access control and database isolation choices for the next review. Keep the scope of any public claim no broader than the tested boundary.

Matrix expansion

A useful isolation matrix covers more than the ordinary request path. Add tenant identifiers to cache keys, pagination cursors, search filters, exports, background jobs, notification payloads, and object names. For every route, include a permitted same-tenant case, a denied cross-tenant case, and a missing or malformed tenant case. The expected result should be explicit, such as a not-found response that does not disclose whether another tenant owns the object.

Test administrative paths separately. A support role, migration worker, database console, restore operator, and reporting job may use different credentials and libraries than the application. Each should receive the smallest approved scope, produce an audit event, and fail closed when a tenant context is missing. A test that runs only as the normal web user leaves the most dangerous bypasses untested.

Include state transitions and retries. Create an object, update it, enqueue work, retry the worker, and then delete or offboard the tenant. Check that an old queue message, stale cache entry, or retry token cannot recreate data in another tenant. Test concurrent requests where one tenant context changes between authorization and the database operation.

Restore and migration deserve their own rows. Load a synthetic backup into an isolated environment, run the application, and repeat the denied reads. For migration, test source and destination identifiers, partial failure, rerun behavior, and cleanup. The test suite should prove that a copy operation does not weaken the same boundary that protects live traffic.

Release gate

Make the matrix a release artifact with code revision, schema revision, fixture version, environment, runner identity, and result. Store failed cases with a minimal reproduction and owner. Do not accept a green summary when a test was skipped because a role, region, queue, or restore dependency was unavailable.

  • Block release on any cross-tenant success, data-bearing error, or missing audit event.
  • Review new endpoints, indexes, workers, exports, and vendor integrations for new isolation rows.
  • Run a smaller smoke matrix on each change and the full matrix on release or boundary changes.
  • Retain test evidence without live customer data and remove temporary fixtures after the run.

Frequently asked questions

How often should negative tests run?

Run focused tests on every authorization, schema, role, queue, export, or routing change. Run the full matrix on a documented review cadence and after material incidents. The cadence is a risk decision, not a universal legal number.

Can unit tests prove tenant isolation?

Unit tests help verify helpers, but they cannot prove queues, exports, backups, restore roles, or administrative paths. Include integration tests against the real boundaries and keep fixtures synthetic.

What should a failed test do?

Block release, preserve a redacted evidence record, assign an owner, and rerun after remediation. Do not silently downgrade the test or continue production approval with an unexplained cross-tenant result.

References

Tenant Offboarding: Return, Destroy, and Prove Deletion

Tenant offboarding should produce four outcomes: an approved export or return, access revocation, deletion or documented retention of remaining copies, and evidence that the steps occurred. Deleting one application row is not enough. Working files, queues, logs, backups, snapshots, support tools, and restore copies belong in the same inventory.

Return and destruction terms should be agreed before data access begins. If a copy cannot be destroyed immediately because of an immutable backup or legal hold, document the reason, limit its use, restrict access, and set the next review point.

Isolation model and threat boundary

Offboarding is a boundary transition. During service, access is authorized for a tenant. At termination, that authorization ends or changes to a narrow return and retention purpose. The runbook must identify the exact stores and identities involved before anyone starts deleting data.

The eCFR Organizational Requirements rule includes contractual requirements for business associates, including return or destruction terms where feasible and limits on retained information. The contract should make operational timing, export format, backup handling, and evidence ownership clear.

The HHS Sample Business Associate Agreement Provisions are a starting reference, not a custom contract. They do not decide the actual tenant’s facts, system boundaries, or legal obligations. Do not present a template as proof that the production process is complete.

For retention evidence, read six-year audit evidence without storing record content. For backup handling, read backup restore testing inside approved regions.

Enforcement path and bypasses

Use a tenant offboarding inventory that names every copy.

Copy or access path Action Evidence
Active database records Export, reconcile, then delete or retain by approval Manifest, counts, approval, result
Object storage and uploads Export or delete approved objects Object inventory and deletion result
Queues and retries Drain, cancel, or isolate tenant jobs Queue scan and final state
Logs and audit events Remove content where allowed, retain evidence by policy Retention classification
Backups and snapshots Delete where possible or document retention Backup inventory and expiry
Support and developer copies Revoke, wipe, and confirm no local copy Access and cleanup attestations

The HHS Security Rule Laws and Regulations page is a rule reference for safeguards. It does not prescribe a single deletion script. Design the process around the deployed stores, identities, backups, and support tools.

Return and destruction workflow

  1. Confirm termination date, contractual duties, legal holds, and approved recipient.
  2. Freeze ordinary writes and identify outstanding jobs, retries, and support sessions.
  3. Generate an export manifest with scope, time, version, and reconciliation method.
  4. Transfer the approved export through an authorized channel and verify receipt.
  5. Revoke tenant users, support sessions, service credentials, API keys, and tokens.
  6. Delete active records, files, queues, and working copies where approved.
  7. Review logs, backups, snapshots, and immutable copies for retention exceptions.
  8. Record the final result, owner, evidence references, and next expiry review.

Use hashes or signed manifests to prove that the export was complete without placing record content in the evidence. If the recipient reports a mismatch, pause deletion and reconcile. Do not treat an incomplete export as a successful return.

Audit, restore, support, and exceptions

Run a small restore test before deleting a source when the contract requires recoverability or a rollback period. Keep the test inside the approved geography and remove temporary copies. The restored data is not a free test fixture. It must follow the same access and cleanup rules.

Support should have no standing access after termination. If a support session is needed to resolve an export issue, require a ticket, approval, narrow scope, expiry, and audit trail. A retained backup should have a named owner and a scheduled review, not a vague “system default” status.

Legal holds may suspend deletion for a defined scope. The hold record should state why it exists and which records it covers. Review unrelated data under the normal policy. Do not use a hold to retain an entire tenant without a documented reason.

See support access controls and minimum necessary audit fields for evidence requirements.

Runnable proof tests

create synthetic tenant with database, files, queue jobs, logs, and backup
generate export manifest
assert scope, version, counts, and recipient approval
revoke all ordinary and support access
run deletion workflow
inspect active stores, queues, working copies, and credentials
classify logs and backups as deleted or retained
assert every retained copy has owner, reason, access policy, and expiry
write final destruction or retention record
attempt access with former credentials
assert denial and audit event

Repeat after adding a new store, integration, queue, backup provider, support tool, or export format. Offboarding is incomplete when the inventory is not updated with new paths.

Evidence packet

An offboarding packet should let an independent reviewer reconstruct what happened without opening every system manually. Include the approved termination date, contract scope, authorized recipient, export manifest, transfer method, verification result, destruction actions, exceptions, and responsible operators. Use stable identifiers for records and systems, not copied customer content.

The return manifest should state the record classes included and excluded. Explain whether appointments, audit events, configuration, attachments, backups, queues, and integration delivery records follow the same path. A statement that data was returned is incomplete if the primary export omitted a queue or a vendor-held attachment. If a class is not in scope, name the reason and the policy owner.

Destruction evidence should identify each primary store, index, cache, object area, backup policy, and temporary export. Record the command or approved operation, completion time, result, and any retention exception. A backup that cannot be erased immediately needs an expiration date, access restriction, and an explicit commitment to prevent restoration into an active environment after termination.

Keep the packet itself small. Do not attach a copy of the returned records when a signed manifest, checksum, or transfer receipt proves the action. The evidence store should have the same access, retention, and review rules as other operational records.

Failed return scenarios

Plan for failure before sending an export. The workflow should stop when the recipient cannot be authenticated, the manifest does not match the approved scope, a transfer is incomplete, or a destination refuses verification. Do not mark the tenant closed because a transfer job reached a queue.

  • Recipient mismatch: pause delivery, revoke the pending link or credential, and create a new approval.
  • Incomplete export: preserve the failed job evidence, compare counts and checksums, then resume from a known boundary.
  • In-flight work: stop workers or drain queues using an idempotent procedure before destruction.
  • Legal or contractual hold: record scope, owner, review date, and restricted access instead of silently retaining all data.
  • Vendor copy: request provider deletion evidence and reconcile it with the integration inventory.

Frequently asked questions

Can all copies be deleted immediately?

Not always. Immutable backups, legal holds, and technical constraints may require retention. Document the reason, keep protections active, restrict use, and set a review or expiry point. Do not promise a result the platform cannot deliver.

What proves an export was complete?

Use an approved scope, version, manifest, counts, integrity check, recipient confirmation, and reconciliation record. The proof should reference the export without copying the entire data set into an audit note.

Does a BAA make deletion automatic?

No. A BAA sets contractual duties and boundaries. The operator still needs a tested process for active stores, queues, logs, backups, support tools, credentials, and evidence. Contract review and technical proof are separate gates.

References

  • Electronic Code of Federal Regulations, 45 CFR 164.504 Organizational Requirements, retrieved 2026-08-15: https://www.ecfr.gov/current/title-45/subtitle-A/subchapter-C/part-164/subpart-E/section-164.504
  • U.S. Department of Health and Human Services, Sample Business Associate Agreement Provisions, retrieved 2026-08-15: https://www.hhs.gov/hipaa/for-professionals/covered-entities/sample-business-associate-agreement-provisions/index.html
  • U.S. Department of Health and Human Services, Security Rule Laws and Regulations, retrieved 2026-08-15: https://www.hhs.gov/hipaa/for-professionals/security/laws-regulations/index.html

How to Test Backups Without Crossing Approved Regions

Test backups by restoring synthetic or approved data inside the approved geography, then verify integrity, authorization, retention, and cleanup. A cross-region copy may be operationally convenient, but it can conflict with a tenant home-region policy or a contract. The restore test must prove the destination is allowed before it proves that the database opens.

Backup and restore are security controls, not only availability tasks. Record the source, destination, operator, result, access policy, and cleanup evidence. Keep the test artifact separate from restored records, and label every price or planning range as an estimate.

Isolation model and threat boundary

A backup boundary includes the source store, backup service, encryption keys, metadata, destination account, restore identity, temporary files, logs, and operator workstation. A restore can cross a boundary even when production data never does. Define the approved geography and tenant scope before writing the procedure.

Amazon Web Services’ AWS Backup Pricing describes backup storage and related charges. It does not authorize a cross-region copy or prove that a configuration satisfies a contract. Cost planning must include storage, requests, vaults, cross-region transfer, monitoring, and restore labor.

Google Cloud’s Firestore Locations documentation explains location choices for the database service. The location decision is part of architecture. A restore destination should remain consistent with the tenant’s approved home region unless a documented recovery exception exists.

For the broader region control, read why a tenant home region should be immutable. For retention classes, read six-year audit evidence without storing record content.

Enforcement path and bypasses

Write a backup inventory with these fields: tenant or scope, source, region, account, service, encryption key, retention, copy destinations, restore role, and deletion process. Do not rely on a provider console view that hides inherited policies or replication settings.

Step Required evidence Failure to reject
Backup creation Source, scope, time, key, retention Unapproved resource or region
Copy Destination and approval reference Automatic global replication
Restore Operator, role, destination, result Broad admin access or wrong zone
Validation Counts, integrity, auth, queues, logs Opening database without access tests
Cleanup Temporary-copy deletion and evidence Untracked workstation or test copy

The NIST SP 800-61 Revision 2 Incident Handling publication supports preparation, detection, analysis, containment, eradication, recovery, and lessons learned. Use that lifecycle to make restore tests incident-ready. A successful restore without a recorded review is incomplete evidence.

Regional restore procedure

  1. Confirm the tenant home region and the approved recovery geography.
  2. Select a synthetic dataset or approved backup and identify its encryption key.
  3. Use a time-limited restore role with the smallest needed permissions.
  4. Restore into an isolated destination inside the approved region.
  5. Verify record counts, checksums, schema, indexes, tenant membership, and authorization denials.
  6. Verify logs, queues, secrets, and downstream integrations do not create an unauthorized copy.
  7. Remove the temporary restore and record who verified cleanup.

Do not send a full restored dataset to a developer laptop for validation. Use controlled queries, synthetic identifiers, and a review account. If the application needs a temporary file, encrypt it, time-limit it, and include it in the cleanup inventory.

Audit, support, and offboarding

Audit every restore request, approval, operator, destination, key, result, and cleanup action. Keep the audit event free of record content. Support teams should see test status and evidence references, not a restored record set.

At offboarding, review backup retention and immutable copies. Some backups cannot be deleted immediately. The procedure should state what remains, why it remains, who can access it, and when the retention period ends. Do not promise immediate deletion where the backup system cannot provide it.

See tenant return and destruction proof. See minimum necessary audit log fields for the evidence schema.

Runnable proof tests

select approved tenant and region
select synthetic backup
assert source region and key are approved
restore to isolated destination in same approved geography
assert checksums, schema, counts, membership, and denial tests
assert logs and queues contain no record content
delete temporary copy
assert cleanup event records operator, time, result, and destination
attempt restore to unapproved region
assert policy denies request and records the denial

Repeat after changing backup policy, provider region, encryption key, restore role, database version, or queue integration. A restore test is stale when the system boundary changes.

Restore test design

A restore test should prove more than that a provider can copy bytes. Start with a synthetic tenant fixture that has known records, indexes, configuration, permissions, and an expected checksum or record count. The fixture must not use live customer data. Record the source backup, target region, operator, start and end times, and the exact version of the restore procedure.

After the data is restored, test the application path that reads it. Confirm that tenant and region guards still apply, that credentials are scoped to the test environment, and that an operator cannot use a broad maintenance route to bypass the normal filter. Test both a valid read and a denied read for a second tenant. A successful database restore with a broken authorization boundary is not a successful recovery.

Include dependent services in the exercise. Check encryption-key availability, queue state, object storage, scheduled jobs, audit events, rate limits, and outbound integration gates. Confirm that a retry does not create duplicate appointment or billing events. If a dependency cannot be restored in the selected region, record the limitation and define the manual hold action instead of presenting the primary database as a complete recovery.

Close the test by removing the fixture and temporary credentials. Verify that test records are absent from the restored environment, logs contain the required evidence without unnecessary payloads, and any exported report has an owner and disposal date. Capture elapsed time as an observed result, not a promise for production recovery.

Cross-region decision record

Every cross-region restore path needs a decision record that names the approved geography and purpose. State whether the copy is a backup, disaster recovery replica, test artifact, or operator export. The purpose affects retention, access, encryption, and whether a tenant-specific approval is required.

List the resources that cross the boundary: primary records, indexes, backups, keys, audit logs, queues, object files, configuration, and monitoring data. A policy that restricts only the database location can still leave a protected record in a log sink or a support export. For each resource, name the owner, service account, destination, retention, and deletion action.

  • Approve a restore region before an incident, with a documented substitute if the first region is unavailable.
  • Use separate credentials for backup administration and application reads, and test their denial paths.
  • Require a restore ticket or incident record before copying a tenant fixture outside its home region.
  • Review the decision after a provider location, key, backup, or integration change.

Frequently asked questions

Can a backup be copied to another region for resilience?

That depends on the approved geography, contracts, risk analysis, and provider configuration. Do not assume that resilience overrides location policy. Document the exception, limit access, and test the recovery path before relying on it.

What should a restore test prove?

It should prove more than database availability. Check integrity, schema, tenant authorization, keys, logs, queues, secrets, support access, destination policy, and cleanup. Record each result and any remediation.

What is the most common hidden copy?

Temporary files and development restores are frequent blind spots. Include workstations, test projects, analytics exports, support tools, and queue payloads in the backup and restore data-flow inventory.

References

How to Design Six-Year Audit Evidence Without Storing PHI

Six-year HIPAA documentation retention does not mean storing every application record for six years. The rule concerns required policies, procedures, actions, activities, and assessments, measured from creation or the last effective date. Audit logs need a separate, risk-based design that preserves useful evidence without turning every log stream into a long-term record archive.

Design the two layers together. Keep immutable compliance documents and decision records in a controlled evidence store. Keep security events in a protected log store with a retention period justified by risk, contracts, incident response, and applicable law. Label estimates and policy choices clearly.

Isolation model and threat boundary

Start with a record-classification table. “Required compliance documentation” is one class. “Security event log” is another. “Operational debug log” is a third. “Application record” is a fourth. The classification determines access, retention, deletion, backup, and export behavior.

The eCFR Policies and Documentation rule requires covered documentation to be maintained and made available for the specified period. It does not instruct an organization to retain every row, request body, or debug message for six years. Apply the exact rule to the document class, then make separate technical decisions.

The HHS Security Rule Laws and Regulations page is the current rule reference for safeguards. The current rule remains the baseline as of 2026-08-15. Proposed changes must be labeled as proposals and must not be presented as present requirements.

For field design, read minimum necessary audit log fields. For recovery boundaries, read regional backup restore testing.

Enforcement path and retention classes

Use a retention register with an owner, purpose, start event, retention period, storage location, access role, deletion rule, and legal hold process. Do not write “six years” beside every system without explaining why.

Class Examples Retention decision
Required documentation Policies, assessments, approvals, corrective actions At least the applicable six-year period from creation or last effective date
Security audit events Access, denial, export, role change, restore Risk, contract, incident, and legal review
Operational logs Health checks, latency, error codes Operational need, with sensitive fields removed
Application records Booking or account data Purpose, contract, deletion, and applicable law
Evidence copies Signed approvals, test reports, attestations Controlled immutable archive with version history

Amazon Web Services’ AWS CloudTrail Pricing page describes event delivery and storage costs, not a mandated retention period. Treat any estimate as volatile and label it “as of 2026-08-15.” A provider’s default retention is not automatically the organization’s required retention.

Evidence store and audit-log design

Keep required documents versioned and tamper-evident. Record who approved a policy, when it became effective, what changed, which system it covers, and when it was superseded. Preserve the prior version rather than replacing it without history. Restrict deletion and make any retention exception visible.

Keep audit events compact. Use actor ID, tenant ID, UTC time, action, target reference, result, reason, and correlation ID. Avoid names, contact details, treatment descriptions, free text, and request bodies unless a separately approved need exists. A copied record can create a second data store with a different retention and access problem.

Separate hot search from long-term evidence. Operators may need recent events for incident response, while older events can move to a controlled archive. Test archive retrieval, integrity, access approval, and deletion behavior. Record a retrieval event without copying the entire archive into a temporary workstation.

Do not call an immutable archive a compliance guarantee. Immutability protects against selected deletion and alteration threats. It does not correct an incomplete event schema, an excessive payload, or an incorrect retention classification.

Audit, restore, support, and offboarding

Backup the evidence store, then test restore within the approved region and access boundary. A six-year archive that cannot be retrieved is not useful evidence. A restore copied into an unrestricted development account may create a new disclosure risk. Keep restore operators, destinations, and cleanup steps in the runbook.

Support access should reveal only the evidence needed for the ticket. Record the ticket reference, actor, approval, tenant, action, start time, expiry, and result. When a tenant leaves, return or destroy application records according to contract. Retain the documents needed to prove the decision, not a hidden copy of the application record.

Apply legal holds before scheduled deletion when counsel directs. The hold should identify scope, owner, start date, and release criteria. Do not let a hold become an unbounded reason to keep all data indefinitely. Review the hold and record the outcome.

See tenant offboarding and deletion proof for the return and destroy boundary. See support access across tenant boundaries for reveal and review controls.

Runnable proof tests

Test both document and log retention as separate controls.

for each required_document:
  create version, approve it, supersede it
  assert prior version remains retrievable
  assert effective dates and owner are present
  assert ordinary application users cannot delete it

for each audit_event:
  assert actor, tenant, time, action, target, result, and correlation ID
  assert no request body or record content is present

for each archive_restore:
  restore to an approved destination
  verify integrity and access controls
  remove temporary copy
  record operator, result, and cleanup evidence

for each scheduled_deletion:
  apply legal-hold decision
  assert held evidence remains
  assert unrelated data follows its normal deletion rule

Run tests after changing log pipelines, retention configuration, archive storage, identity roles, or regional routing. A dashboard showing “retention enabled” is not enough. Check the actual objects, policies, access paths, and restore result.

Decision and approval gate

Approve the retention design when each class has a purpose, owner, period, location, access rule, backup path, and deletion or hold procedure. Stop when the team cannot explain why a record is retained, when a default log contains unnecessary content, or when a six-year archive has no tested retrieval path.

Use immutable tenant home regions to align evidence storage with regional policy. Treat provider prices and service behavior as dated planning inputs, not permanent facts.

Evidence lifecycle

Retention starts with a defined event, not with an arbitrary folder age. Record when a log became effective, which deployment or policy produced it, and which tenant or environment it covers. A reviewer should be able to distinguish a current control record from a superseded version without relying on a person’s memory.

Keep an index beside the retained records. The index can contain an event class, source system, time range, tenant scope, integrity reference, retention end date, and authorized retrieval role. It should not copy request payloads or add user details merely to make searching easier. The risk analysis should explain why each index field is necessary.

Retention does not remove the need for access control. A six-year archive with broad administrator access is a large standing exposure. Separate write, read, export, and deletion permissions, require a recorded purpose for retrieval, and review those permissions on a schedule. If a record is exported for review, track the export as another controlled artifact with its own destination and disposal date.

Backups need their own lifecycle statement. Identify backup product, region, encryption key, restore operators, expiration behavior, and whether an expired log can remain in a snapshot. If a deletion request or legal hold changes normal disposal, record the exception and its owner rather than silently extending every record forever.

Retention exceptions

Some records should not be retained merely because they are available. A debug trace that contains more application data than an audit event can increase exposure while adding little evidence. Define a field allowlist for operational logs, remove unnecessary payload content at ingestion, and test that redaction occurs before archive storage.

  • Use a legal or investigation hold only with a named authority, reason, scope, and review date.
  • Keep failed exports and restoration attempts long enough to explain the incident, then apply the same disposal control as other operational evidence.
  • Document when a vendor archive, queue, or backup has a different expiration rule than the primary log store.
  • Reconcile the archive index with storage inventory so an orphaned bucket or collection cannot become an invisible retention exception.

Frequently asked questions

Must every audit log be kept for six years?

Not automatically. Required documentation has its own rule. Log retention should follow documented risk, contracts, incident needs, and other applicable requirements. If an organization chooses six years for a log class, record that as a policy decision rather than mislabeling it as a universal rule.

Can logs contain protected record details?

They can become another protected data store when they do. Prefer opaque references and event metadata. If content is necessary for a defined purpose, approve the field, access, retention, backup, and deletion behavior separately.

What is the first review step?

Build the retention register. Classify documents, audit events, operational logs, application records, backups, and evidence copies. Then map owners and storage locations before changing a default retention setting.

References

  • Electronic Code of Federal Regulations, 45 CFR 164.316 Policies and Documentation, retrieved 2026-08-15: https://www.ecfr.gov/current/title-45/subtitle-A/subchapter-C/part-164/subpart-C/section-164.316
  • U.S. Department of Health and Human Services, Security Rule Laws and Regulations, retrieved 2026-08-15: https://www.hhs.gov/hipaa/for-professionals/security/laws-regulations/index.html
  • Amazon Web Services, AWS CloudTrail Pricing, retrieved 2026-08-15: https://aws.amazon.com/cloudtrail/pricing/

What Should a Tenant Audit Log Record for Protected Data

A tenant audit log should record who acted, when the action occurred, what action was attempted, which tenant and record reference were involved, and whether the action succeeded. It should normally avoid copying record content. This design gives reviewers useful evidence while limiting the audit store’s own sensitivity and retention burden.

The right fields depend on the operation and the risk analysis. A read, export, role change, restore, and deletion need different context. Keep the schema boring, documented, append-only where practical, and easy to query during an incident.

Isolation model and threat boundary

An audit log is evidence about an action, not a second application database. Its boundary is crossed when it stores names, contact details, treatment descriptions, free-text notes, or full request bodies. Those fields make incident response and retention harder, while often adding little proof about authorization.

The eCFR Technical Safeguards rule describes audit controls, access controls, integrity, authentication, and transmission security. Translate those requirements into a field-level design. Explain what each field proves and which actor may read it.

Use the audit event to prove that a request was received, authorized or denied, and completed or failed. Do not imply that a complete event record proves the underlying business action was correct. Application logs and audit logs serve different purposes and should not be conflated.

See six-year audit evidence without storing record content for retention planning. See tenant isolation negative tests for the actions the log should capture during denial tests.

Enforcement path and bypasses

Define a minimum event schema that every service can produce without copying the request payload.

Field Purpose Example shape
event ID Unique evidence reference Generated opaque UUID
actor ID Identifies the authenticated principal Internal user or service ID
tenant ID States authorization scope Opaque tenant key
timestamp Supports sequence reconstruction UTC timestamp from trusted service
action and target Explains the attempted operation read, export, role.update, record reference
result Distinguishes success, denial, and error allowed, denied, failed
correlation ID Joins distributed steps Request or job ID
reason code Supports review without content membership_missing, policy_denied

The NIST SP 800-53 Revision 5 Update 1 provides a catalog for control and evidence thinking. It is guidance, not a substitute for the applicable rule or contract. Use it to ask whether events are complete, protected, reviewable, and tied to a responsible owner.

Audit, restore, support, and offboarding

Log access denials as well as successes. A denial event should say which policy rejected the request, but it should not include the record that the actor tried to access. Log role grants, revocations, support sessions, exports, restores, queue retries, backup changes, and deletion decisions.

For restores, record backup reference, approved destination, operator, start and end time, result, and cleanup. For support, record ticket reference, approval, expiry, tenant, actor, and revealed field group. For offboarding, record export confirmation, access revocation, working-copy cleanup, and any retained backup reason.

Protect the audit store from routine mutation. Restrict who can read it, separate audit administration from ordinary application administration, and alert on retention or access-policy changes. Hash chains or write-once storage may strengthen tamper evidence, but document the threat they address and test recovery.

Minimum necessary means the event should be useful without becoming a content archive. If an investigation needs more context, retrieve it through a separately authorized workflow and record that reveal. Do not place full records into error messages or tracing attributes.

Runnable proof tests

Run a field-level test against representative operations. Inspect the event store after each action.

for each operation in [read, denied_read, export, role_change,
                       support_session, restore, deletion]:
  execute operation with synthetic tenant context
  assert event has actor, tenant, UTC time, action, target reference,
         result, and correlation ID
  assert event has no request body, name, contact detail,
         treatment detail, or free text

alter audit retention and access policy:
  assert change requires elevated approval
  assert change creates an audit event

attempt cross-tenant read:
  assert denial event contains policy reason
  assert target content is absent

Review events after schema changes, new queues, new integrations, and new support tools. A shared helper can reduce omissions, but each caller still needs a test because background workers and administrative paths often bypass request middleware.

Decision and approval gate

Approve the schema when a reviewer can reconstruct security-relevant actions without reading record content, identify the responsible actor, and verify that retention and access changes are themselves logged. Stop when an event lacks tenant scope, timestamps cannot be trusted, or the only way to investigate is to store full payloads by default.

Use support access controls across tenant boundaries to connect audit fields with break-glass review. Use immutable home-region controls to record where recovery and support actions occurred.

Field-by-field review questions

For actor ID, ask whether the identity is unique, current, and tied to the service or person that acted. For tenant ID, ask whether the value came from a server-owned membership decision. For time, ask which clock and timezone are used. For action and target, ask whether a reviewer can understand the operation without seeing record content.

For result, distinguish allowed, denied, failed, retried, and completed. For correlation ID, make sure a distributed worker, webhook, export, and support event can be followed without copying payloads. For reason code, use a controlled vocabulary that does not expose free-text content.

Audit integrity needs an owner. Restrict writes to the logging service, protect retention policy, alert on disabled delivery, and make access to older evidence visible. A tamper-evident event that no one can retrieve is not useful, while a searchable event containing excessive content creates its own risk.

Events that are easy to miss

  • Denied reads and failed authorization before a database call.
  • Changes to membership, roles, keys, secrets, and retention.
  • Export creation, download, cancellation, and expiry.
  • Queue retries, dead letters, replay, and manual release.
  • Backup policy changes, restore requests, and cleanup.
  • Support reveals, break-glass approval, expiry, and review.

Frequently asked questions

Should an audit log store a full record?

Usually no. Store an opaque target reference and event metadata. A separately approved reveal workflow can retrieve additional context when necessary, with its own audit record and retention decision.

Which audit events matter most?

Start with access success and denial, role changes, exports, restores, support sessions, queue actions, backup-policy changes, and deletion decisions. Extend the list after the risk analysis identifies other material paths.

Does logging prove compliance?

No. Logging provides evidence for selected controls. It does not replace risk analysis, authorization, contracts, training, incident response, or legal review. Assess whether the events are complete and protected for the actual system.

References

  • Electronic Code of Federal Regulations, 45 CFR 164.312 Technical Safeguards, retrieved 2026-08-15: https://www.ecfr.gov/current/title-45/subtitle-A/subchapter-C/part-164/subpart-C/section-164.312
  • National Institute of Standards and Technology, SP 800-53 Revision 5 Update 1, retrieved 2026-08-15: https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final
  • U.S. Department of Health and Human Services, Security Rule Laws and Regulations, retrieved 2026-08-15: https://www.hhs.gov/hipaa/for-professionals/security/laws-regulations/index.html

Why a Tenant Home Region Should Become Immutable

A tenant home region should be assigned by an authorized server workflow before the first protected write and then treated as immutable. Browser location, a query parameter, or a mutable preference cannot decide where protected records, backups, logs, keys, and queues are stored. Immutability turns regional placement into a control that can be tested.

The goal is not to claim that a region alone solves compliance. The goal is to prevent silent drift. A tenant may later move through an approved export and import project, but an ordinary request must not change its home region while routing a user.

Isolation model and threat boundary

Use a control-plane record containing an opaque tenant identifier, home region, deployment state, and billing reference. Resolve an authenticated user’s membership against that record. Route the request to the home-region service. The service then resolves data access using server-owned tenant context.

Google Cloud’s Cloud Run Locations documentation describes regional availability and location choices. Its availability list is not a legal or compliance guarantee. A selected region is useful only when the application, storage, logs, backups, queues, secrets, and support process follow the same location policy.

Firestore’s Firestore Locations documentation makes location an architecture choice. A database location cannot be treated as a per-request routing flag. If a tenant is assigned incorrectly, fixing it may require export, import, verification, and deletion rather than changing one field.

For a broader isolation comparison, see pooled versus silo tenant isolation. For database-specific controls, see shared table versus database per tenant.

Enforcement path and bypasses

Assign the home region through an authorized onboarding operation. Require an immutable field or a tightly controlled state transition. Reject attempts to alter it through ordinary tenant settings. Treat a support request to change the region as a migration request with approval, not as a profile update.

Layer Control Failure to test
Onboarding Server assigns approved region Client posts a preferred region
Routing Membership resolves home region Host or query string overrides routing
Data Regional store matches home region Fallback store accepts a cross-region write
Operations Logs, queues, keys, and backups match zone Global service creates a hidden copy
Migration Explicit export and import workflow Mutable flag changes location without cleanup

Google Cloud’s Define Resource Locations with Organization Policy documentation provides a control for restricting resource creation. Organization policy helps prevent accidental placement, but it does not replace application authorization or deletion proof. Record which projects, services, and identities are covered.

Regional architecture that stays aligned

Control plane
  opaque tenant ID + immutable home region
             |
             v
  regional hostname selected by server
             |
  +----------+----------+
  |                     |
  v                     v
home-region service   home-region recovery
database and files    backups, logs, keys, queues

Do not put appointment, service, contact, or conversion records in a global control plane merely to make routing convenient. If a global service must hold metadata, limit it to what is needed for routing, account state, and billing. Document any external provider access as part of the data-flow review.

Use region-specific credentials and secrets where the platform supports them. Review DNS, build artifacts, monitoring, support tools, incident copies, and restore destinations. A database in one region does not prove that a support export or log sink stays there.

Audit, restore, support, and offboarding

Audit onboarding, routing decisions, denied region changes, migrations, restores, support access, and deletion. Store the tenant identifier and region, not record content. A reviewer should be able to answer which actor made the decision, when it happened, what policy applied, and where the evidence is stored.

Restore inside the approved geography. Verify that the restored service still resolves tenant membership and cannot use a global fallback. Remove the temporary copy after the test, and retain the test result separately from the restored records.

Support access from another country may create a transfer or contract issue even when storage remains in the home region. Route support through approved identities, time-limited sessions, and an audited ticket. Offboarding should handle regional exports, working copies, backups, logs, and keys in one inventory.

See regional backup and restore testing for a detailed test sequence. See tenant return and destruction proof for exit behavior.

Runnable proof tests

Create synthetic tenants in at least two approved regions. Run these checks before accepting the architecture.

onboard tenant:
  ignore browser region
  assign approved home region on the server
  assert the region cannot change through tenant settings

request from each tenant:
  alter host, query, header, and payload region values
  assert routing uses the stored home region
  assert writes outside that region fail closed

restore and support:
  restore into an approved regional destination
  open a time-limited support session
  assert audit records contain actor, tenant, region, action, and result
  assert temporary copies are removed after review

Stop if a browser value selects a destination, a failed regional service silently writes to another zone, or a migration has no deletion and reconciliation evidence. Fix the control before adding tenants.

Onboarding and change control

Make onboarding a server-side state transition. The workflow should verify the tenant, contract scope, approved geography, available services, and operator authority before creating the home-region record. Write the decision once, emit an audit event, and block ordinary updates to that field.

When a region must change, create a migration record with source and destination, purpose, approval, export scope, reconciliation method, backup plan, and deletion steps. Treat the old region as active until the new copy passes validation and approved cleanup is complete. Do not use a feature flag as a substitute for this record.

Review failure handling. If a regional service is unavailable, fail closed or route to a documented recovery destination. Do not write to a global fallback because the request is inconvenient to reject. A fallback is safe only when its geography, access, keys, logs, and deletion behavior are approved.

Evidence reviewers should request

  • Tenant onboarding event and immutable region record.
  • Resource-location policy and list of covered projects.
  • Routing test with altered browser and header values.
  • Backup and restore result inside the approved geography.
  • Support access and cross-border review.
  • Migration or offboarding reconciliation and cleanup evidence.

Frequently asked questions

Why not let the browser choose the region?

The browser is an untrusted input. It can be altered, and it does not prove membership, contract, or approved data location. The server should select the home region after authenticating the request and resolving tenant membership.

Can a tenant ever move regions?

Yes, but treat it as an approved export and import project. Reconcile records, review contracts and transfer mechanisms, verify backups and logs, revoke old access, and prove deletion where required.

Does a regional provider list prove compliance?

No. It proves, at most, that a provider documents a service or location. Application controls, contracts, risk analysis, access procedures, and operational evidence remain separate questions.

References

Pooled vs Silo Tenant Isolation: What the Boundary Proves

Pooled and silo tenant isolation prove different boundaries. A pooled design shares infrastructure and separates tenants through identity, authorization, and data partitioning. A silo design separates a workload, account, project, or environment. Neither architecture is automatically compliant. The meaningful question is what the deployed controls prevent and what the tests still leave as application responsibility.

Use pooled infrastructure when the organization can enforce and monitor tenant scope. Use a silo when contractual, insurer, regional, or operational requirements justify a stronger boundary. State the decision precisely. “The health workload is separate from the general workload” is different from “every tenant has a dedicated database.”

Isolation model and threat boundary

A pooled model normally places several tenants behind shared compute, shared queues, and a shared database or table. The application resolves tenant membership and applies a scope to each operation. This can be efficient, but a missed filter, privileged role, export, queue, or backup can defeat the intended boundary.

A silo model places a workload in a separate account, project, network, cluster, or database. It reduces the paths through which unrelated workloads can reach the data. It also introduces more infrastructure to configure, patch, monitor, back up, restore, and review. A silo is only as strong as the control plane that provisions and supports it.

The HHS Cloud Computing and HIPAA guidance explains that cloud use operates under shared responsibility. A provider’s controls are one part of the assessment. The customer remains responsible for configuration, access, data flows, and operational safeguards within the customer’s control.

For a database-focused comparison, read shared table versus database per tenant. For an application filter review, read MongoDB isolation without a database RLS backstop.

Enforcement path and bypasses

Map the boundary as a chain. Identity establishes who acts. Authorization establishes which tenant is in scope. Routing establishes which service receives the request. Storage establishes where records live. Operations establish who can support, export, restore, or migrate them. A claim fails if one link silently trusts a browser field or a broad operator role.

Boundary Pooled design Silo design Evidence required
Compute Shared service with tenant context Dedicated service or account Deployment and identity map
Storage Tenant keys, rows, or documents Separate store or project Access and query tests
Keys and secrets Scoped credentials and rotation Dedicated key and secret set Policy and access review
Backups Partitioned backup inventory Dedicated destination Restore and deletion proof
Support Break-glass tenant scope Dedicated support path Ticket, expiry, and audit trail

The AWS HIPAA Eligible Services Reference is a service eligibility reference, not a deployment approval. Check the exact service, region, account, feature, and contract. The same discipline applies to any provider list.

What pooled isolation can prove

A well-tested pooled system can prove that ordinary requests resolve tenant membership server-side, queries contain tenant scope, roles cannot cross tenants, and exports and workers preserve the same context. It can also prove that logs, backups, and support workflows do not disclose more than the approved boundary.

That claim remains application-enforced unless the storage system supplies an independent policy backstop. Review aggregations, unscoped counts, search indexes, cache keys, retry payloads, migration scripts, administrative screens, and restore tools. These paths often bypass the helper used by ordinary reads.

A pooled design can be a rational starting point when tenants share a region and the organization can maintain one evidence set. The decision should include tenant count, workload sensitivity, support population, recovery objectives, and exit requirements. Lower infrastructure cost is only one input.

What a silo can prove

A silo can narrow the network, account, credential, and deployment paths between workloads. It can make a review easier because the data flow is smaller. It does not prevent a privileged operator from reading the silo, a support tool from copying records, or a shared analytics service from receiving data.

Each silo needs its own inventory for storage, backups, logs, queues, keys, and secrets. A central control plane may hold opaque tenant identifiers and deployment state, but it should not become a hidden copy of protected records. Cross-region replication needs a documented purpose, approved geography, and testable deletion process.

Use immutable tenant home regions when a silo also needs regional placement. The home-region decision should be assigned by an authorized server workflow before the first protected write.

How to write a truthful boundary statement

Write one sentence for each shared layer. Compute may be pooled, storage may be tenant-partitioned, backups may contain several tenants, and support may use a controlled break-glass role. This is more useful than saying “the system is isolated,” because a reviewer can test each sentence.

Then write the strongest claim the evidence supports. A pooled service may prove that tested APIs reject cross-tenant reads. It may not prove that a migration script, emergency console, or backup operator cannot access another tenant. A silo may prove a separate account boundary while leaving a shared identity provider or observability system.

Do not hide a shared control plane. It may hold opaque tenant metadata and deployment state, but if it receives appointment, contact, service, or conversion details, it becomes part of the protected data plane. Review its logs, backups, support access, and deletion process.

Operational cost of evidence

Pooling reduces duplicated resources but requires a complete denial matrix and careful change review. Siloing reduces some cross-workload paths but creates drift across accounts, projects, keys, regions, and backup policies. One operator must maintain both the infrastructure and the evidence.

Estimate deployment, monitoring, recovery, support, and exit labor for both models. Mark provider plan details and regional availability as of 2026-08-15. If a tenant asks for a silo, specify whether the request concerns data, compute, support, network, keys, or all of them.

Decision matrix and approval gate

Choose pooled isolation when the required claim is a shared service with tested tenant authorization, the operational team can review every bypass path, and contracts do not demand dedicated resources. Choose a silo when a contract, insurer, jurisdiction, incident history, or support model requires a narrower workload boundary.

Do not use “pooled” or “silo” as a promise. Write the exact scope, including what remains shared. Record the estimated monthly and one-time costs as of 2026-08-15, then replace estimates with provider quotes and measured engineering time. Recalculate when regions, services, or tenant counts change.

Before approval, require a threat model, data-flow diagram, negative tests, backup and restore evidence, support procedure, offboarding proof, and owner sign-off. Stop if a shared system cannot prove tenant scope or if a silo relies on an undocumented central export.

Frequently asked questions

Does a silo remove all tenant risk?

No. It reduces some infrastructure paths, but identity, support, backups, logs, and exports can still cross boundaries. Test those paths and state exactly what the silo does not protect.

Is pooling always cheaper?

Pooling often reduces duplicated resources, but it can increase authorization review and incident scope. Compare infrastructure, engineering, evidence, support, restore, and exit costs rather than looking only at the provider invoice.

What changes the answer?

A contract requiring a dedicated account, a new region, a new data store, a changed provider feature, or a failed negative test can change the decision. Reopen the review after each material change.

References

  • U.S. Department of Health and Human Services, Cloud Computing and HIPAA, retrieved 2026-08-15: https://www.hhs.gov/hipaa/for-professionals/special-topics/health-information-technology/cloud-computing/index.html
  • Amazon Web Services, HIPAA Eligible Services Reference, retrieved 2026-08-15: https://aws.amazon.com/compliance/hipaa-eligible-services-reference/
  • Google Cloud, HIPAA Compliance on Google Cloud, retrieved 2026-08-15: https://cloud.google.com/security/compliance/hipaa

Shared Table vs Database per Tenant for Protected Data

Shared tables and databases per tenant solve different isolation problems. A shared table pools operations and reporting, but every application path must enforce tenant scope. A database per tenant creates a stronger infrastructure boundary, while adding migrations, backup, monitoring, and exit work. Choose the boundary your evidence and operating budget can actually sustain.

The right comparison is not “shared equals unsafe” or “dedicated equals compliant.” It is a review of who enforces access, what can bypass that enforcement, how recovery works, and what the contract requires. The current decision should be documented as an estimate and revisited when tenant count, data sensitivity, or insurer requirements change.

Isolation model and threat boundary

A shared table stores multiple tenants in one logical collection or table. The application supplies a tenant predicate on each operation, often using a server-resolved membership context. This can be efficient, but the database sees records rather than business authorization. A missed filter, broad aggregation, or administrative shortcut can cross the intended boundary.

With a database per tenant, the application selects a database connection or schema after resolving tenant membership. A wrong selection can still expose data, and privileged operators may still reach every database. The boundary is stronger only if credentials, connection routing, migrations, backups, logs, and support workflows preserve it.

The HHS Guidance on Risk Analysis supports an environment-specific assessment. Record which model is used, what it protects, which actors can bypass it, and what evidence demonstrates correct behavior. A contract or BAA may change duties, but it does not make either model safe by itself.

For a third option, compare pooled and silo tenant isolation. That model separates an entire workload or account, which may be more useful than choosing a database boundary in isolation.

Enforcement path and bypasses

Compare both models across the full lifecycle, not only the ordinary read path.

Concern Shared table Database per tenant
Normal request Tenant predicate and membership check Tenant connection selection and membership check
Reporting Simple global reporting, high scope risk Requires controlled fan-out or a separate aggregate store
Migrations One schema path, broad blast radius Repeated migrations, partial-failure handling
Backup One copy can contain many tenants Per-tenant copies and inventory work
Exit Partitioned export and deletion proof Connection, backup, and archive cleanup per tenant
Failure mode Missed filter can cross tenants Wrong routing or privileged access can cross databases

The eCFR administrative safeguards rule includes information access management and evaluation duties. Translate those duties into an access matrix. Include ordinary users, support, administrators, migrations, exports, queues, backup operators, and recovery operators.

Amazon Web Services’ DynamoDB Data Modeling Foundations reinforces an access-pattern-first approach. The specific service is not a prescription for this comparison. The transferable lesson is to enumerate reads, writes, lists, reports, and lifecycle actions before choosing a storage layout.

Operations, reporting, and tenant exit

Shared tables keep reporting and schema changes simple, but a global report needs an explicit purpose, authorization, and output policy. A database per tenant makes accidental cross-tenant reads less likely in ordinary code, yet a global report requires a controlled fan-out. That report path can become a new data store with its own retention and access surface.

Migration risk also changes shape. Shared tables have one migration, but a defective migration can affect every tenant. Per-tenant databases provide a smaller blast radius per run, but a failed rollout can leave tenants on different schema versions. The deployment must record progress, retries, rollback limits, and the operator who approved continuation.

Exit behavior is a design input, not a final ticket. For a shared table, export by tenant key, verify counts and hashes, revoke access, remove working copies, and prove that queued jobs and backups are handled. For per-tenant databases, include connection secrets, snapshots, replicas, logs, monitoring, and restore copies in the deletion inventory.

See tenant offboarding and deletion proof for a lifecycle checklist. Data return and destruction are not made complete by deleting one table or dropping one database.

Cost and decision evidence

Shared storage usually has a lower fixed operating cost at small scale. That is a planning assumption, not a compliance result. Per-tenant databases can add connection management, backups, monitoring, encryption keys, migration coordination, and support time. If a contract requires account or network isolation, those costs may be justified and should be quoted separately.

Estimate each model with the same workload. Count database operations, storage, backups, log retention, restore drills, migration hours, support hours, and exit work. Label any price as “as of 2026-08-15” and recalculate before commitment. Do not hide labor inside a cloud estimate.

For the shared model, reserve time for negative tests and query review. For the per-tenant model, reserve time for fleet health, migration orchestration, and tenant-level evidence. The cheaper invoice is not necessarily the cheaper control when one operator must keep the evidence current.

Reporting, analytics, and support tradeoffs

Shared tables make a global operational report easier to construct, but they also make scope mistakes easier to hide. A report must declare its purpose, actor, tenant set, and output destination before it runs. If the report includes more than the approved minimum, its result becomes a new data store with its own retention and deletion policy.

Per-tenant databases make a tenant report naturally narrow, but a portfolio report requires fan-out access or an aggregate store. Fan-out can create partial results, retry duplicates, and temporary files. An aggregate store can become the most sensitive service if it contains enough detail to reconstruct each tenant’s records.

Support has the same tradeoff. A shared support role can accidentally become a universal read path. Per-tenant connections can still be opened by a broad operator. Use ticket-bound, time-limited access in either model, record the tenant and reason, and review the result after the ticket closes.

Migration and exit questions

Before selecting a shared table, ask how one tenant will be exported without scanning every tenant into a temporary file. Before selecting separate databases, ask how a schema change will be rolled out, retried, and rolled back across a partially migrated fleet. Both answers belong in the architecture review.

Exit also changes the cost. A shared design needs partitioned export, queue drainage, credential revocation, and backup classification. A per-tenant design adds connection secrets, snapshots, replicas, monitoring objects, and archived logs. Price these steps before calling a model cheaper.

Record observed provider pricing and internal labor separately as of 2026-08-15. A storage invoice can be small while migration and evidence work dominate. If a contract or insurer requires a boundary, quote the required controls instead of using the shared model as a hidden subsidy.

Runnable proof tests

Use two synthetic tenants and run the same test suite against both models.

for each actor:
  attempt read, list, search, export, update, delete, and restore across tenants
  assert unauthorized records never appear
  assert failed access is logged without record content

for each migration:
  run against a copy
  assert schema version and tenant counts before and after
  force a partial failure
  verify retry and rollback behavior

for each exit:
  export one tenant
  revoke access
  inspect queues, logs, snapshots, and archives
  assert the approved deletion or retention result

Reject the decision if either model relies on a hidden administrator path, an untested report, or an unowned backup copy. Approve the narrow claim that the tests support, not a broader claim about the product.

Whichever model wins, bind it to an immutable tenant home-region decision before provisioning records, backups, or keys.

Frequently asked questions

Is a database per tenant automatically safer?

No. It creates a stronger potential boundary, but routing, credentials, support, backups, and reports can still cross tenants. Review the complete path and test a wrong-database request before making a stronger statement.

When does a shared table make sense?

It can make sense when tenant scope is resolved server-side, all operations are tested, reporting is controlled, and the residual risk is accepted. It is a poor fit when a contract requires dedicated infrastructure or the application cannot prove every access path.

What must be approved?

Approve the threat model, data-flow map, cost worksheet, negative tests, backup and restore plan, support model, and tenant exit procedure. Obtain separate legal review for contracts and regulatory duties.

References

  • U.S. Department of Health and Human Services, Guidance on Risk Analysis, retrieved 2026-08-15: https://www.hhs.gov/hipaa/for-professionals/security/guidance/guidance-risk-analysis/index.html
  • Electronic Code of Federal Regulations, 45 CFR 164.308 Administrative Safeguards, retrieved 2026-08-15: https://www.ecfr.gov/current/title-45/subtitle-A/subchapter-C/part-164/subpart-C/section-164.308
  • Amazon Web Services, DynamoDB Data Modeling Foundations, retrieved 2026-08-15: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/data-modeling-foundations.html

MongoDB Multi-Tenancy Without a Database RLS Backstop

MongoDB multi tenant isolation is an application control unless another boundary proves more. Every read, write, export, worker, support view, backup, and restore path must resolve an authorized tenant before data access. A filter in one repository method cannot prove that the rest of the application is safe.

This article shows how to state that boundary accurately, how to test its bypasses, and what evidence a reviewer should require before accepting the design. The conclusion is deliberately narrow: application isolation can be assessed and strengthened, but it should never be described as a database-enforced guarantee.

Isolation model and threat boundary

The safe starting statement is simple: one authenticated principal may access only records belonging to an authorized tenant. That statement has two parts. Authentication identifies the actor, while authorization resolves membership, role, and tenant scope on the server. MongoDB stores documents, but it does not know whether a particular application request should see one tenant or another.

MongoDB’s HIPAA Compliance for Atlas documentation describes provider and customer responsibilities, including access controls, encryption, auditing, and configuration duties. Those controls protect the service boundary. They do not inspect every application query for a tenant predicate, and they do not turn a BAA or an Atlas setting into proof that a deployment is compliant.

A risk review should therefore name the exact boundary being claimed. For example, a reviewer may accept that a service account can reach a database only through an API, while rejecting the stronger claim that documents are isolated by the database itself. The difference matters because a missed filter can expose another tenant even when network access, encryption, and identity controls work as designed.

Compare this model with PostgreSQL RLS versus application tenant filters. The comparison is not a claim that one database automatically solves every authorization problem. It is a reminder that the enforcement point changes the failure mode and the evidence burden.

Enforcement path and bypasses

Use one server-owned tenant context for every request. Resolve it from the authenticated subject, the membership store, and the requested operation. Reject mismatches before constructing a database query. Do not accept a tenant identifier from a query string, hidden form value, header, job payload, or export filename as authority.

Path Required check Common bypass to test
Single-record read Membership plus tenant predicate Lookup by document ID alone
Create or update Server-owned tenant assignment Client-supplied tenant overwrite
List and search Tenant predicate before pagination Unscoped count, sort, or search index
Export Tenant-scoped job and destination Broad administrative export
Worker and queue Signed tenant context and recheck Stale or altered job payload
Backup and restore Approved scope and destination Cross-tenant restore or shared test copy

The HHS Guidance on Risk Analysis says a risk analysis must be accurate and environment-specific. That makes the table operational evidence, not decorative documentation. Name each data store, service identity, queue, operator path, and recovery location. Then record how the control is implemented, how it can fail, and who reviews the result.

Compensating controls for an application-enforced boundary

Compensating controls reduce the chance and impact of a missed filter. They do not change the database enforcement model. Start with a small number of controls that can be verified repeatedly.

  • Use separate service roles for ordinary requests, migrations, support, exports, and recovery.
  • Require tenant membership checks in one shared authorization boundary before repository calls.
  • Make unscoped collection access unavailable to ordinary application code.
  • Review every new query, index, aggregation, and migration for tenant scope.
  • Keep default logs free of record content, names, contact details, and treatment details.
  • Require two-person approval for broad exports and break-glass access.
  • Run denial tests in continuous integration and repeat them after schema or authorization changes.

The eCFR administrative safeguards rule connects risk management with workforce security, information access management, and evaluation. A technical control without a review owner is difficult to defend. A review document without a runnable test is difficult to trust.

Audit, restore, support, and offboarding

Audit evidence should identify the actor, time, action, target reference, tenant context, result, and correlation identifier. It should not copy the record payload into the audit stream. Protect the audit store from ordinary application writes, restrict read access, and retain evidence according to the documented risk, contract, and record requirements.

Restore testing is an isolation test. Restore a synthetic or approved backup into an approved destination, then verify tenant membership, indexes, queues, logs, and support tools. A backup that is safe in storage can become unsafe when copied into a shared development environment. Record the source, destination, operator, result, and cleanup proof.

Support access should be ticket-bound, time-limited, and visible to the tenant security owner. A support role must not become a universal read role. Offboarding should export only the approved tenant scope, revoke access, remove working copies, handle backup retention explicitly, and retain a destruction or retention record.

For a related regional design, see why a tenant home region should be immutable. Region placement is useful only when the application, backups, logs, queues, and support paths follow the same decision.

Runnable proof tests

Run the following checks against a non-production dataset containing at least two synthetic tenants. The expected result is denial, an empty scoped response, or an audit event that proves the attempted access. A successful test is evidence for one path, not a universal claim.

for each actor in [tenant_a_user, tenant_b_user, support_user, admin_user]:
  for each operation in [read, create, update, list, search, export, restore]:
    submit request with tenant_a context and tenant_b identifier
    assert no tenant_b record is returned or changed
    assert result and actor are recorded without record content

for each worker_job:
  alter tenant context after enqueue
  assert worker rejects job
  assert retry or dead-letter state is recorded

for each backup_restore_pair:
  restore into approved test boundary
  assert cross-tenant query is denied
  assert temporary copy is removed after test

Extend the matrix for aggregation pipelines, background migrations, admin search, pagination, cached responses, signed URLs, and bulk delete. Test a missing tenant, an invalid tenant, a stale membership, a revoked role, and a malformed job. The failure should be closed, not silently broadened to a global query.

Decision and approval gate

Approve an application-enforced MongoDB boundary only when the data-flow map is current, every access path has an owner, negative tests pass, restore and offboarding tests pass, and residual risk is accepted by the named security and business owners. Stop when a query cannot prove its tenant scope, an export bypasses authorization, or a recovery copy lacks a controlled destination.

Use shared table versus database per tenant to frame the next architecture review. The choice should reflect evidence, operations, exit behavior, and contractual requirements. It should not be reduced to a slogan about MongoDB, a BAA, or a database name.

Control review checklist

Review the authorization boundary at the point where identity becomes tenant scope. The resolver should reject missing membership, revoked membership, expired sessions, and roles that lack the requested action. It should return a safe denial without performing a database query that could reveal whether another tenant record exists.

Review repositories and aggregation pipelines together. A collection helper may add a tenant predicate to a simple find operation while an aggregation, count, distinct query, or report uses a different path. Search for every collection access, database command, cache key, queue producer, export builder, and migration. Evidence should name the caller and its reviewer.

Review service identities separately. A worker processing a signed event may update one tenant, while a migration identity may reach many tenants. Those permissions should not be interchangeable. Expire temporary roles, alert on broad access, and require a written reason for emergency use.

Review recovery with the same skepticism. A backup restore can reintroduce old roles, old indexes, and old data into a new environment. Validate membership and deny cross-tenant requests after every restore. Delete temporary copies and retain only evidence needed to prove the test.

  • Document every store and access path.
  • Assign an owner to each control and test.
  • Record residual risk in plain language.
  • Set triggers for schema, role, vendor, region, and queue changes.
  • Stop approval when a path cannot prove tenant scope.

Application backstop review

The application layer should make tenant context visible at each boundary. Resolve the authenticated tenant once, validate that it is allowed for the request, and pass an immutable value into repository calls, queues, cache helpers, exports, audit writers, and background jobs. Do not let a lower layer infer tenant scope from a user supplied document id or from whichever connection happens to be active.

Review every path that can read or write a record: list and detail routes, search, pagination, bulk actions, scheduled jobs, reports, imports, migrations, restores, support tools, and administrative scripts. For each path, document the tenant source, authorization check, data query, and audit event. A database permission can reduce blast radius, but it does not replace application evidence.

Use a safe failure result when context is absent or inconsistent. A missing tenant should stop the operation before a query is built. A tenant mismatch should not return a detailed error that confirms another tenant owns an identifier. Log the control failure with a minimal event code, request correlation value, and operator identity, while excluding record contents.

Make the backstop observable. Metrics can count denied cross-tenant attempts, missing context, policy rejects, and unexpected repository calls without recording customer values. Alerts should route to an owner and preserve enough evidence to reproduce the issue with synthetic data. If a metric label includes a tenant identifier, verify that the identifier itself is approved for the monitoring system and retention period.

  • Review new paths whenever a model, endpoint, worker, cache, or integration is added.
  • Run negative tests as a release gate, not only during an annual review.
  • Require separate approval for emergency debugging or direct database access.
  • Recheck the design after schema, framework, driver, or region changes.

Frequently asked questions

What is the first verification step?

Inventory every path that reads, writes, exports, queues, restores, or supports tenant data. Then trace how each path obtains tenant membership. The first stop condition is an unscoped query or a browser-supplied identifier used as authority.

Which source detail could change this answer?

Provider feature behavior, database configuration, service roles, backup semantics, and application code can change. Recheck the MongoDB documentation and the deployed configuration as of the review date. Do not reuse an old assessment after a material data-model or access change.

What must be approved before production?

A security owner must approve the threat model, test results, residual risk, data locations, support process, and recovery procedure. Legal counsel must separately review the role and contract chain. Technical evidence does not replace that review.

References

  • MongoDB, HIPAA Compliance for Atlas, retrieved 2026-08-15: https://www.mongodb.com/docs/atlas/architecture/current/compliance/hipaa/
  • U.S. Department of Health and Human Services, Guidance on Risk Analysis, retrieved 2026-08-15: https://www.hhs.gov/hipaa/for-professionals/security/guidance/guidance-risk-analysis/index.html
  • Electronic Code of Federal Regulations, 45 CFR 164.308 Administrative Safeguards, retrieved 2026-08-15: https://www.ecfr.gov/current/title-45/subtitle-A/subchapter-C/part-164/subpart-C/section-164.308

Firestore Rules vs Admin SDK for Multi-Tenant Services

Short answer: Firestore Security Rules govern supported client access paths, while a server-side Admin SDK path uses privileged credentials and still needs application membership and tenant authorization. As of 2026-08-15, Google Cloud documents Firestore locations and covered-product scope, and HHS describes cloud shared responsibility. Rules, a BAA, or a database location do not make an Admin SDK service safe by themselves.

Isolation model and threat boundary

Rules are not a universal boundary around Firestore data. Client SDK calls may be evaluated against Firestore Security Rules. A trusted server using Admin SDK operates through a privileged path and must enforce membership, tenant scope, role, region, and minimum necessary data in application code and server configuration.

Google Cloud’s Firestore Locations page informs location and regional design, while its HIPAA page describes covered products and shared responsibility. HHS Cloud Computing and HIPAA guidance explains that cloud configuration and customer use remain important. These sources support a bounded architecture review, not a statement that a Rules file or a BAA makes the service compliant.

Define the threat boundary: browser client, public API, server worker, Admin SDK, report job, export, support tool, backup, restore, and administrative console. For each path, identify identity, tenant resolution, query scope, write scope, log, key, region, and retention. A client-only proof covers one path.

Path Authority Required proof
Client SDK Authenticated user plus Rules Allowed and denied Rules tests
Public API Server membership and data policy Wrong-tenant request denial
Admin SDK Service identity and application checks Privileged-path matrix
Recovery Backup and restore operator Location, key, and tenant test

Compare Firestore database proof, PostgreSQL RLS, and authenticated jobs.

Enforcement path and bypasses

Server authorization begins before the Admin SDK call. Authenticate the caller or job, resolve membership and immutable home region from trusted records, validate operation and document scope, then perform the read or write. Do not use a browser-supplied tenant path as proof. A document path can be syntactically correct and still belong to another tenant.

Use one authorization helper for application paths, but review every caller: API route, scheduled job, queue consumer, report, export, support tool, migration, webhook, and background worker. An Admin SDK credential can be broader than a client role, so its access should be narrowed by service identity, project, collection, query, and explicit membership checks.

Keep data minimum necessary. An approved generic conversion record may use event type, time, currency, value, and an opaque reference. Do not send patient names, email addresses, phone numbers, hashed identifiers, service names, treatment details, or clinical text to advertising systems. Rules do not authorize any external disclosure.

request or job
  -> identity and membership lookup
  -> immutable tenant and home region
  -> scoped Admin SDK operation
  -> redacted audit event
  -> approved queue, backup, or export path

Audit, restore, support, and offboarding

Privileged paths need stronger evidence than client demos. Create two synthetic tenants and test client read, server read, Admin SDK read, write, update, delete, batch, report, export, backup, restore, support, and migration operations. Attempt wrong tenant, missing membership, expired identity, changed region, and broad collection access.

Audit service identity, tenant, operation, decision, timestamp, reason code, export, restore, support approval, and rule changes. Avoid full documents in logs. Review who can change Rules, service accounts, project IAM, keys, backup settings, and collection indexes. A Rules update can improve a client path while leaving an Admin SDK bypass unchanged.

Restore is a separate authorization environment. Recreate roles, membership, keys, region controls, and application policies before reading the restored data. Test a backup operator who cannot perform ordinary application reads, and an application role that cannot restore. Delete synthetic copies after the test and document required retained evidence.

Offboarding should find live documents, queues, exports, backups, logs, and test projects. Rules do not delete records, and Admin SDK permissions do not decide retention. Apply customer contract, risk, legal hold, and deletion policy through an approved workflow.

Runnable proof tests

The proof must make the Admin SDK path fail when membership is absent.

  1. Create synthetic data for tenant A and tenant B.
  2. Read each tenant’s data through the client path and test Rules denial.
  3. Read through the public server path and test membership denial.
  4. Call the Admin SDK worker as tenant A and attempt tenant B.
  5. Run report, export, batch, queue, backup, restore, support, and migration tests.
  6. Change Rules and IAM separately and confirm both paths remain covered.
  7. Inspect logs, keys, locations, and offboarding evidence.

Record which layer enforced every result. If the Admin SDK path remains application-enforced, say so. The accurate claim is that the path has named checks and passing negative tests, not that client Rules protect all server operations.

Build an authorization catalog beside the collection model. List client collection reads, public API routes, scheduled jobs, queue consumers, report queries, exports, support actions, migrations, backup, restore, and admin operations. For each path, identify identity, tenant source, region, document scope, fields returned, audit event, and denial test. A Rules file is only one row in this catalog.

Use two synthetic tenants and vary the caller. Test client Rules, server membership, Admin SDK service identity, missing membership, changed tenant path, changed region, broad collection query, batch operation, and report. Then remove a rule or narrow an IAM permission and verify that the other layer still behaves as expected. This catches false confidence from overlapping controls.

Protect recovery and support separately. Restore data into an isolated target, install membership and role controls before reading, and audit the operator. A support export should have a tenant scope, reason, expiration, approval, and deletion step. Offboarding should enumerate documents, queues, exports, backups, logs, and test copies. Rules do not perform those lifecycle actions.

Keep data minimization independent of Firestore authorization. An approved generic conversion event may use event type, time, currency, value, and opaque reference. Do not add patient name, email, phone, hashed identifier, service name, treatment detail, or clinical text to a server job or advertising payload. The Firestore location guide adds the geographic boundary that Rules do not provide.

Review cost and operations after the proof. Count reads, writes, indexes, storage, backups, logs, keys, exports, Admin SDK calls, support, and regional resources. Recheck current provider pages before a migration or quote. The final statement should say which path is protected by Rules, which is protected by application checks, and which remains privileged.

Frequently asked questions

Do Firestore Rules protect Admin SDK?

Do not assume that. Server-side Admin SDK calls are privileged application paths. They still need server-side membership, tenant, role, region, query, export, and support controls.

Is an Admin SDK service account always too broad?

Not necessarily, but its permissions and application checks must be deliberately scoped and tested. Separate ordinary service, report, export, support, migration, and restore identities.

Does a Firestore location solve authorization?

No. Location addresses geography. It does not prove membership, document scope, server roles, logging, backup, restore, or external disclosure.

What should be approved before production?

Engineering should prove client and server negative tests, privileged roles, export, restore, support, logging, and location. The customer and counsel should approve data, contract, transfer, and retention questions.

References