# Defense in Depth

Defense in Depth is a security strategy that uses multiple complementary layers of protection so that failure of one control does not expose the entire system.

Cloud concept. Updated 2026-10-29. Page: https://blowstack.com/tools/cloud-concepts-hub/defense-in-depth

> Defense in Depth combines preventive, detective, and response controls across network boundaries, identities, applications, hosts, and data. It reduces dependence on any single safeguard and limits the impact of successful attacks, configuration mistakes, and compromised credentials.

Practice exams covering Defense in Depth: [ANS-C01 AWS Certified Advanced Networking - Specialty](https://blowstack.com/practice-exams/aws-certified-advanced-networking-specialty), [DOP-C02 AWS Certified DevOps Engineer - Professional](https://blowstack.com/practice-exams/aws-certified-devops-engineer-professional), [AIP-C01 AWS Certified Generative AI Developer - Professional](https://blowstack.com/practice-exams/aws-certified-generative-ai-developer-professional), [SCS-C03 AWS Certified Security - Specialty](https://blowstack.com/practice-exams/aws-certified-security-specialty), [SAA-C03 AWS Certified Solutions Architect - Associate](https://blowstack.com/practice-exams/aws-certified-solutions-architect-associate), [SAP-C03 AWS Certified Solutions Architect - Professional](https://blowstack.com/practice-exams/aws-certified-solutions-architect-professional).

## 6 key aspects of Defense in Depth

Effective Defense in Depth combines complementary controls, segmented trust boundaries, threat-specific edge protection, least privilege, and tested detection and response.

1. **Complementary protection layers**: Combine controls with different functions and failure modes, such as edge filtering, workload network restrictions, identity authorization, and data permissions. Repeating one permissive policy across several products does not provide meaningful independence.
2. **Segmentation and containment**: Separate workloads by trust level and permit only required communication between them. Protect both north/south entry paths and east/west connections so a compromised workload cannot freely reach adjacent systems.
3. **Threat-aligned edge defenses**: Choose controls according to the expected attack: DDoS protection for traffic floods, HTTP filtering for malicious web requests, and origin restrictions for bypass prevention. Account for the protocols and endpoints each control actually protects.
4. **Explicit trust and least privilege**: Treat network reachability as only one prerequisite for access, not proof of authorization. Require appropriate identities and narrowly scoped permissions even for requests originating inside private networks.
5. **Detection and response coverage**: Collect network, application, and identity telemetry to detect attacks that preventive controls miss. Connect alerts to response procedures that can isolate workloads or revoke access without unnecessarily disrupting unrelated systems.
6. **Validated paths and failure behavior**: Verify that traffic traverses the intended controls and cannot take an unprotected alternate route. Test return paths, failover routing, and control outages to identify both security gaps and availability risks.

## Cloud services for Defense in Depth

Amazon VPC establishes network boundaries and permitted paths, while AWS Network Firewall inspects selected traffic routed through those paths. For internet-facing web applications, Amazon CloudFront, AWS Shield, and AWS WAF provide complementary delivery, DDoS, and HTTP-filtering layers. Origin restrictions ensure those edge layers cannot be bypassed. IAM independently limits the AWS operations available to users and workloads, including workloads with valid network access. Together, these services address different attack stages rather than providing interchangeable protection. Their effectiveness depends on explicit routing, scoped permissions, coordinated logging, and tests that verify both allowed access and blocked attack paths.

- **[Amazon VPC](https://blowstack.com/tools/cloud-services-hub/amazon-vpc)**: Amazon VPC provides subnets, route tables, security groups, and network ACLs for layered network segmentation. Engineers must combine routing and filtering deliberately because private or isolated subnet placement alone does not prevent lateral access.
- **[AWS WAF](https://blowstack.com/tools/cloud-services-hub/aws-waf)**: AWS WAF filters HTTP and HTTPS requests on supported resources using rules such as request matching and rate-based controls. It complements network controls and DDoS defenses but does not replace application authorization or protect arbitrary transport protocols.
- **[AWS Shield](https://blowstack.com/tools/cloud-services-hub/aws-shield)**: AWS Shield provides DDoS protection, with Standard automatically included and Advanced offering additional capabilities for eligible protected resources. It addresses availability attacks as one layer rather than replacing web request filtering, segmentation, or origin protection.
- **[AWS Network Firewall](https://blowstack.com/tools/cloud-services-hub/aws-network-firewall)**: AWS Network Firewall provides managed network traffic filtering and inspection for traffic routed through its firewall endpoints. It can enforce ingress, egress, or east/west policies, but coverage depends on routing design and supported symmetric traffic flows.
- **[Amazon CloudFront](https://blowstack.com/tools/cloud-services-hub/amazon-cloudfront)**: Amazon CloudFront places a distributed delivery layer in front of applications and integrates with AWS WAF and AWS Shield. Restrict origin access separately so attackers cannot bypass edge controls by addressing the origin directly.

## Defense in Depth exam questions

Real practice exam questions on Defense in Depth, with the correct answer and its explanation.

### Question 1 (SAA-C03)

**Question:**

A company runs a payment application on Amazon EC2 instances behind an Application Load Balancer (ALB). AWS WAF filters requests at the ALB. The application retrieves one database credential from AWS Secrets Manager. Other applications run in the same VPC.

A security review requires additional safeguards in case malicious requests bypass AWS WAF or another workload in the VPC is compromised. Only the ALB must be able to initiate connections to the payment application's listening port. The application's AWS permissions must not allow it to retrieve unrelated secrets, even if its code is exploited. The company must also retain an audit history of secret retrieval API calls.

Which solution meets these requirements?

**Correct answer:** Place the application instances in private subnets. Allow their application port only from the ALB's security group. Grant their IAM role secretsmanager:GetSecretValue on only the required secret ARN. Configure a CloudTrail trail to record read and write management events.

**Explanation:** This combines independent network, identity, and audit controls. The application security group restricts connections to traffic from the ALB's security group, the IAM policy limits secret retrieval to the required secret, and CloudTrail records Secrets Manager retrieval calls as read management events. These safeguards continue to provide protection and visibility if web request filtering fails.

### Question 2 (SAP-C03)

**Question:**

A financial services company runs three independently managed web applications in one VPC. Each application has a dedicated internet-facing Application Load Balancer (ALB), EC2 application instances in private subnets, and an Amazon RDS database in isolated subnets. The application tiers share private subnets, and the databases share isolated subnets. No application requires connectivity to another application's resources.

Currently, all application instances and databases use a shared security group that allows all traffic from the VPC CIDR. An assessment finds that an attacker who exploits one application could connect directly to the other applications and databases. Moving resources to different subnets or VPCs is not permitted during the remediation window.

The company requires a design that blocks common malicious HTTP requests before they reach application instances, prevents a compromised instance from establishing connections to another application's instances or database, and records accepted and rejected network flows for investigation. Legitimate ALB-to-application and application-to-database connections must continue to work. The design must assume that some attacks can evade HTTP request filtering.

Which solution meets these requirements?

**Correct answer:** Associate an AWS WAF web ACL with each ALB. Replace the shared security group with separate ALB, application, and database security groups for each application. Permit application ingress only from its ALB security group on required ports and database ingress only from its application security group on the database port. Remove other workload ingress permissions. Enable VPC Flow Logs for accepted and rejected traffic.

**Explanation:** This combines application-layer filtering, independent workload-level segmentation, and network visibility. Dedicated security groups prevent a compromised instance from initiating connections to another application's instances or database, even if an exploit evades AWS WAF. Security group references preserve the required communication paths, and stateful filtering permits their return traffic. VPC Flow Logs provide connection metadata for investigation.

### Question 3 (AIP-C01)

**Question:**

A company exposes an internal generative AI assistant through an Amazon API Gateway REST API. A Lambda authorizer verifies user identity. A backend independently checks the user's current document entitlements, invokes a foundation model, and validates the answer against the currently active output-safety policy before returning it. The backend withholds answers if any required check fails.

The GET /answer method has API Gateway stage caching enabled, with the question query parameter as its only cache key. Security testing shows that a cached answer can reach another user without the backend running. Document entitlements and safety policies can change at any time, even while a user's authentication token remains valid.

The company requires every answer delivery to pass the backend's current entitlement and output-safety checks. Other API methods must retain their existing caching configuration. Which change BEST meets these requirements?

**Correct answer:** Disable API Gateway caching for GET /answer by using a method-level override, and flush existing stage cache entries as part of the change. Leave caching enabled for the other methods.

**Explanation:** Disabling integration-response caching for this method ensures that each request reaches the backend for current entitlement and output-safety checks. Flushing removes existing cached answers during the transition. A method-level override preserves the other methods' caching configuration, although the one-time stage cache flush also clears their existing entries.

### Question 4 (SCS-C03)

**Question:**

A financial services company exposes a document-signing API through an Application Load Balancer (ALB). An associated AWS WAF web ACL blocks common exploits and applies rate-based rules. The application authenticates customers before submitting requests to an external signing provider.

During a security exercise, attackers use valid customer accounts to submit syntactically valid requests that do not match the web ACL's blocking rules. The requests exhaust the signing provider's capacity. The provider permits at most 200 simultaneous signing operations across the company. Company policy also permits at most 20 simultaneous operations per customer. Legitimate customers must be able to submit short bursts within these concurrency limits.

The company wants independent protection against resource exhaustion if edge filtering misses abusive requests. Which design best meets these requirements?

**Correct answer:** Retain the web ACL. Add application-side admission control that uses the authenticated customer identity and atomically enforces both per-customer and company-wide in-flight operation limits before calling the provider. Release capacity when operations finish, and reject or defer excess work.

**Explanation:** Edge filtering remains a first layer, while application-side admission control independently protects the constrained downstream service. Atomic enforcement across application instances can limit actual in-flight operations to 20 per authenticated customer and 200 overall, without treating permitted short bursts as attacks.

### Question 5 (DOP-C02)

**Question:**

A company is deploying a partner-facing API on Amazon EC2 instances behind an internet-facing Application Load Balancer (ALB). An AWS WAF web ACL associated with the ALB blocks malicious HTTP requests. Instance security groups permit application traffic only from the ALB security group.

Partners must authenticate by presenting client certificates issued by the company's existing private certificate authority. The ALB must reject connections with untrusted or expired client certificates before forwarding requests. Partners must also be able to validate the API's server certificate by using standard public trust stores. Server certificate renewal and deployment must be automatic. Application code must remain unchanged, and authenticated partner requests must still undergo web ACL inspection.

Which solution meets these requirements with the LEAST operational overhead?

**Correct answer:** Request a DNS-validated public certificate through ACM, retain its public DNS validation records, and associate it with the ALB HTTPS listener. Configure mutual TLS verify mode with an ALB trust store containing the private CA certificate chain from Amazon S3. Retain the web ACL association and existing security group restrictions.

**Explanation:** ACM manages renewal and deployment of an eligible Amazon-issued public certificate associated with the ALB when DNS validation remains available. The public certificate authenticates the server, while the separate ALB trust store establishes which client certificate issuers are trusted. Mutual TLS verify mode validates client certificates, including their trust chain and expiration by default. Successfully authenticated requests still pass through AWS WAF, providing independent transport, client-authentication, application-filtering, and network controls.

## Practice Defense in Depth in a full exam

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

- [AIP-C01](https://blowstack.com/practice-exams/aws-certified-generative-ai-developer-professional): 11 questions
- [DOP-C02](https://blowstack.com/practice-exams/aws-certified-devops-engineer-professional): 9 questions
- [SCS-C03](https://blowstack.com/practice-exams/aws-certified-security-specialty): 6 questions
- [ANS-C01](https://blowstack.com/practice-exams/aws-certified-advanced-networking-specialty): 5 questions
- [SAA-C03](https://blowstack.com/practice-exams/aws-certified-solutions-architect-associate): 4 questions
- [SAP-C03](https://blowstack.com/practice-exams/aws-certified-solutions-architect-professional): 1 question

## What is Defense in Depth

Defense in Depth assumes that individual security controls can fail, be bypassed, or be misconfigured. Instead of relying on a perimeter firewall alone, an architecture combines controls that address different attack paths and failure modes. For example, an internet-facing application might use distributed denial-of-service protection, HTTP request filtering, restricted origin access, workload-level network rules, application authorization, and database permissions. If an attacker bypasses request filtering, authorization and data-access controls still constrain what the attacker can do.

Cloud network segmentation applies this principle by separating resources according to trust, sensitivity, and required communication. North/south traffic crosses a defined environment boundary, such as traffic between the internet and an application. East/west traffic moves between internal workloads, such as an application server connecting to a database. These directions are relative to the architectural boundary being discussed. Protecting only internet ingress leaves lateral movement paths available after a workload is compromised.

A practical three-tier design places public entry points in internet-facing subnets, application workloads in private subnets, and databases in isolated subnets. Only the entry point can reach the application port, and only the application tier can reach the database port. An isolated subnet has no route to an internet gateway or NAT gateway, but it is not automatically disconnected from other internal networks. Local routes, transit connections, endpoints, and resource-level rules still determine possible communication. A subnet boundary by itself does not enforce isolation.

On AWS, security groups provide stateful, resource-level filtering, while network ACLs provide stateless subnet-boundary filtering. Network ACL rules must account for return traffic, including applicable ephemeral ports. Security groups can restrict permitted connections between application tiers; subnet ACLs can provide broader boundary restrictions. Neither replaces application authorization. Where centralized network inspection is required, routing must actually steer the relevant traffic through the firewall. Stateful inspection also requires a supported symmetric traffic path, including during failover.

Edge controls should match anticipated threats. Volumetric attacks call for distributed infrastructure and DDoS defenses; malicious HTTP requests call for application-layer filtering; abusive request rates may require rate limits or bot controls. A web application firewall does not inspect arbitrary non-HTTP protocols and cannot replace secure application code. A CDN does not prevent attackers from contacting a publicly reachable origin unless origin access is restricted separately. Use private origin connectivity where supported, or combine network restrictions and origin request validation to prevent direct-origin bypass.

Defense also extends to outbound connections, administrative access, and data access. Restrict unnecessary egress to reduce command-and-control and exfiltration paths, use narrowly scoped workload identities, and authenticate administrative sessions independently of network location. Encryption protects confidentiality but does not stop an authorized, compromised workload from reading data it is permitted to access. Network flow records, firewall logs, application logs, and identity audit events provide complementary evidence for detection and investigation.

Additional layers introduce cost, latency, operational complexity, and potential availability failures. Select controls for explicit threats rather than duplicating the same rule everywhere without a purpose. During troubleshooting, trace DNS resolution, routing, inspection paths, network rules, and application decisions in sequence; a timeout alone does not identify the blocking layer. Test expected connections, prohibited connections, origin-bypass attempts, and failure scenarios. The goal is independent protection with manageable operations, not the largest possible number of security products.

## Learn Defense in Depth in lessons

5 short lessons on Defense in Depth in 5 certification courses.

- SAA-C03: Defense in Depth: independent security layers (Premium), https://app.blowstack.com/lessons/defense-in-depth-independent-security-layers-saa-c03
- SAP-C03: Defense in Depth: independent network protection layers (Premium), https://app.blowstack.com/lessons/defense-in-depth-independent-network-protection-layers-sap-c03
- AIP-C01: Defense in Depth: independent safeguards for foundation-model interactions (Premium), https://app.blowstack.com/lessons/defense-in-depth-independent-safeguards-for-foundation-model-interactions-aip-c01
- SCS-C03: Defense in Depth: independent network protection layers (Premium), https://app.blowstack.com/lessons/defense-in-depth-independent-network-protection-layers-scs-c03
- DOP-C02: Defense in Depth: independent control layers (Premium), https://app.blowstack.com/lessons/defense-in-depth-independent-control-layers-dop-c02
