skip to content

One API service exposes public, partner and internal tiers — how do you threat-model it and where do you invest?

level: principalimportance: should knowfreq 38%

answer

  1. one process, three attacker populations
  2. undocumented is not authorized
  3. no human watches a service account
  4. leaked credential yields the whole partner
  5. different reachability, not just a different check

basics

~20 s

Treat one deployment as three surfaces with three attacker populations, credential types and reachable operations, and model each separately. Unlisted internal endpoints on a shared listener are reachable, and a stolen machine credential is silent, long-lived and partner-wide.

solid answer

~50 s

One process can face three populations that have nothing in common, so it gets three external entities and three crossings rather than one boundary. On a freight-brokerage platform the public rate-quote endpoint faces anonymous internet callers, the partner booking API faces integrator services holding issued client certificates, and internal ops endpoints sit on the same listener. Per tier I ask who can reach it, what proves who they are, what operations it unlocks, and what a leaked credential yields. The partner tier dominates money and transaction integrity: a machine credential lives at rest in config, rotates rarely in practice, carries the whole partner's scope, and has no human to notice misuse. The internal tier's risk is that undocumented is not authorized. I invest first in giving the internal tier its own reachability and identity domain, then in uniform per-endpoint authorization, then in credential rotation and per-actor attribution for partners.

go deeper

for a junior

Be ready to say that endpoints nobody has documented are still reachable by anyone who can call the service, and that hiding a route is not the same as checking who may use it.

for a middle

Explain why one service can have several distinct attacker populations, and what a client certificate does and does not establish: which partner is calling, never which operations they may perform.

for a senior

Show how you would separate the tiers in the model and rate them: name the dominant threat and asset for each, and explain why a stolen machine credential is detected far later than a stolen user session.

for a principal

Own the investment argument. Rank the tiers by blast radius and detectability rather than threat count, and defend spending real budget on changing the internal tier's reachability instead of adding another check to a shared pipeline.

## One deployment, three different attackers A single service often speaks to populations that have nothing in common. Take a freight-brokerage platform: one service exposes a **public** rate-quote endpoint that anyone on the internet can call, a **partner** booking API that carrier integrators call machine-to-machine with issued client certificates, and **internal** operations endpoints that the ops team's tooling uses — reachable on the same host and the same listener as the other two. Because it is one codebase and one deployment, it gets drawn as one box with one boundary. That drawing hides the whole question. The right model gives each tier its own external entity, its own crossing, and its own row in the analysis, because the three differ on everything that decides a threat: who can reach it, what proves who they are, what operations it unlocks, and what happens when its credential leaks. | Tier | Attacker population | Credential shape | Dominant threats | Asset at stake | |---|---|---|---|---| | Public | Anyone on the internet, unauthenticated | None, or an unauthenticated key | Denial of service, probing for reachable non-public routes, scraping | Availability and pricing information | | Partner | A compromised or malicious integrator's service account | Long-lived machine credential, e.g. an issued client certificate | Spoofing at the edge, then tampering with bookings and rates; weak repudiation | Money and transaction integrity | | Internal | An authenticated tenant who guesses or finds the route | Whatever the other tiers use, since it is the same listener | Elevation of privilege, cross-customer information disclosure | Cross-customer data and trade-secret metrics | ## What changes when the client is a machine The partner tier is where senior candidates earn the question, because machine-to-machine identity behaves differently from a human session in ways a threat model must record: - **The credential is at rest somewhere.** It lives in a config file, an image, a CI variable or an operator's laptop, so its exposure paths are deployment paths, not phishing paths. - **It effectively never expires.** Rotation requires a coordinated change with an outside company, so in practice it is long-lived. Model the *actual* rotation cadence, not the policy. - **Its scope is the whole partner.** There is no per-user narrowing, so theft yields everything the integration can do, immediately. - **No human is behind it.** There is nobody to notice a strange login, no interactive step-up to interpose on a sensitive action, and no session that ends when someone closes a laptop. - **Attribution collapses.** Many humans at the partner act behind one account, so the audit trail answers "which partner" and not "which person" — a repudiation problem when a disputed booking or a manipulated rate has to be reconstructed. Note what the certificate does and does not establish: it identifies *which partner is calling*. It says nothing about which operations that partner may perform or which loads they may touch — those are still per-endpoint authorization decisions on the other side of the crossing. ## Why the internal tier is usually the finding Internal endpoints that share a listener with authenticated tiers are reachable by every authenticated caller. "Undocumented" narrows discovery; it is not an authorization decision, and routes surface through error messages, client bundles, path guessing and ordinary curiosity. The sharpest version of this appears in a product-analytics platform whose cross-customer benchmarking endpoints — built for the company's own dashboards, never listed in the public API reference — return aggregated funnel and revenue metrics across all customers. A rival company that is also a paying tenant authenticates normally, calls the unlisted route, and reads competitors' trade-secret metrics. Nothing was breached in the usual sense; the tier was never modeled as a surface, so nobody asked what proved the caller was allowed to be on it. ## Where to invest, and how to defend the choice Three levers, in rough order of return: 1. **Give the internal tier a different reachability**, not just a different check: its own listener, network path and identity domain. This is the only change that survives a future authorization bug in the shared pipeline, and it is the one worth spending a real budget on. 2. **Enforce per-endpoint authorization uniformly on what remains**, with the tier recorded as an explicit property of every route so that "which surface is this on?" is answerable from the code rather than from folklore. 3. **Make partner credentials operable**: a rotation path you have exercised, per-actor context that the partner passes and you log, and monitoring of the partner's behaviour envelope, since no human will report the anomaly for you. Defend the ranking with blast radius and detectability rather than threat counts. The public tier has many attackers and little to steal; the partner tier has few attackers and direct access to money, with the slowest detection; the internal tier has a large authenticated population and material that was never meant to be cross-customer. That is a prioritization argument an architecture review can act on, and it is what "threat-model this" is really asking for. ## The failure to avoid Do not answer with one boundary because it is one process. Deployment topology is a fact about convenience; the attacker population is a fact about exposure, and the model follows the attackers.

  • What changes in your threat model when the caller is a machine rather than a person?
    The credential sits at rest in config, images or CI variables, so its exposure paths are deployment paths. It rotates rarely because rotation needs another company's cooperation, its scope is the whole integration rather than a session, and there is no human to notice odd behaviour or to interpose a step-up. Attribution also collapses: many people act behind one account, weakening non-repudiation.
  • The internal endpoints are only referenced by an internal dashboard. Is that a mitigation?
    No. Obscurity narrows discovery, not access. Routes leak through client bundles, error messages, path guessing and old documentation, and the moment one is found the only thing standing between an authenticated tenant and cross-customer data is a check nobody wrote. Record it as an unmitigated elevation-of-privilege threat, not as a control.
  • How do you justify splitting the internal tier out when the team says it is one codebase?
    Argue reachability and blast radius rather than tidiness. A separate listener, network path and identity domain is the only change that still holds if the shared authorization pipeline gets a bug, and it shrinks the authenticated population that can even address those routes from every tenant to a handful of operators.

saying these in an interview costs you the question

  • Draws one surface because it is one deployment
  • Treats undocumented endpoints as unreachable
  • Says a client certificate limits what the caller may do
  • Assumes machine credentials rotate on the stated schedule
  • Accepts one shared partner account with no per-actor attribution

context