skip to content

When does a deployment diagram reveal a threat that a component diagram cannot?

level: seniorimportance: should knowfreq 44%

answer

  1. logical split versus physical placement
  2. who shares a process and a host
  3. a boundary needs an enforcement mechanism
  4. one mounted credentials file, two services
  5. localhost calls skip the gateway

basics

~20 s

A component diagram shows logical separation; a deployment diagram shows where code actually runs. Co-location threats, such as two supposedly separate services sharing one process, one host and one credentials file, appear only in the deployment view.

solid answer

~50 s

A component view tells you how the design is decomposed; it says nothing about whether that decomposition is enforced at runtime. The deployment view answers the question that actually matters for a trust boundary: is there a mechanism, a separate process, a separate host, a distinct identity, a separately scoped secret, that makes crossing it hard? I have seen two boxes drawn as independent services turn out, in the deployment view, to run in one JVM on one VM, started by one unit, reading one mounted credentials file, calling each other over localhost. Every consequence follows from that: a compromised dependency inside the low-value service holds the high-value service's credentials and memory, and the gateway drawn between them is not on the path. Draw the boundary where the enforcement is, not where the repository split is.

go deeper

for a junior

Be ready to state the difference plainly: a component diagram shows how the design is split up, a deployment diagram shows what runs where. Knowing that the second can contradict the first is the takeaway.

for a middle

Explain what makes a boundary real, a separate process, host, identity or scoped secret, and give one concrete consequence of two components sharing a process. This is the tier where you connect the diagram to the enforcement mechanism.

for a senior

Walk the compromise chain out loud: shared process to shared memory to shared credential to downstream rights, and name the bypassed control. Then commit to one of the two fixes, redraw the boundary or change the deployment, and say which you would pick here and why.

for a principal

Own when a deployment view is mandatory in your review process and how it is kept honest without becoming a stale inventory. Be ready to defend accepting deliberate co-location for a whole class of low-value services while forbidding it around one asset.

## Two views, two different questions A **component diagram** answers: how is this system decomposed, and which part depends on which? A **deployment diagram** answers: what actually runs, where, as what identity, with what mounted next to it, reachable by whom? Threat modelling needs both, because a trust boundary is a claim about the second question that people habitually justify with the first. The rule worth stating out loud in an interview: **a trust boundary is only real if something enforces it.** A line on a diagram between two components is a hypothesis. The enforcement mechanism is a separate process, a separate host or tenant, a distinct workload identity, a separately scoped secret, or a network path that is actually mediated. If none of those exists, the boundary is decorative and every threat you dismissed as being blocked by it is live again. ## A worked case The component diagram shows two services: a public-facing content service and an internal billing service, with a gateway drawn between them and a trust boundary on that line. The deployment diagram, drawn honestly, shows something else: both are packaged into one process on one VM, started as one unit, with one credentials file mounted at a fixed path and one outbound identity used for all downstream calls. Requests between them are in-process calls, not network calls. Enumerate against the deployment view and four things fall out that the component view hid. 1. **No process boundary.** A compromised third-party dependency pulled into the content service executes in the same address space as the billing code. Anything the billing service can read, the attacker can read, including secrets already loaded into memory. 2. **Shared credentials.** One credentials file means the compromise of the least valuable component yields the rights of the most valuable one. The adversary here is a compromised dependency, not an anonymous internet attacker, and the asset is credentials and keys, which are then a step to everything those keys open. 3. **The mediated path is not on the path.** The gateway you drew, and any authentication or rate limiting it applies, is bypassed entirely, because the call never leaves the process. The control exists but sits beside the real data flow. 4. **Shared fate for availability and forensics.** One crash takes both down, one log stream mixes both, and an incident in either forces you to treat the whole host as compromised. ## What to do with the finding You have exactly two honest moves, and picking one is the judgment being assessed. - **Move the boundary on the model to match reality.** Erase the line, redraw the two components as one trust domain, and re-run the enumeration. Threats you previously marked mitigated by the boundary come back and need real answers. This is the right call when the co-location is deliberate and the blast radius is acceptable. - **Change the deployment to match the model.** Separate processes at minimum, distinct workload identities, per-component secrets scoped to what each actually needs, and a call path that traverses the mediation you drew. This is the right call when the model's boundary was load-bearing for a high-value asset. What is not acceptable is leaving a model that claims a boundary the runtime does not provide, because every later reader inherits that false assurance. ## What a deployment view needs to carry Deployment views rot faster than any other diagram, so capture only the properties that change threat conclusions: the execution unit boundaries (what shares a process, a host, a tenant), the identity each unit runs as, the scope of each secret it can read, the storage it can reach, and who can reach it on the network. A full inventory of hostnames and versions is a different artifact with a different owner and it will be stale within a sprint. The same view also routinely surfaces two other blind spots: the same credential reused across environments, so a compromise in a lower environment reaches production data; and copies of a store that the logical view drew once, backups, read replicas and analytics exports, each of which needs its own boundary and its own protection. ## The related failure in the other direction Beware of treating every box on a component diagram as a trust boundary. Separate repositories, separate teams and separate deployment pipelines are organisational facts, not runtime isolation. The reverse mistake, drawing no boundary because two components are internal, is just as bad: internal is not a security property, it is a network location.

  • Suppose the two services are separate processes on the same host, each with its own identity and its own secret. Does the boundary hold now?
    Partly, and saying so precisely is the point. Separate processes with distinct identities remove the two worst consequences: no shared address space and no shared credential, so compromise of one no longer hands over the other's rights. What remains is shared fate at the host level: local privilege escalation, a shared filesystem or log directory, resource exhaustion, and one host compromise taking both. Rate that residual risk explicitly rather than declaring the boundary clean.
  • What is the minimum a deployment view needs to carry to be useful for threat modelling?
    Execution unit boundaries, so you know what shares a process and a host; the identity each unit runs as; the scope of every secret it can read; the storage it can reach; and who can reach it on the network. That is enough to decide whether each drawn boundary is enforced. Anything more, exact versions, hostnames, instance counts, is inventory that goes stale and does not change threat conclusions.
  • The team says co-location is temporary and will be split next quarter. How does that change your model?
    It does not change the model, only the plan. Model the system as it runs today, record the co-location as an accepted risk with an owner and a date, and keep the threats it re-opens on the register rather than marking them mitigated by a future state. If the split slips, the risk is still visible; if you model the intended architecture instead, the model quietly lies for as long as the delay lasts.

Two offices on a floor plan may be separate rooms, but the deployment view is the walk-through that shows they share one unlocked connecting door and one key hook.

saying these in an interview costs you the question

  • Treats every box on a component diagram as a trust boundary
  • Assumes separate repositories imply runtime isolation
  • Says co-location is fine because both services are internal
  • Misses that both components read the same credentials file
  • Claims a gateway protects calls made in-process over localhost
  • Marks threats mitigated by a boundary nothing enforces

context