A background report needs its own authorisation boundary
Create two fictional SaaS customers and a report service that queues a background job after an authenticated user selects an account. The front-end correctly rejects an unrelated customer ID, but the worker runs with a broader service credential and writes a report into object storage. The test must check the queued parameters, worker-side tenant enforcement, destination path and resulting download link; validating only the browser screen is insufficient. Include a legitimate shared-service account that processes jobs for many tenants without being allowed to mix their underlying records. Ask what happens if a user changes tenant membership after submitting the job but before downloading the result. The product team should define whether permission is rechecked at generation, delivery and each download. Use synthetic customer rows so the exercise proves boundary enforcement without exposing real data.
Map the system and its dependencies
Two concrete operations define the boundary. First, an authenticated customer administrator requests and downloads one fabricated report for its own tenant. Second, a guessed job identifier or reused signed download URL reveals a different tenant’s report after the queue completes. The assessor should use this actual evidence set: Inspect JWT tenant claims, queued-job owner, worker principal, object storage ACL, signed URL scope and download audit. to identify the receiving system and distinguish the permitted transaction from the prohibited one. The proposed correction is: Enforce ownership at job submission, execution and download, with expiring links and independent deny tests.
Agree the operational safeguards
The tangible business objective is: Customers must be able to produce their own reports without exposing another organisation’s information. A restriction would have to preserve the approved action: An authenticated customer administrator requests and downloads one fabricated report for its own tenant. The proposed improvement is: Enforce ownership at job submission, execution and download, with expiring links and independent deny tests.
An appropriately scoped exception might be required because legitimate delegated accountants may access several tenants under explicit client assignment. It should be tied to the current approved activity: An authenticated customer administrator requests and downloads one fabricated report for its own tenant. The exception must not permit: A guessed job identifier or reused signed download URL reveals a different tenant’s report after the queue completes.
Positive and negative test cases
Build a positive case from this authorised operation: An authenticated customer administrator requests and downloads one fabricated report for its own tenant. Construct a negative case using: A guessed job identifier or reused signed download URL reveals a different tenant’s report after the queue completes. Relevant observations: Inspect JWT tenant claims, queued-job owner, worker principal, object storage ACL, signed URL scope and download audit. Final condition: Customers must be able to produce their own reports without exposing another organisation’s information.
Reconcile the result
Final responsibility sits with saaS product security lead and report-service engineer. Retain the evidence set: Inspect JWT tenant claims, queued-job owner, worker principal, object storage ACL, signed URL scope and download audit. The improvement is: Enforce ownership at job submission, execution and download, with expiring links and independent deny tests. Retest the unsafe path: A guessed job identifier or reused signed download URL reveals a different tenant’s report after the queue completes.
After implementation, rerun this practical test: Test create, status, download and cancel endpoints for tenant A and B, including an expired signed URL. Confirm the final business result: Customers must be able to produce their own reports without exposing another organisation’s information. Deny this operation after the change: A guessed job identifier or reused signed download URL reveals a different tenant’s report after the queue completes.
Assessment worksheet
Mark checks as passed, failed or untested.
- Service sponsor: SaaS product security lead and report-service engineer
- Current situation: A SaaS platform produces financial reports through background workers that read tenant data and store archives in object storage.
- Permitted result: An authenticated customer administrator requests and downloads one fabricated report for its own tenant.
- Unsafe result: A guessed job identifier or reused signed download URL reveals a different tenant’s report after the queue completes.
- Evidence sources: Inspect JWT tenant claims, queued-job owner, worker principal, object storage ACL, signed URL scope and download audit.
- Qualifying exception: Legitimate delegated accountants may access several tenants under explicit client assignment.
- Controlled improvement: Enforce ownership at job submission, execution and download, with expiring links and independent deny tests.
- Positive and negative test: Test create, status, download and cancel endpoints for tenant A and B, including an expired signed URL.
- Exit and retest: Customers must be able to produce their own reports without exposing another organisation’s information.
When the primary contact is unavailable
Accountable authority: SaaS product security lead and report-service engineer. The original control assumption needs testing: The UI filters other customers but the worker trusts a tenant identifier in the API request body. A reliable review should include technical evidence from inspect JWT tenant claims, queued-job owner, worker principal, object storage ACL, signed URL scope and download audit. and an acceptance decision that the legitimate action still functions: An authenticated customer administrator requests and downloads one fabricated report for its own tenant. The requested security improvement is: Enforce ownership at job submission, execution and download, with expiring links and independent deny tests.
For independent assurance, demonstrate the precise experiment: Test create, status, download and cancel endpoints for tenant A and B, including an expired signed URL. The analyst should correlate the result with inspect JWT tenant claims, queued-job owner, worker principal, object storage ACL, signed URL scope and download audit. A successful test must preserve an authenticated customer administrator requests and downloads one fabricated report for its own tenant. without accepting a guessed job identifier or reused signed download URL reveals a different tenant’s report after the queue completes.
Ten tests should isolate ten distinct failure modes
Structure the matrix as separate cases rather than ten variations of the same request: wrong tenant in job payload; a stale worker token; predictable report identifier; orphaned download link; cancelled subscription; role downgrade while queued; object-storage path traversal; retry after timeout; cached report from an earlier customer; and cross-region processing after migration. Each case needs one normal success path and one clearly prohibited outcome. An asynchronous API may accept a task immediately but later generate an unauthorised file; therefore inspect both the API response and eventual object. Record which check rejects the request and which merely logs it. Avoid treating a 200 status code or an empty error message as proof of safe handling. Use explicit test identities, tenant labels and job IDs so failures can be reproduced without guessing.
Expiry and cancellation are part of the product contract
Introduce a synthetic customer that withdraws a report permission halfway through a large job. Decide whether the worker must stop, finish without making the output available, or reauthorise the user at completion; document the expected behaviour before running the test. Then rotate the report service’s credential and see whether cached artefacts can still be fetched through previously issued signed URLs. If a short-lived link remains available for a documented business reason, the exception needs a stated lifetime and independent scope check. Inspect content-distribution caching, batch storage and support-tool previews as well as the primary bucket. The closeout result should identify artefact deletion, access-log retention and any limitation in immediate revocation. A blocked new report request does not erase a previously generated cross-tenant extract.
The release gate belongs to the report workflow
For CI acceptance, require a complete trace from user request to worker execution and customer download for at least two tenants. Retain job payload schema, authorisation policy version, representative storage permissions and results for both permitted and denied cases. When a background worker is upgraded, replay the cancellation and role-downgrade tests rather than relying on a general unit-test pass. Give a second engineer a test customer and allow them to reproduce the denied cross-tenant download without privileged access to production. Include support staff in the threat model: if a help desk can regenerate any tenant report to investigate failures, that support operation must have its own approval and audit boundary. Product owners should not sign off the change until legitimate reporting still completes and every prohibited retrieval remains rejected.
A report retry can become a cross-tenant leak
Give the worker a simulated transient failure after it has written a report but before the job state is marked complete. On retry, the system must not select another tenant’s prior output from a shared cache or reissue a download link to the wrong requester. Compare storage object keys, tenant context and idempotency or job identifiers across both attempts. The product team should decide whether a partial report is deleted, quarantined or resumable; leaving it public while waiting for a retry is not an acceptable default. Include an administrator who can investigate the failed job without being authorised to download arbitrary tenant data. Record the correct report and denial outcome after the worker and queue service are restarted.
Cross-region failover needs the same scope checks
During a simulated cloud-region outage, queue workers may be restarted with different service credentials or storage buckets. Test whether the tenant identifier, object ownership and authorised download scope survive the failover. A backup region might restore report generation yet accidentally widen a service principal’s data rights. Use synthetic rows bearing unique tenant markers and verify that only the matching customer can obtain the output after promotion to the fallback region. Check expiry and cleanup of abandoned signed URLs from the primary region. The service owner should document expected report delay and any customer communication. A successful failover is not simply a worker queue turning green; the original customer boundary must remain enforceable throughout recovery.
Billing records must match report delivery permissions
A SaaS platform may continue processing a customer’s queued reports while its subscription is suspended or a tenant changes owner. The business and engineering teams need a documented rule for already-paid work versus new generation and download attempts. Use fictional customer records to test whether a cancelled account can request fresh work, retrieve an old output or access an unrelated tenant’s cached file. The receiving API and storage layer should enforce the same outcome. Capture both the transaction state and the service permission that produced it. This prevents a seemingly technical report change from creating inconsistent customer entitlements.
Sources and further reading
- OWASP API Security Top 10 — 2023
- NIST SP 800-218 — Secure Software Development Framework
- NIST SP 800-207 — Zero Trust Architecture
Explore Next Defence expertise
Next Defence can help SaaS teams validate the full report lifecycle, including queued jobs and signed downloads, for two fictional tenants. Test that each customer can generate and retrieve its own report while guessed job identifiers, reused download links and broadly privileged workers cannot reveal the other’s records. Record authorisation decisions at the queue, worker and download stages.