Threat Modeling and Attack Surface Analysis Questions
Systematically identifying how a system can be attacked and where its exposure lies. Covers structured methodologies (STRIDE, PASTA, DREAD, OCTAVE, attack trees), enumerating and reducing attack surface, mapping trust boundaries and data flows via DFDs, profiling likely threat actors, and prioritizing identified threats by likelihood and impact during design. Includes applying this methodology to specific architectural substrates (cloud-native and serverless, microservices, ML/AI systems, IoT, CI/CD pipelines, cryptographic subsystems) and operationalizing it as a recurring program (SDLC integration, governance, tooling, KPIs). The proactive 'think like an attacker before you build' discipline: distinct from live penetration testing (the adversarial validation of a built system), from runtime detection/monitoring (recognizing an attack already in progress), and from implementing the resulting security controls (a separate design-and-build discipline).
Design a prioritized remediation roadmap for a multi-cloud organization with a limited number of security engineers. Include decision criteria for prioritization (risk reduction per effort), use of compensating controls, acceptance and escalation processes, realistic timelines, and communication strategies for engineering teams and executives.
Sample Answer
Direct answer
With a small security team and a large multi-cloud finding backlog, the roadmap has to start from an honest capacity calculation, not a wish list: figure out how many findings the team can actually close per quarter, and the number will almost always be far below the backlog size, which is exactly the argument for prioritizing by risk-reduction-per-effort, using compensating controls to buy time on everything else, and building a real acceptance and escalation process instead of pretending a fixed team will eventually get to everything. The roadmap below is staged in four non-overlapping quarters across the year, with the first quarter spent on the highest-leverage quick wins and the compensating-control program that has to run in parallel with, not after, the deeper remediation work.
Structured elaboration
Decision criteria: risk reduction per effort
Score every finding by likelihood times impact (drawing on the underlying threat model or vulnerability data), then divide by an effort estimate (in person-days, or a rough T-shirt size, small/medium/large, converted to a days estimate) to get a risk-reduction-per-effort ranking. This surfaces two categories worth calling out explicitly: quick wins (low effort, real risk reduction, close these first almost regardless of absolute severity) and the small number of expensive, high-severity items that will dominate the schedule if tackled too early, before the quick wins have freed up the team's near-term capacity.
Compensating controls
For anything not getting a full remediation this cycle, a compensating control is what keeps the risk register honest rather than just deferred: a web application firewall rule ahead of an unpatched application, network microsegmentation limiting blast radius while an access-control overhaul is still in progress, additional host-based monitoring on an asset awaiting a deeper fix, or a temporary break-glass access process with strict logging in place of a slower, more permanent least-privilege redesign. Every compensating control needs a review date; without one, "temporary" becomes the permanent state of the risk register.
Acceptance and escalation
- Every remediation ticket carries a named owner, an effort estimate, whatever compensating control is covering the gap in the meantime, and a rollback plan.
- Low-to-medium residual risk can be formally accepted by the service owner together with the security lead; this keeps routine risk-acceptance decisions from bottlenecking on a single approver.
- High residual risk escalates to the Chief Information Security Officer (CISO) or equivalent senior security leadership and to infrastructure operations leadership, with a defined service-level agreement for how fast a mitigation plan has to be produced (not necessarily implemented immediately, but at minimum planned and committed to).
Realistic timelines
Build the roadmap around what the team can actually close, not around the full backlog, and be explicit with stakeholders about the gap between the two:
- Q1 (months 1-3): triage and quick wins, exposed credentials, publicly-reachable storage misconfigurations, missing multi-factor authentication, plus standing up the compensating-control program itself (web application firewall rules, initial microsegmentation, monitoring gaps closed).
- Q2 (months 4-6): higher-effort, higher-risk patches; cloud security posture management (CSPM) tooling and infrastructure-as-code scanning wired into the deployment pipeline so new findings of the same shape stop arriving.
- Q3 (months 7-9): identity and access management overhaul (least-privilege redesign), automated secrets rotation, deeper network segmentation.
- Q4 (months 10-12): remaining backlog by risk-reduction-per-effort, purple-team validation of everything remediated so far, and runbook updates.
Communication
- Engineering teams get weekly ticket-level notifications with clear remediation steps and a standing time for blockers (office hours or an equivalent channel), so the roadmap doesn't just land as a mandate with no support.
- Executives get a monthly dashboard: top residual risks, a trending risk-reduction metric over time, and explicit resource or budget asks tied to what the current team's capacity actually allows, with any critical finding getting an immediate out-of-cycle briefing rather than waiting for the next monthly update.
Worked example
Three security engineers, an illustrative backlog of 900 open findings across the three cloud providers, and an average remediation effort of 1.5 person-days per finding (a mix of quick configuration fixes and deeper architectural changes):
Assume each engineer has roughly 60 working days per quarter available in total, and that only half of that time goes to this backlog (the rest is incidents, reviews, and other ad hoc security work, which is the realistic case, not the idealized one):
capacity (person-days/quarter)=3×60×0.5=90 findings closeable/quarter=1.590=60Over four quarters: 60×4=240 findings closeable against the 900-item backlog, which is 27% of the current backlog closed in a year, assuming no new findings arrive in the meantime (they will, which only strengthens the point). That 27% figure, not a promise to "get through the backlog," is what belongs in the roadmap's executive summary: it is the honest basis for arguing that risk-reduction-per-effort prioritization and compensating controls are not optional nice-to-haves, they are the only way the team's real capacity produces meaningful risk reduction instead of an unfinished checklist. The four quarters (months 1-3, 4-6, 7-9, 10-12) partition the year with no gaps or overlaps, so the roadmap's calendar commitments are internally consistent with the capacity math behind them.
Trade-offs and pitfalls
- A roadmap sized to the full backlog instead of real capacity sets the team up to visibly fail, which erodes trust with both engineering and executives faster than an honest, capacity-based roadmap that under-promises and delivers.
- Compensating controls without a review cadence quietly become the permanent state, and a risk register full of "temporarily mitigated" items that were never revisited is functionally indistinguishable from an unmanaged backlog, just with worse visibility.
- New findings will arrive faster than 60 per quarter in most active multi-cloud environments, meaning the 27% figure is optimistic even on its own terms; the CSPM and infrastructure-as-code scanning work in Q2 exists specifically to reduce the rate of new findings, not just work down the existing pile, and that should be named explicitly rather than left implicit.
- Escalation thresholds need to be concrete, not vibes-based. "High residual risk escalates to the CISO" only works operationally if the roadmap defines, in advance, what counts as high (tied to the same risk scoring used for prioritization), or every escalation becomes its own negotiation.
- Common wrong turn: presenting the roadmap as if 12 months clears the backlog, which the capacity math above shows is not close to true, and which sets up an entirely avoidable credibility problem the first time someone checks the numbers.
You completed a threat model and found several moderate risks where mitigation would significantly degrade an important user workflow. How would you communicate the residual risk to engineering leadership and product managers, and what decision framework would you use to accept, mitigate, defer, or transfer each risk?
Sample Answer
Direct answer
Residual risk is what remains after controls are applied, the gap between the risk the threat model originally identified and the risk actually removed by the mitigations shipped. When full mitigation would break an important workflow, the job isn't to hide that gap, it's to quantify it, compare it against thresholds set in advance at the right level of the organization, and bring engineering leadership and product managers a specific, bounded decision (accept, mitigate further, defer, or transfer) rather than an open-ended risk list with no recommendation attached.
Structured elaboration
Quantifying residual risk after controls: start from the inherent risk score the threat model produced (using whatever likelihood-times-impact method the model used, for example a risk matrix score), then re-score likelihood and impact given the controls actually shipped, not the controls originally proposed. The difference between inherent and residual score is the risk the mitigation removed; the residual score itself is what needs a decision. This re-scoring should use the same method and the same people's judgment calibration as the original scoring, so the before-and-after comparison is actually apples to apples rather than two independently drifting estimates.
Setting acceptable thresholds at team, product, and enterprise levels: these three levels exist because the same residual risk score should not always require the same level of sign-off.
- Team level: the engineering team and its lead can accept low residual risk on internal, low-blast-radius findings without escalating, provided the acceptance is still logged.
- Product level: the product manager and a security representative jointly decide on moderate residual risk that affects a specific product's users or workflow, which is exactly the scenario this question describes, since a workflow-degradation trade-off is fundamentally a product decision informed by a security input, not a security decision alone.
- Enterprise level: risk that crosses regulatory lines, affects multiple products, or exceeds a defined severity threshold escalates to a cross-functional or executive body, since no single team or product manager should be able to unilaterally accept risk at that scale.
Defining these thresholds before a specific finding arrives is what prevents each individual decision from becoming an ad hoc negotiation; the threshold, not the personality in the room, should determine where a given finding needs to go.
Executive-level metrics: leadership doesn't need the full finding-by-finding detail; they need a small number of trend metrics: total residual risk score across the portfolio over time (is it trending down), the count and aggregate score of risks currently accepted above the team-level threshold (is acceptance being used appropriately or as a way to avoid remediation work), and time-in-accepted-state for the oldest open acceptances (a risk accepted eighteen months ago with no re-review is a governance gap, not a closed item).
The decision framework: accept, mitigate, defer, transfer
- Accept: residual risk is at or below the threshold for the appropriate level (team, product, or enterprise), and the cost of further mitigation clearly exceeds the risk reduction it would buy. Requires a named accepting owner and a review date, not a silent drop from the tracker.
- Mitigate further: residual risk exceeds the threshold and a reasonable-cost path to reduce it exists that doesn't require the workflow-breaking change already ruled out; look specifically for compensating controls (added monitoring, rate limiting, additional authentication for the specific risky action) that reduce risk without the all-or-nothing trade-off the original full mitigation presented.
- Defer: residual risk exceeds the threshold, but a specific, funded remediation is scheduled within a committed timeframe, and the interim exposure is judged tolerable for that bounded window. Deferral without a committed date and owner is functionally the same as silent acceptance and should not be recorded as deferral.
- Transfer: the cost of any technical mitigation exceeds the risk, and a non-technical option meaningfully reduces the organization's exposure, insurance, a vendor contract with liability terms, or shifting the risky workflow to a third party better positioned to bear it.
Documenting and obtaining approval: for each finding routed into this framework, record the inherent risk score, the residual risk score after applied controls, the specific reasoning for the chosen path (accept, mitigate, defer, or transfer), the accepting or deciding owner by name and role, and a review date. This record should be produced before the decision is finalized, not reconstructed afterward, since a decision made without writing the reasoning down first tends to skip exactly the trade-off analysis this process exists to force.
Worked example
Concretely applying this to the question's scenario: the threat model, run using Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege (STRIDE) analysis, surfaced several moderate risks. One specific finding: an Elevation of Privilege risk where the full technical fix (requiring re-authentication before a sensitive in-workflow action) would add friction that testing shows meaningfully increases user drop-off for a workflow the product depends on. Assume illustrative inherent and residual scores using a five-point likelihood-times-impact matrix: inherent risk before any control was Likely (4) times Major (4), a score of 16. A partial, non-blocking control already shipped: additional logging and anomaly detection around the sensitive action. Because that control detects rather than prevents, it does not change how often an attacker succeeds at the elevation, so likelihood stays Likely (4); what it changes is how much damage a successful elevation does before someone notices and revokes it, which moves impact from Major (4) down to Moderate (3), a residual score of 12. Getting that direction right matters: crediting a non-blocking detective control with a likelihood reduction is the most common way a residual score ends up flattering the controls that actually shipped. Say the product-level threshold for requiring product-manager sign-off (rather than team-level acceptance) is a score above 8; this residual score of 12 clears that threshold, so it's brought to the product manager and engineering lead together, not resolved by the engineering team alone. Given limited remediation budget and the specific workflow-impact trade-off, the recommended path is Defer: commit to shipping the friction-adding fix in a scoped, lower-impact form (for example, requiring the extra step only for higher-value actions within the workflow rather than all of them) within a defined window, with the anomaly detection control serving as the interim compensating measure. That recommendation, its owners, and its review date get logged before anyone signs off on it, so this specific decision is auditable later.
Trade-offs and pitfalls
The most common failure in this area is presenting leadership a list of risks with no recommendation and asking them to choose, which pushes a technical trade-off analysis onto people who aren't positioned to make it and tends to produce delay rather than a decision; a senior answer always brings a specific recommended path, even when the final call belongs to product or leadership. A second pitfall is treating "accept" as a one-time event rather than a time-bound state: without a mandatory review date, accepted risks accumulate indefinitely and the aggregate residual risk metric quietly grows even though no individual decision looked wrong in isolation. A third, specific to this scenario, is treating "the fix breaks the workflow" as a binary that only leaves accept or defer on the table; the framework above deliberately looks for a scoped or partial mitigation first (limiting the friction to higher-value actions, in the worked example) precisely because the full fix and no fix are rarely the only two options, and skipping that search is how organizations end up accepting more risk than they actually needed to.
You discover a high-severity vulnerability that can be remediated only by disabling a widely used feature for 48 hours, which would reduce expected revenue by approximately 10%. As an SRE lead, how do you present the options to executive stakeholders, recommend a course of action, set measurable metrics to evaluate risk reduction, and plan communications and rollback? Explain how you would make the tradeoff clear and obtain buy-in.
Sample Answer
Direct answer
The core move in this scenario is refusing to present the choice as "security versus revenue," which is how it will sound if stated flatly, and instead presenting it as a bounded, time-boxed trade with a measurable exit condition: disable the feature for the shortest defensible window, define upfront exactly what "risk reduced enough to re-enable" looks like, and pair the revenue cost with a concrete estimate of what the alternative, an unpatched high-severity vulnerability sitting live, actually risks. Executive stakeholders should see two or three real options, not one recommendation presented as the only path, a clear recommendation with its reasoning, the specific metrics that will tell everyone the trade paid off, and a communications and rollback plan that removes the fear of "and then what" from the room.
Structured elaboration
Presenting options to executive stakeholders
Lay out genuine alternatives, not a single option dressed up as a choice:
- Disable the feature for 48 hours while the vulnerability is patched, accepting the roughly 10% revenue impact for that window.
- Leave the feature live with compensating controls (aggressive rate limiting, enhanced monitoring, restricting the feature to a subset of lower-risk traffic) while patching in the background, accepting a smaller but nonzero window of continued exposure in exchange for avoiding the full revenue hit.
- A partial disable, turning off only the specific code path that carries the vulnerability if the feature is separable, which may reduce both the revenue impact and the remediation timeline versus a full shutdown.
Each option should be presented with its own revenue impact, remediation timeline, and residual exposure, so the executive audience is choosing between three concretely described trades, not between "the security team's ask" and "doing nothing."
Recommended course of action
Recommend the option whose exposure-reduction-per-revenue-dollar is clearest and most defensible, which in most cases with a genuinely high-severity vulnerability is the partial disable if the feature is separable (option 3), since it captures most of the risk reduction of a full shutdown at a fraction of the revenue cost, or the full 48-hour disable (option 1) if the vulnerable code path cannot be cleanly isolated, since a compensating-controls-only approach (option 2) leaves a real, live vulnerability reachable by a sufficiently motivated attacker for the full remediation window, which is difficult to defend after the fact if it is exploited during that window.
Measurable metrics to evaluate risk reduction
- Exposure window closed: the number of hours the vulnerable path was reachable by an attacker, before versus after the action taken, which is the most direct measure of what the trade actually bought.
- Patch verification: a specific, named test confirming the vulnerability is closed (a reproduction of the original finding against the patched system, showing it no longer succeeds) before re-enabling, rather than re-enabling on a patch-deployed timestamp alone.
- Post-re-enable monitoring: a defined observation period (for example, the first 24-48 hours after re-enabling) with alerting specifically targeted at the previously vulnerable path, so a failed or incomplete patch is caught quickly rather than discovered later.
- Each of these is a concrete, checkable condition, not a vague "we'll monitor it," which is what makes the metrics section answer the executive's real underlying question: how will we know this worked.
Communications and rollback plan
- Before disabling: a short, plain-language notice to affected users or customers explaining the change and expected duration, framed around reliability or security rather than exposing internal vulnerability detail, since a vague or absent notice tends to generate more support burden than an honest, brief one.
- During the window: a status page or equivalent update if the remediation timeline shifts, so stakeholders are not surprised by a 48-hour estimate quietly becoming 72.
- Rollback plan: if the patch is not ready within the committed window, decide in advance, not in the moment, whether to extend the disable, ship a partial mitigation, or accept a defined smaller residual risk to re-enable early; having this decision pre-agreed with the executive stakeholders removes the pressure to make it under time stress on hour 47.
- After re-enabling: a brief closure communication confirming resolution, which closes the loop for the same audience that received the original notice and reduces the chance the incident resurfaces as a trust question later.
Making the trade-off clear and obtaining buy-in
Translate both sides of the trade into the same terms the executives already use. The revenue side is already in those terms (the roughly 10% figure). The security side needs the same treatment: state plainly what a successful exploit of this vulnerability would let an attacker do (for example, unauthorized access to customer data, or the ability to take actions as another user), and frame the 48-hour cost as bounded and quantifiable against an unpatched vulnerability's cost, which is unbounded and open-ended for as long as it stays live. Buy-in tends to follow once the comparison is stated as "a known, bounded cost now" versus "an unknown, open-ended cost for as long as we wait," rather than as an abstract severity rating the room has no intuitive way to weigh against a concrete revenue number.
Worked example
Say the vulnerability, if exploited, would let an attacker read other users' account data, a concrete, statable consequence. Presented to executives: "Option 1, full disable, costs an estimated 10% of revenue for 48 hours, roughly $X based on typical daily revenue for this feature, and fully closes the exposure. Option 2, controls only, costs under 1% of revenue but leaves the account-data-read vulnerability live for the same 48-hour patch window, exploitable by anyone who finds it during that time. Option 3, if the vulnerable path is separable from the rest of the feature, likely costs 2-4% of revenue and closes the exposure as fully as Option 1." With those three trades stated in comparable terms, the recommendation (option 3 if separable, otherwise option 1) becomes a specific, arguable claim rather than an appeal to authority, and the metrics section gives the room a concrete way to confirm afterward that the chosen option actually delivered the closed exposure it promised: the exposure-window and patch-verification metrics either show the vulnerability closed on schedule, or they do not, and either way the room has a fact to react to rather than a reassurance to take on faith.
Trade-offs and pitfalls
- The most common wrong turn is presenting only the recommended option, which forces executives to either rubber-stamp a decision they had no part in shaping or push back with no alternative on the table; presenting genuine options, even if one is clearly better, is what earns buy-in rather than compliance.
- Quantifying the revenue cost precisely while leaving the security cost as a qualitative severity label stacks the comparison unfairly and tends to produce a decision that under-weights the security side simply because it is the side with the harder-to-state number; the worked example's approach, stating what a successful exploit would concretely let an attacker do, is what closes that gap without fabricating a false-precision dollar figure for the security side.
- Skipping the pre-agreed rollback decision and improvising if the timeline slips is a common and costly mistake: a decision made under pressure at hour 47, with executives who were not part of the original trade-off conversation now being pulled in urgently, tends to produce worse outcomes than the same decision made calmly in advance.
- Re-enabling on a "the patch shipped" timestamp rather than a verified test result risks reopening the exposure if the patch is incomplete, which is exactly why patch verification is listed as its own metric rather than folded into "the timeline was met."
You are the security architect and need to obtain board-level acceptance for a residual-risk posture that allows certain 'medium' risks to remain for six months while mitigations are implemented. Prepare an outline of the briefing to the board: key metrics to present, remediation timeline, compensating controls, expected business impact if accepted, and the explicit 'ask' (budget, timeline, or authority).
Sample Answer
Direct answer
A board does not need, and will not sit through, the technical detail behind a risk-acceptance request; it needs enough to exercise its actual job, deciding whether the organization's exposure and the plan to close it are acceptable, in about ten minutes. The outline below covers five elements in the order a board actually consumes them: the metrics that establish scope and trend, the remediation timeline that shows this is a plan and not a shrug, the compensating controls that justify why "medium" is tolerable for the stated window, the business impact framed in terms the board already tracks, and a single, explicit, answerable ask.
Structured elaboration
1. Key metrics to present
Lead with the smallest set of numbers that establishes scope and trend, not a full findings list:
- Count and trend of medium-severity findings covered by this acceptance, shown against the prior period so the board can see whether the backlog is growing or shrinking, not just its current size.
- Time already elapsed versus time requested, since a board evaluating "six months" needs to know if this is a fresh request or a renewal of an earlier one, which changes how it should be read.
- Comparable prior acceptances and their outcomes (did previously accepted medium risks get closed on schedule, or did they slip), since a board's confidence in this request is directly informed by whether the last one delivered on its timeline.
2. Remediation timeline
A single visual timeline, not a table of tickets: milestones at roughly the 30/90/180-day marks, each tied to a concrete, checkable deliverable (a specific system patched, a specific control deployed) rather than a vague "progress will be made" statement. The timeline should make clear what closes the acceptance early versus what is the outside boundary the board is actually approving.
3. Compensating controls
Name the specific controls standing in for full remediation during the acceptance window, and be explicit about what each one does and does not cover: for example, enhanced monitoring on the affected systems catches exploitation attempts but does not prevent them, while a network-level access restriction reduces the population of people who can reach the exposure but does not eliminate the underlying weakness. The board's actual question here is "what stands between us and harm right now," and a vague "we have monitoring in place" without specifying what it would and would not catch does not answer it.
4. Expected business impact if accepted
Translate the risk into terms the board already tracks: financial exposure range, regulatory or contractual obligations at stake, and reputational exposure if realized, stated as a range grounded in the nature of the systems and data involved (what could plausibly happen, and why) rather than a fabricated single number, since a board that later checks a suspiciously precise financial figure against nothing will trust the whole briefing less. Pair this with the counterfactual: what it costs, in time, budget, or business disruption, to remediate immediately instead of over six months, since the acceptance request only makes sense in contrast to that alternative.
5. The explicit ask
End with exactly one clear ask, stated as a decision the board can make in the room: approval of the six-month window itself, budget for the remediation plan behind it, or the authority for a named executive (rather than the board itself) to approve any future extension without returning to the board. A briefing that ends without a specific ask leaves the board unsure what "approving" even means, and invites a meandering discussion instead of a decision.
Worked example
A briefing following this outline might read, in compressed form: "We are asking the board to accept 14 medium-severity findings, down from last quarter's 17, for a six-month remediation window. Compensating controls are enhanced logging and a network restriction on the affected systems, which catch and limit exploitation attempts but do not close the underlying gaps. If unaddressed longer than this window, the exposure carries potential regulatory notification obligations and a financial range consistent with our prior two incidents of this class, which cost the organization in the low-to-mid six figures each in direct remediation and notification costs. Our ask: approve this six-month window and the associated $400K remediation budget already scoped in the plan; if approved, we commit to closing at least half the findings by the 90-day mark." Every clause in that example maps to one of the five sections above, and the two prior-incident cost figures are explicitly framed as historical comparables (assumed known to the presenter from the organization's own incident record), not fabricated precision about the current, not-yet-realized risk.
Trade-offs and pitfalls
- The most common wrong turn is leading with technical detail (a full findings list, Common Vulnerability Scoring System figures, individual system names) before the board has the framing to care; boards disengage from detail they cannot act on, and the ask gets lost.
- Presenting a business-impact figure with false precision ("this risk costs the company $2.3M") without a stated basis is worse than a stated range, because a board member who probes the number and finds no basis for it discounts the entire briefing, not just that line.
- Ending without a single explicit ask is the second most common failure: a briefing that only informs, without requesting a specific decision, forces the board to guess what action is being requested, which usually means no decision gets made at all.
- A senior answer treats the board briefing as a request for a specific decision under time pressure, not a status report, and structures every section to build toward that one ask rather than toward comprehensive coverage of the underlying findings.
Perform a threat model for a flow where an external partner uploads files via SFTP to a staging bucket, an Airflow DAG triggers a Spark job in Kubernetes to transform data, and the results populate a multi-tenant analytics database. Identify top attack surfaces, mitigations for supply-chain and insider threats, and detection controls to add at ingestion, processing, and serving layers.
Sample Answer
Direct answer
This pipeline has three layers with meaningfully different trust levels: an ingestion layer where an external partner is, by definition, untrusted; a processing layer that is internally trusted but pulls in third-party code and container images, which is where a supply-chain compromise would land; and a serving layer that must keep tenants isolated from each other, which is where an insider or a processing-layer compromise could otherwise read or write across tenant boundaries. The top attack surfaces are the SFTP upload path itself (the only point a genuinely external, unauthenticated-relative-to-your-org actor touches the system), the Spark job's dependency and container-image supply chain, and the multi-tenant data boundary at the database layer, and each needs its own mitigation and detection strategy rather than one blanket control.
Structured elaboration
Pipeline layout and trust boundaries:
flowchart LR
subgraph Ingestion["Ingestion layer: untrusted external partner"]
Partner[External Partner]
SFTP[SFTP Server]
Stage[(Staging Bucket)]
end
subgraph Processing["Processing layer: internal compute plus third-party deps"]
Airflow[Airflow DAG Scheduler]
K8s[Kubernetes Cluster]
Spark[Spark Job]
Deps[(Third-party Packages and Images)]
end
subgraph Serving["Serving layer: multi-tenant"]
DB[(Multi-tenant Analytics DB)]
end
Partner -->|uploads file| SFTP
SFTP --> Stage
Stage -->|triggers| Airflow
Airflow -->|schedules| K8s
K8s -->|runs| Spark
Deps -.->|pulled at build or run time| Spark
Spark -->|writes tenant-scoped rows| DB
Top attack surfaces.
- The SFTP upload itself. This is the one place a truly external actor interacts with the system directly. Threats include a compromised partner credential uploading malicious content, path traversal or filename manipulation in the uploaded file's metadata, and the uploaded file itself carrying a payload designed to exploit whatever parses it downstream (a crafted CSV or Parquet file targeting a parser vulnerability, for example).
- The Spark job's supply chain. Airflow scheduling Spark on Kubernetes typically means pulling a container image and a set of language-runtime dependencies (Python or Java/Scala packages) at build or deploy time. A compromised or typosquatted dependency, or a compromised base image, executes with whatever privileges the Spark job's Kubernetes service account holds, which in a poorly scoped cluster can be broad.
- The multi-tenant boundary at the database. Because a single Spark job's output lands in a shared analytics database serving multiple tenants, any bug in how the job scopes its writes, or any actor (insider or compromised process) with broader-than-necessary write access, can read or write across tenant lines.
Mitigations for supply-chain threats. Pin dependency versions and container base images to specific, verified digests rather than mutable tags, so a compromised upstream package cannot silently change what gets pulled into a future build. Scan images and dependency trees for known vulnerabilities and unexpected changes before deployment, and prefer a maintained internal mirror or artifact repository over pulling directly from public registries at run time, both to reduce exposure to a public registry being compromised or going unavailable and to create a control point for scanning. Scope the Spark job's Kubernetes service account to only the permissions the job actually needs (specific namespace, specific storage paths, no cluster-admin), so a compromised dependency executing inside the job cannot pivot broadly across the cluster.
Mitigations for insider threats. The core control is least-privilege access scoped per layer: an engineer who can modify the Airflow DAG definition should not automatically also hold broad write access to the serving database, and access to the staging bucket, the DAG source, and the production analytics database should be reviewed and logged separately rather than treated as one undifferentiated "data platform" permission set. Require code review and a deployment pipeline (not direct manual edits) for changes to the DAG and Spark job logic, since that is the layer where an insider could quietly alter transformation logic to leak or corrupt tenant data without an obvious signature. For the serving layer specifically, enforce tenant isolation at the database level itself (row-level security or per-tenant schema/database separation, not only application-layer filtering), so a compromised or malicious insider with query access still cannot casually read across tenants without an explicit, loggable privilege escalation.
Detection controls, one per layer.
- Ingestion: monitor SFTP authentication patterns (unusual source IP, upload volume, or timing for a given partner credential) and validate uploaded file structure and content type against an expected schema before it ever reaches the staging bucket that triggers processing, rejecting and alerting on anything that does not conform rather than passing it downstream for the pipeline to fail on later.
- Processing: monitor for unexpected outbound network connections from the Spark job's pods (a compromised dependency attempting to exfiltrate data or reach a command-and-control endpoint would typically need to make a network call the legitimate job never makes) and alert on any deployment of a container image or dependency version that does not match the pinned, scanned manifest.
- Serving: monitor for any query or write against the analytics database that crosses a tenant boundary (a query without the expected tenant-scoping predicate, or a write touching more than one tenant's partition), which should be rare-to-never in legitimate traffic and therefore a high-signal, low-false-positive detection.
Worked example
Trace one concrete failure through the diagram: a partner's SFTP credential is phished, and the attacker uploads a file crafted so that a benign-looking column actually contains a payload targeting a known deserialization weakness in an outdated version of a Spark dependency the job has not updated in over a year. Ingestion-layer detection (schema and content-type validation on upload) has a chance to catch this if the payload violates the expected schema, but a sufficiently well-crafted payload disguised as valid data might pass. If it reaches the Spark job, the outdated, unpinned dependency executes the payload, and because the Kubernetes service account for that job was scoped down to only the specific namespace and storage paths it needs (the supply-chain mitigation above), the compromised process cannot pivot to other workloads or escalate within the cluster, containing the blast radius to that one job's resources. The processing-layer detection control (unexpected outbound connections from the job's pods) is what actually surfaces the incident: the compromised process attempting to exfiltrate data to an external endpoint generates a network connection the legitimate job never makes, triggering an alert. Be precise about what that alert does and does not buy, because this is where threat models usually overclaim: egress monitoring is a detection control, not a preventive one, so on its own it tells responders the job is compromised while the job keeps running. Whether tainted output reaches the multi-tenant database depends on a separate decision taken in advance, namely whether an egress alert on a pipeline pod is wired to fail the job and quarantine its output automatically, or only to page a human. For a pipeline that writes across a shared tenant boundary the automated kill is usually worth its occasional false-positive job failure, since a rerun is cheap and cross-tenant contamination is not, but that is a design choice this pipeline has to make explicitly rather than a property detection gives you for free.
Trade-offs and pitfalls
The most common mistake is treating this as a single trust zone and applying uniform controls everywhere, when the whole value of separating attack surfaces by layer is that the ingestion layer needs input-validation-style controls, the processing layer needs supply-chain and least-privilege controls, and the serving layer needs data-isolation controls, and a control designed for one layer is often the wrong shape for another (schema validation does nothing for a compromised dependency, and dependency pinning does nothing for a malicious upload). A second pitfall is relying on application-layer tenant filtering alone at the serving layer; application code has bugs, and a defense-in-depth posture puts the real isolation guarantee in the database layer itself (row-level security or physical separation) so that an application-layer bug is a defect, not a tenant-isolation breach. A third is under-scoping detection to only the ingestion layer, since it is the most obviously external-facing point; the worked example above shows the ingestion control can plausibly miss a well-crafted payload, and it is the processing-layer network-egress detection that actually catches the incident, which is exactly why detection needs to exist at every layer rather than concentrating it at the perimeter.
Unlock Full Question Bank
Get access to all Threat Modeling and Attack Surface Analysis interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.