[ MSP, APIs & integrations ]

API authentication and scoped access to domain data

Grant report access by tenant and operation, then test denials as carefully as successful reads.

By the EmailAuth research team · 2 min read

[ Key points ]

  • Grant report access by tenant and operation, then test denials as carefully as successful reads.
  • A successful login or report read grants neither cross-tenant access nor DNS write authority; recheck delayed work and exported artifacts.
On this page

Authentication proves something about the caller. Authorization determines whether that caller may retrieve this customer's reports or perform this operation. A valid API credential must not become a shortcut around tenant boundaries. Begin with a permission matrix before adding endpoints or background jobs.

Bind identity to the requested object

Resolve the caller's identity through the supported authentication mechanism, then obtain its authorized tenant and operation scopes from trusted server-side state. Treat a tenant ID in a URL or request body as a requested target, not proof of permission. Check the report, export job and download artifact against the caller's actual grant.

OWASP's Authorization Cheat Sheet recommends least privilege, deny by default and permission validation on every request. Apply those principles to asynchronous workers and download links as well as the first API call. An export created legitimately must not later be downloadable by a different tenant because its object ID is easy to guess.

Separate read access from change authority

A report reader may retrieve approved domain data but should not automatically gain DNS write permission. A DNS operator may need no access to stored report history. An auditor may require a restricted evidence view rather than raw messages. Document each role's allowed objects and operations, and keep secret management outside ordinary logs and exports.

Suppose an automation credential is approved only to read tenant A’s reports. A DNS change for tenant A and a report read for tenant B both need denial under that grant, despite valid authentication. A separate, explicitly approved operator grant would need its own object and operation checks. These are hypothetical expected decisions, not an implemented permission matrix or a description of EmailAuth roles.

Make negative tests part of acceptance

Run the allowed same-tenant report read, then change only the requested tenant. Repeat with a missing read scope and with a revoked principal. Also plan real tests for object-level IDs, stored exports, queued jobs and changed group membership. Use authorized synthetic tenants and harmless data rather than probing another customer's account.

Record the actual decision and any disclosed response fields for each authorized test. A rejected request must not leak private object details through metadata, counts, download links or cached results. Include a valid scoped read to distinguish correct enforcement from an endpoint that denies everyone. No token system, OAuth flow or production authorization test is supplied or executed here.

Operate the grant through its lifecycle

Record grant owner, approved purpose, tenant scope, expiry or review trigger and revocation path. Store credential material in the approved secret system, rotate under a controlled procedure and audit use without recording the secret itself. Recheck authority when executing delayed work; a queued task should not retain permissions indefinitely after revocation.

Review the underlying data sensitivity. RFC 9990 describes aggregate report content and security considerations; report metadata still deserves controlled disclosure. On an authorization failure, return an appropriate denial without confirming another tenant's private objects. If cross-tenant data is discovered, contain the exposure and invoke the organization's incident procedure. Do not simply alter the UI and assume the API is safe.

OWASP’s multi-tenant guidance, especially its asynchronous-work, cache/session and file-storage sections, supports enforcing scope beyond the initial request and rechecking time-sensitive permissions during delayed execution.

[ Takeaway ]

A successful login or report read grants neither cross-tenant access nor DNS write authority; recheck delayed work and exported artifacts.

[ By role ]

What this means for you

Choose your role for practical next steps.

IT / Mail Admin

Test objects beyond the first endpoint

Exports and background work extend the access path.

Next steps

  1. Check artifact retrieval.
  2. Revoke test access.
  3. Verify cache partitioning.

CISO / SecOps

Use least privilege throughout

Authorization must survive retries and role changes.

Next steps

  1. Review scope drift.
  2. Audit privileged use.
  3. Exercise incident containment.

Founder / Non-technical

Budget for isolation testing

Tenant separation is a customer promise.

Next steps

  1. Approve a permission model.
  2. Require denial evidence.
  3. Assign grant owners.

[ FAQs ]

Frequently asked questions

Does a valid token authorize every tenant?

No. Authorization must bind the caller to the specific tenant, object and operation.

Is a tenant ID in the request trustworthy?

It identifies the requested target; it does not establish a grant.

Should report readers edit DNS?

Not unless a separate explicit permission authorizes that operation.

What negative cases are included?

Plan cross-tenant requests, missing report scope and revoked identity as expected denials, alongside a valid scoped read. Observe the actual service results.

Does the example test OAuth?

No. It explains authorization decisions without supplying or executing an authentication implementation.

Must queued jobs recheck access?

Design them to enforce current authority at execution and artifact retrieval, not only submission.

Can download links bypass review?

They need scope, lifetime and audience controls appropriate to the service.

What if a cache leaks other-tenant results?

Treat it as an authorization defect and contain it, even if the main endpoint checks permissions.

[ Sources ]

Sources

  1. OWASP Authorization Cheat Sheet

    Sections Enforce Least Privileges · Deny by Default · Validate the Permissions on Every Request · Create Unit and Integration Test Cases for Authorization Logic

  2. RFC 9990 DMARC Aggregate Reporting

    Sections §3.1 · §3.1.1.4 · §3.1.2 · §3.5.1 · §3.5.4 · §4 · §7 · §8

  3. OWASP Multi-Tenant Security Cheat Sheet

    Sections §1. Tenant Identification & Context Management · §3. Preventing Cross-Tenant Data Access (IDOR Prevention) · §4. Cache & Session Isolation · §5. API, Asynchronous Work & Resource Controls · §6. File Storage & Blob Isolation · §7. Tenant Onboarding & Offboarding Security

[ Glossary ]

Glossary

Object-level authorization
A permission decision for the specific resource requested.
Scope
A bounded permission for a type of operation or resource.

Enterprise provenance

Why top financial institutions and governments retired their email security dashboards.

Traditional email authentication platforms sell you a dashboard and ask your engineers to do the labour. In high-stakes environments, manual oversight means delayed enforcement, configuration drift and unmonitored shadow domains.

EmailAuth is the agentic email provenance platform. Our agents enforce p=reject, keep third-party senders aligned and move your domains to full RFC 9989 compliance, the new DMARC standard,, with human-in-the-loop auditability.

Governments Large enterprises Tier-1 financial institutions

SaaS · Dedicated tenancy · Air-gapped on-prem · BYOK encryption

Knowledge Base