Cloud concept · Updated

Threat Modeling - Threat modeling is a structured process for identifying how a system could be attacked and selecting controls and monitoring to reduce the resulting risks.

In short

Threat modeling connects a workload’s architecture, valuable assets, trust boundaries, and likely attackers to concrete security requirements. It helps engineers prioritize preventive controls, collect useful telemetry, and design alerts around plausible attack scenarios rather than enabling security features indiscriminately.

Cloud Concepts Hub →

6 key aspects of Threat Modeling

Threat modeling turns architectural knowledge and plausible attack scenarios into prioritized controls, monitoring requirements, and repeatable validation.

01
Asset and trust-boundary analysis

Identify valuable data, privileged actions, entry points, and changes in trust across components, accounts, or external integrations. Use architecture and data-flow diagrams to reveal paths that require authorization, validation, or monitoring.

02
Explicit attack scenarios

Describe who could misuse the system, the access they would need, and the outcome they could cause. Include identity abuse, administrative changes, application attacks, data theft, and availability threats when relevant to the workload.

03
Risk-based prioritization

Rank scenarios by likelihood and business impact while considering existing safeguards. Assign owners to mitigations and document accepted residual risk instead of assuming that every threat can be eliminated.

04
Threat-driven monitoring

Map each priority scenario to required logs, metrics, detection logic, alert recipients, and response actions. Verify collection coverage and test that simulated activity creates useful evidence and actionable alerts.

05
Attack-specific edge defenses

Select defenses based on attack layer, traffic protocol, and origin exposure. Distinguish web request filtering from DDoS protection, and prevent attackers from bypassing the intended inspection path.

06
Continuous validation

Review assumptions after architecture changes, incidents, and security tests. Measure detection gaps and false positives, then update controls, telemetry, and response procedures.

Cloud services for Threat Modeling

The threat model determines which services and configurations are necessary. CloudTrail records relevant AWS API activity, while CloudWatch collects workload telemetry and supports alarms for defined conditions. GuardDuty adds managed detections from supported telemetry, but application-specific abuse still needs dedicated instrumentation. At the edge, CloudFront provides distributed delivery, AWS WAF inspects web requests, and Shield addresses DDoS threats. These controls work together only when traffic follows the intended inspection path, required events are collected, and findings reach responders with sufficient context. Test representative attack scenarios to verify both preventive behavior and detection coverage.

AWS CloudTrailAWS CloudTrail

Provides AWS API activity records for investigating scenarios such as unauthorized role use, policy changes, and attempts to disable logging. Configure trails or event data stores for the required coverage, including relevant data events, rather than assuming event history captures every operation.

Amazon CloudWatchAmazon CloudWatch

Collects workload logs and metrics and supports alarms derived from threat scenarios. Engineers must configure log ingestion, metric filters or other detection logic, thresholds, and notification actions to turn telemetry into useful monitoring.

Amazon GuardDutyAmazon GuardDuty

Analyzes supported AWS telemetry to produce managed threat-detection findings, including findings associated with credential misuse and suspicious network activity. Use the threat model to evaluate coverage and enable relevant protection plans; managed findings do not replace application-specific authorization monitoring.

AWS WAFAWS WAF

Applies web request inspection and filtering to supported resources, addressing scenarios such as common injection attempts and abusive request rates. Tune rules using observed traffic and logs, and remember that a web application firewall does not replace application authorization or protect every network protocol.

AWS ShieldAWS Shield

Provides DDoS protection relevant to availability threats at the network edge. Shield Standard supplies baseline protection automatically, while Shield Advanced offers additional capabilities for supported, protected resources and must be evaluated against workload risk and cost.

Amazon CloudFrontAmazon CloudFront

Provides a distributed HTTP delivery layer that can reduce origin load and integrate with AWS WAF and Shield protections. Design origin access restrictions and cache behavior around the threat model so attackers cannot simply bypass edge controls or receive incorrectly cached sensitive responses.

Threat Modeling exam questions

Real practice exam questions on Threat Modeling, with the correct answer and its explanation. Answer them with every option in the exam simulator.

SAP-C03

A healthcare data exchange exposes a private Amazon API Gateway REST API to approved analytics partners through interface VPC endpoints. Each partner signs requests with a distinct IAM role. API resource policies restrict access to approved partner roles and VPC endpoints. All connections use TLS.

Partners request exports by submitting a customer ID. A shared backend uses an execution role that can read every customer's Amazon S3 prefix. Each partner is authorized to access a different, overlapping subset of customers. These entitlements change independently of network connectivity. Customer IDs are not secrets.

During a threat-modeling review, the security team considers an attacker who has compromised an approved partner's application and signing credentials. Compliance requires the exchange to prevent this attacker from exporting records for customers outside that partner's current entitlements.

Which architectural change best addresses this risk?

Show answerCORRECT ANSWER

Require the backend to resolve the authenticated IAM caller to a partner identity and check the requested customer against a server-controlled entitlement store before creating an export. Bind the export job to that authorized customer and use an S3 session policy restricted to that customer's prefix when reading the records.

This reassesses authorization as an authenticated external request becomes a privileged data-access operation. Server-controlled entitlements prevent the partner from choosing its own authority, and binding the job to the authorized customer preserves that decision during processing. A customer-scoped session policy further limits the export worker's effective S3 permissions.

SCS-C03

A company exposes a document-retrieval API through an Application Load Balancer protected by an AWS WAF web ACL. The API uses HTTPS. Application audit logs already record the authenticated user, requested document ID, and authorization decision.

During an architecture review, the security team identifies a high-impact scenario: an attacker could use a stolen customer session to systematically request other customers' documents. These requests could be syntactically valid and might not match any existing WAF protection rule. Investigators need ongoing, unsampled request records containing the URI, query string, client IP address, and WAF action so they can investigate request patterns alongside the application audit records. Request bodies are not required.

The current WAF logging filter retains only requests whose terminating action is BLOCK. Which change best addresses the identified detection gap?

Show answerCORRECT ANSWER

Remove the action-based exclusion from the web ACL logging configuration so that full WAF logs retain all requests, including requests with an ALLOW action.

The modeled attack can use valid-looking requests that WAF allows. Full WAF logging without an exclusion filter preserves request-level HTTP metadata and WAF actions for both allowed and blocked requests. These records complement the application logs, which provide user identity and authorization context.

ANS-C01

A company protects an HTTPS application with an AWS WAF web ACL associated with an Application Load Balancer. The web ACL evaluates the AWS Managed Rules Common Rule Set before a separate SQL injection rule group. During threat modeling, engineers identify that the POST /preview endpoint must accept user-supplied HTML, which the application sanitizes before rendering. Legitimate requests to this endpoint trigger the Common Rule Set's CrossSiteScripting_BODY rule.

The security team approves an exception only for this rule on the exact /preview URI path. Every other managed rule must retain its existing protection on all paths, and CrossSiteScripting_BODY must continue blocking matching requests on other paths. Requests to /preview must also continue through subsequent web ACL rules.

Which configuration meets these requirements?

Show answerCORRECT ANSWER

Override only CrossSiteScripting_BODY to Count. Immediately after the Common Rule Set, add a Block rule that matches the label emitted by CrossSiteScripting_BODY AND a URI path that is not exactly /preview. Leave all other rules unchanged.

The individual Count override preserves the rule's inspection and labeling without terminating evaluation. The subsequent label-based rule restores blocking for matching requests on every path except /preview. Other rules in the managed group retain their actions, and preview requests continue to subsequent rules, including SQL injection inspection.

Practice Threat Modeling in a full exam

Questions on Threat Modeling in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is Threat Modeling

3 min read

Threat modeling asks what needs protection, what could go wrong, how serious the consequences would be, and how the design will prevent or detect those outcomes. Its output is an actionable set of attack scenarios, security requirements, and accepted residual risks. It is not simply a vulnerability scan: a fully patched application can still expose sensitive information through excessive permissions, broken authorization, or an unsafe integration.

Begin by describing the workload and its business purpose. Identify sensitive data, privileged identities, public endpoints, administrative interfaces, external dependencies, and availability requirements. Map data flows and trust boundaries, such as the transition from an internet client to an API, from application code to a database, or from one cloud account to another. Include deployment pipelines and management APIs because attackers do not have to enter through the application’s public interface.

For each boundary and asset, describe plausible abuse. An attacker might steal a workload credential, change a storage policy, exploit an injection flaw, exhaust an endpoint, or access another customer’s records. Frameworks such as STRIDE help structure this analysis, but using a framework does not replace understanding application behavior. Prioritize scenarios using likelihood, business impact, exposure, and existing safeguards rather than treating every hypothetical attack as equally urgent.

Translate each important scenario into monitoring requirements. For stolen credentials, relevant evidence might include identity-provider sign-ins, role assumptions, unusual API activity, permission changes, and sensitive data access. For data exfiltration, combine application authorization logs, storage access events, and network telemetry where appropriate. Cloud audit logs do not automatically capture every data-plane operation; for example, relevant AWS CloudTrail data events must be explicitly configured. Network flow logs describe traffic metadata, not application request bodies or definitive proof of data theft.

Define what each alert means, who receives it, and what action follows. An alert for disabling audit logging should have a different priority and response from an isolated rejected web request. In a multi-account environment, plan account and Region coverage, centralized collection, retention, restricted access, and protection against log modification or deletion. Validate that a controlled test produces the expected evidence and notification. Logging without a detection rule, an accountable responder, or sufficient investigation context is not a complete detection strategy.

At the network edge, choose controls according to the anticipated attack and protocol. HTTP injection attempts and abusive request patterns call for application-layer inspection and appropriate rate-based rules. Volumetric or transport-layer denial-of-service attacks require DDoS protections and a resilient ingress architecture. CDN delivery can reduce origin load, but caching alone does not protect dynamic endpoints or prevent direct access to an exposed origin. Restrict origin access using mechanisms appropriate to the origin type, and retain application authentication and authorization even when edge filtering is present.

Every choice has trade-offs. Detailed logging increases cost and may capture sensitive information; aggressive filtering can block legitimate customers; rate limits can penalize users behind shared addresses. Tune controls against realistic traffic, record assumptions, and test failure modes. Threat modeling is not a guarantee of security or a one-time compliance document. Revisit it when architectures, identities, data sensitivity, dependencies, or attacker behavior change, and use incident findings to improve both controls and monitoring.

Learn Threat Modeling in lessons

5 short lessons on Threat Modeling in 3 certification courses.

Open the lessons