devHọc Dev

Week 4 - Day 1: High Availability, Disaster Recovery, Advanced Security and Encryption

Week 4 – Day 1

This lesson combines 4 topics: High Availability Architectures, Disaster Recovery Strategies, Security Advanced, Encryption and Compliance.

Learning Objectives

  • Understand the 4 HA design principles and the standard Multi-AZ pattern for web apps
  • Choose the right scaling policy for each traffic pattern
  • Understand the HA pattern of each database type (RDS, Aurora, DynamoDB)
  • Memorize the 4 DR strategies on the RTO/RPO/cost scale and recognize them from exam keywords
  • Understand the recovery mechanics of each strategy (which steps take time)
  • Know how AWS Backup and Route 53 failover support DR
  • Understand AWS Elastic Disaster Recovery (DRS): continuous replication, staging area, drills, failback, and how it differs from MGN
  • Map security services correctly by function: detection, protection, identity, data protection
  • Understand KMS key types, key material origin and multi-Region keys
  • Design multi-layer defense-in-depth with Network Firewall, NACLs, Security Groups
  • Know the encryption at rest/in transit options of each major service
  • Distinguish KMS vs CloudHSM correctly as of 2026 (both are FIPS 140-3 L3)
  • Know the compliance programs and tools (Artifact, Config conformance packs, Audit Manager)

Part 1: High Availability Architectures

1. HA Design Principles

┌─────────────────────────────────────────────────────────┐│HAPRINCIPLES││││1.EliminateSinglePointsofFailure││-Multi-AZdeployments││-Redundantcomponents││││2.DesignforFailure││-Assumecomponentswillfail││-Implementhealthchecks││-Auto-healingmechanisms││││3.LooseCoupling││-Usequeuesbetweencomponents││-Asyncwherepossible││││4.StatelessApplications││-Storestateexternally││-Easyhorizontalscaling│└─────────────────────────────────────────────────────────┘

2. Multi-AZ Architecture

┌─────────────────────────────────────────────────────────┐│MULTI-AZWEBAPP││││┌───────────────┐│││Route53││││(DNS)│││└───────┬───────┘│││││┌───────┴───────┐│││ALB││││(Multi-AZ)│││└───────┬───────┘│││││┌───────────────┼───────────────┐││▼▼▼││┌──────────┐┌──────────┐┌──────────┐│││AZ-a││AZ-b││AZ-c││││┌──────┐││┌──────┐││┌──────┐│││││EC2││││EC2││││EC2│││││└──────┘││└──────┘││└──────┘│││└──────────┘└──────────┘└──────────┘│││││┌───────┴───────┐│││RDSMulti-AZ││││orAurora│││└───────────────┘│└─────────────────────────────────────────────────────────┘

3. Auto Scaling Strategies

SCALING POLICIES:

1. Target Tracking (Recommended)
   - Maintain CPU at 50%
   - Simple configuration

2. Step Scaling
   - Multiple thresholds
   - Different actions per step

3. Scheduled Scaling
   - Known traffic patterns
   - Time-based

4. Predictive Scaling
   - ML-based prediction
   - Proactive scaling

COOLDOWN PERIODS:
- Default: 300 seconds
- Prevents rapid scale in/out
- Can customize per policy

4. Session Management

STATELESSPATTERN:┌─────────────────────────────────────────────────────────┐│User──►ALB──►AnyEC2instance│││││▼││┌─────────────────────┐│││ElastiCache(Redis)││││SessionStore│││└─────────────────────┘││││Benefits:││-Instancecanfail││-Scalein/outfreely││-Nostickysessionsneeded│└─────────────────────────────────────────────────────────┘

5. Database HA Patterns

RDS:├──Multi-AZ(syncreplication,autofailover)├──ReadReplicas(async,manualpromotion)└──CombinationofbothAurora:├──6copiesacross3AZs├──Writer+upto15readers├──Autofailover<30seconds└──GlobalDatabaseforcross-regionDynamoDB:├──Multi-AZbydefault└──GlobalTablesformulti-region

Part 2: Disaster Recovery Strategies

1. DR Strategy Comparison

┌─────────────────────────────────────────────────────────┐│DRSTRATEGIES(byRTO/RPO)││││Strategy│RTO│RPO│Cost││────────────────┼──────────────────┼───────────┼─────││Backup/Restore│Hours(canbe│Hours│$│││24h+)││││PilotLight│10sofmin│Minutes│$$││WarmStandby│Minutes│Seconds│$$$││Multi-Site│Nearzero│Nearzero│$$$$│└─────────────────────────────────────────────────────────┘

2. Backup and Restore

┌─────────────────────────────────────────────────────────┐│BACKUPANDRESTORE││││PrimaryRegionDRRegion││┌──────────────┐┌──────────────┐│││Production│────Backup──►│S3Bucket││││-AMIs││-Snapshots││││-Snapshots││-Backups││││-Data│││││└──────────────┘└──────────────┘││││Recovery:││1.Restorefrombackups││2.Deployinfrastructure(CloudFormation)││3.Restoredata││4.SwitchDNS││││RTO:24+hours│RPO:Lastbackuppoint│└─────────────────────────────────────────────────────────┘

3. Pilot Light

┌─────────────────────────────────────────────────────────┐│PILOTLIGHT││││PrimaryRegion│DRRegion││┌────────────────────┐│┌────────────────────┐│││WebTier(ON)│││WebTier(OFF)│││├────────────────────┤│├────────────────────┤│││AppTier(ON)│││AppTier(OFF)│││├────────────────────┤│├────────────────────┤│││DB(Primary)│───►││DB(Replica,ON)│││└────────────────────┘│└────────────────────┘│││││Recovery:│││1.ScaleupDBreplica│││2.Startweb/appservers│││3.SwitchRoute53││││││RTO:10-30minutes│RPO:Minutes│└─────────────────────────────────────────────────────────┘

4. Warm Standby

┌─────────────────────────────────────────────────────────┐│WARMSTANDBY││││PrimaryRegion│DRRegion││┌────────────────────┐│┌────────────────────┐│││FullCapacity│││MinimumCapacity││││████████████████│││████│││││││││││Alltiersrunning│───►││Reducedsize│││└────────────────────┘│└────────────────────┘│││││Recovery:│││1.ScaleupDRinstances│││2.SwitchRoute53││││││RTO:Minutes│RPO:Seconds│└─────────────────────────────────────────────────────────┘

5. Multi-Site Active/Active

┌─────────────────────────────────────────────────────────┐│MULTI-SITEACTIVE/ACTIVE││││Route53(Weighted/Latency)│││││┌──────────┴──────────┐││▼▼││┌──────────────┐┌──────────────┐│││Region1│◄────►│Region2││││Fullstack│Sync│Fullstack││││(Active)││(Active)│││└──────────────┘└──────────────┘││││DataSync:││-DynamoDBGlobalTables││-AuroraGlobalDatabase││-S3Cross-RegionReplication││││RTO:Nearzero│RPO:Nearzero│└─────────────────────────────────────────────────────────┘

6. AWS Backup

Centralized Backup Management:
- EC2, EBS, RDS, DynamoDB, EFS, FSx
- Cross-region backup
- Cross-account backup
- Backup policies and plans
- Vault Lock (WORM)

7. Route 53 Health Checks for DR

Failover Routing:
1. Health check monitors primary endpoint
2. Primary fails → Route 53 detects
3. Traffic switches to secondary
4. Primary recovers → Traffic returns

DNS TTL: Set low for faster failover

8. AWS Elastic Disaster Recovery (DRS)

The strategies in sections 2-5 say "replicate data continuously". For databases you have RDS read replicas / Aurora Global; for EC2 and on-premises servers (including VMware, Hyper-V, physical) the main tool is AWS Elastic Disaster Recovery (DRS), the successor to CloudEndure Disaster Recovery.

┌─────────────────────────────────────────────────────────┐│ELASTICDISASTERRECOVERY(DRS)││││Sourceservers(on-prem/EC2/othercloud)│││AWSReplicationAgent(block-level,continuous)││▼││StagingAreaSubnet(DRRegion)││├──Replicationservers:small,cheapinstances││├──Low-costEBSvolumesholdthedatacopy││└──Continuoussnapshots→point-in-timerecovery││││││Disaster/Drill→Launch││▼││Recoveryinstances(right-sized,perlaunchtemplate)││fromlateststate(RPOseconds)orPITsnapshot││RTO:minutes││Failback:replicatebacktosourceafterrecovery│└─────────────────────────────────────────────────────────┘
CharacteristicWhat it means for the exam
Continuous block-level replication, independent of app/DBApplies to any workload running on a server, including self-managed DBs on EC2
Staging area uses small instances + cheap EBSLow cost while there is no disaster → fits Pilot Light for the compute tier
RPO seconds, RTO minutesMuch lower than AWS Backup (RPO hours, RTO hours)
Non-disruptive drillsPeriodic DR testing without affecting production (a frequent exam requirement)
Built-in failbackOnce the original site recovers, replicate back and cut over
Cross-Region and cross-accountDR to another Region or a dedicated account (blast radius)

MGN vs DRS: same replication agent and staging mechanism, but MGN is a migration tool (one-time cutover, then replication is turned off), while DRS is a DR tool (continuous replication, failover when needed, failback). If the question says "migrate lift-and-shift" → MGN; "RPO seconds, RTO minutes for on-premises servers, minimal cost when idle" → DRS. Using DRS to migrate or MGN for DR are both wrong answers.

Choosing a DR tool per tier:

TierToolTypical RPO/RTO
Servers/VMs, self-managed DBs on EC2DRSseconds / minutes
RDS, AuroraCross-Region read replica, Aurora Global Databaseseconds / minutes
DynamoDBGlobal Tablesseconds / ~0
S3Cross-Region Replication (+ RTC for a 15-minute SLA)minutes / ~0
Periodic backups of everythingAWS Backup (cross-Region, cross-account vault)hours / hours

Part 3: Security Advanced

1. AWS Security Services Overview

┌─────────────────────────────────────────────────────────┐│SECURITYSERVICES││││DETECTION:││├──GuardDuty(Threatdetection)││├──SecurityHub(Aggregatedfindings)││├──Inspector(Vulnerabilityscanning)││├──Macie(Sensitivedatadiscovery)││└──Detective(Securityinvestigation)││││PROTECTION:││├──WAF(WebApplicationFirewall)││├──Shield(DDoSprotection)││├──FirewallManager(Centralizedrules)││└──NetworkFirewall(VPC-levelfirewall)││││IDENTITY:││├──IAM(Users,Roles,Policies)││├──IAMIdentityCenter(SSO)││├──Cognito(Appauthentication)││└──DirectoryService(AD)││││DATAPROTECTION:││├──KMS(KeyManagement)││├──CloudHSM(HardwareSecurity)││├──SecretsManager(Secretsrotation)││└──CertificateManager(SSL/TLS)│└─────────────────────────────────────────────────────────┘

2. AWS KMS Deep Dive

┌─────────────────────────────────────────────────────────┐│AWSKMS││││KeyTypes:││├──AWSmanagedkeys(aws/service-name)│││└──Auto-rotatedyearly(~365days),can'tdisable││├──Customermanagedkeys│││├──Automaticrotation:period90–2560days││││(default365daysifnotset)│││└──On-demandrotationatanytime(04/2024)││└──AWSOwnedKeys││└──UsedinternallybyAWS││││KeyMaterialOrigin:││├──AWS_KMS(generatedinKMS)││├──EXTERNAL(importyourown)││└──AWS_CLOUDHSM(CloudHSMcluster)││││Multi-RegionKeys:││-Samekeymaterialinmultipleregions││-Simplifiescross-regionencryption││-Primary+Replicakeys│└─────────────────────────────────────────────────────────┘

Terminology: AWS has retired the name "Customer Master Key (CMK)". The current term is KMS key, split into customer managed key, AWS managed key and AWS owned key. Older questions may still say "CMK"; read it as customer managed key. Rotation only applies to symmetric encryption keys whose key material is generated by KMS; imported key material (EXTERNAL) must be rotated manually (or on-demand for keys that support it).

3. Network Security Layers

┌─────────────────────────────────────────────────────────┐│DEFENSEINDEPTH││││Layer1:Edge││├──CloudFront+WAF││└──Shield(DDoS)││││Layer2:VPCPerimeter││├──NetworkFirewall││└──NATGateway││││Layer3:Subnet││└──NACL(stateless)││││Layer4:Instance││└──SecurityGroups(stateful)││││Layer5:Application││├──IAMRoles││└──Encryption│└─────────────────────────────────────────────────────────┘

4. AWS Network Firewall

┌─────────────────────────────────────────────────────────┐│AWSNETWORKFIREWALL││││Features:││-Statefulinspection││-IntrusionPrevention(IPS)││-Webfiltering││-Protocoldetection││││Integration:││┌───────────────────────────────────────────────────┐│││Internet│││││││││▼││││┌────────────────────┐│││││NetworkFirewall││││││(FirewallSubnet)│││││└────────┬───────────┘││││▼││││┌────────────────┐│││││NATGateway│││││└────────┬───────┘││││▼││││┌────────────────┐│││││PrivateSubnets│││││└────────────────┘│││└───────────────────────────────────────────────────┘│└─────────────────────────────────────────────────────────┘

5. Security Best Practices

1. Enable CloudTrail in all regions
2. Enable Config rules
3. Enable GuardDuty
4. Use Security Hub for aggregation
5. Encrypt everything (at rest and in transit)
6. Use IAM roles (not users) for applications
7. Enable MFA everywhere
8. Regular security assessments
9. Implement least privilege
10. Monitor and alert on security events

6. Security Multi-Account Patterns (Domain 1 × Domain 2)

Sections 1-5 cover individual services. SAP-C02 rarely asks "what does GuardDuty do"; it asks how to "enable and operate GuardDuty across 200 accounts with the least operational overhead". The answer always revolves around three mechanisms: delegated administrator, central configuration, and data perimeter.

┌─────────────────────────────────────────────────────────────┐│SECURITYTOOLINGACCOUNT(delegatedadmin)││││Organizations──delegate──▶Securityaccount│││││┌──────────┬──────────┬────┴─────┬──────────┐││▼▼▼▼▼││GuardDutySecurityHubInspectorMacieDetective││(auto-enablenewaccounts,findingscentralized)││││FirewallManager──policy──▶WAF/SG/NetworkFirewall││/DNSFirewall(org-wide)││IAMAccessAnalyzer(orgzoneoftrust)──▶external+││unusedaccess││SecurityLake(OCSF,S3)◀──CloudTrail,VPCFlow,Route53,││SecurityHub,3rdparty│└─────────────────────────────────────────────────────────────┘

Delegated administrator and central configuration

ServiceOrg mechanismExam point
GuardDutyDelegated admin; auto-enable for new accounts; findings aggregated in the admin account"new accounts automatically protected" → auto-enable, not a custom Lambda
Security Hub (CSPM)Delegated admin + central configuration (a Security Hub CSPM feature): one configuration policy enables standards/controls for an entire OU, cross-Region aggregation"consistent security standards across all accounts and Regions"
Inspector / Macie / DetectiveDelegated admin, auto-enable membersInspector scans EC2/ECR/Lambda; Macie finds PII in S3; Detective investigates after a finding
IAM Access AnalyzerAnalyzer with zone of trust = Organization created in the delegated admin; the unused access analyzer finds unused roles/keys/permissions (90+ days)"identify resources shared outside the organization" → external access analyzer; "remove unused permissions" → unused access
Firewall ManagerRequires Organizations + AWS Config enabled; the admin account creates policies that apply WAF web ACLs, Shield Advanced, Security Group audits, Network Firewall, Route 53 DNS Firewall to every account/OU, automatically applied to new resources"ensure every ALB in every account has the WAF rule" → Firewall Manager, not StackSets
Security LakeDelegated admin; normalizes logs to OCSF in Security Lake's S3; subscribers (Athena, OpenSearch, SIEM) query them"centralize security logs in open standard format"

Data perimeter: three sides

A data perimeter is a set of controls ensuring that only trusted identities, from trusted networks, access trusted resources:

SideQuestionControlCondition key
IdentityMy resources can only be used by principals in my orgRCP (Week 2 Day 1) or resource policyaws:PrincipalOrgID, aws:PrincipalIsAWSService
ResourceMy principals can only access resources in my orgSCPaws:ResourceOrgID
NetworkAccess only from my VPCs/IPsVPC endpoint policy + resource policyaws:SourceVpc, aws:SourceVpce, aws:SourceIp, aws:ViaAWSService

Keyword: "prevent data exfiltration to an S3 bucket owned by an external account" → SCP deny s3:* when aws:ResourceOrgID ≠ org ID (combined with a VPC endpoint policy for the network side).

Nitro Enclaves and Verified Access

  • Nitro Enclaves: an isolated environment (no network, no storage, no SSH) carved out of an EC2 instance to process sensitive data (PII, private keys). KMS attestation: the key policy only allows decrypt when kms:RecipientAttestation:ImageSha384 matches the enclave image → even root on the instance cannot read the plaintext. Keyword: "process highly sensitive data so that even administrators cannot access it".
  • Verified Access: access to internal applications without a VPN; every request is evaluated on identity (IAM Identity Center/OIDC) + device posture (Jamf, CrowdStrike) using Cedar policies. Keyword: "zero-trust access to internal web apps, eliminate VPN".

Problem → service

The question asksChoose
Enable threat detection for all existing and future accounts with the least overheadGuardDuty delegated admin + auto-enable
Consistent security standards (CIS, FSBP) across the org, multiple RegionsSecurity Hub central configuration + cross-Region aggregation
Every CloudFront/ALB must have a WAF rule, including resources created laterFirewall Manager WAF policy
Find S3 buckets/KMS keys/roles shared outside the orgIAM Access Analyzer (external access, org zone of trust)
Resources must not be shared outside the org (prevent, not just detect)RCP with aws:PrincipalOrgID
Centralize security logs in a standard format for a SIEMSecurity Lake (OCSF)
Even the instance admin must not read data being processedNitro Enclaves + KMS attestation

Part 4: Encryption and Compliance

1. Encryption at Rest

┌─────────────────────────────────────────────────────────┐│ENCRYPTIONATRESTOPTIONS││││S3:││├──SSE-S3(AWSmanaged)││├──SSE-KMS(KMSmanaged)││├──SSE-C(Customerprovided)││└──Client-sideencryption││││EBS:││└──KMS(AWSmanagedkeyorcustomermanagedkey)││││RDS/Aurora:││└──KMSencryption(atcreation)││││DynamoDB:││├──AWSownedkey(default)││├──AWSmanagedkey(aws/dynamodb)││└──Customermanagedkey││││EFS:││└──KMSencryption│└─────────────────────────────────────────────────────────┘

2. Encryption in Transit

TLS/SSL everywhere:
- ALB/NLB HTTPS listeners
- CloudFront HTTPS
- RDS SSL connections
- S3 HTTPS endpoints
- API Gateway HTTPS

ACM (AWS Certificate Manager):
- Free public certificates
- Auto-renewal
- Integration with ALB, CloudFront, API GW

3. CloudHSM

┌─────────────────────────────────────────────────────────┐│CloudHSMvsKMS││││Feature│KMS│CloudHSM││─────────────────┼──────────────┼──────────────────││Management│AWSmanaged│Customermanaged││Compliance│FIPS140-3L3│FIPS140-3L3│││(since│(hsm2m.medium;│││02/2025;│hsm1legacy:│││before:140-2│140-2L3)│││L3from2023)│││Keyaccess│Multi-tenant│Single-tenant││Keycontrol│AWSmanages│Youkeepfull│││HSMfleet│controlofkey││││material││API│AWSKMSAPI│PKCS#11,JCE,CNG││Pricing│Perkey/use│Perhour││Integration│AWSservices│Customapps││Usecase│Mostcases│DedicatedHSM,││││self-managedkeys,││││SQLServerTDE...│└─────────────────────────────────────────────────────────┘2026note:FIPS140-3Level3isNOLONGERadifferentiatorbetweenKMSandCloudHSM(bothachieveit).CloudHSM'srealdifferentiators:single-tenantdedicatedHSM,fullcontrolofkeymaterial(AWScannotaccessit),PKCS#11/JCE/CNGforcustomapps,andthecustomkeystoreforKMS.

4. Compliance Programs

AWS Compliance:
- SOC 1, 2, 3
- PCI DSS Level 1
- HIPAA
- FedRAMP
- GDPR
- ISO 27001, 27017, 27018

Tools:
- AWS Artifact (compliance reports)
- AWS Config (conformance packs)
- AWS Audit Manager (assessment)

5. AWS Artifact

Download compliance reports:
- SOC reports
- PCI reports
- ISO certifications
- Agreements (BAA, GDPR DPA)

Use for:
- Audits
- Due diligence
- Compliance evidence

Review Questions

  1. Why is a stateless application a prerequisite for HA?

    Show answer

    When state (sessions, temporary uploads, local cache) lives on the instance, losing the instance means losing the state, and the ALB cannot route freely; you need sticky sessions, and scale-in causes user-facing errors. Moving state out (ElastiCache/DynamoDB for sessions, S3/EFS for files) makes every instance interchangeable: the ASG self-heals, scale in/out does not affect users, and Multi-AZ failover is transparent. This is also the precondition for moving on to Multi-Region active-active.

  2. Target tracking vs step scaling vs predictive: how do you choose?

    Show answer

    Target tracking (recommended, the default): keeps a metric around a target (CPU 50%); simple and enough for most cases. Step scaling: when you need different reactions depending on how far the threshold is breached (20% over adds 2 instances, 50% over adds 5). Scheduled: patterns known in advance by time (an 8AM batch). Predictive: ML forecasting; only effective when traffic has repeating cycles (daily/weekly). Random spikes cannot be predicted, so you rely on target/step with low thresholds and a warm pool.

  3. How does Aurora failover differ from RDS Multi-AZ failover?

    Show answer

    RDS Multi-AZ: failover to the standby (sync replica) takes 60–120s, mostly due to DNS propagation + crash recovery. Aurora: a reader is promoted in < 30s (the shared storage layer of 6 copies/3 AZs means no replay is needed), with the reader chosen by priority tier; if there is no reader, Aurora creates a new writer, which takes longer. For even faster failover: RDS Proxy (keeps connections) or Aurora Global Database for region-level failure.

  4. When is Multi-AZ enough and when do you need Multi-Region?

    Show answer

    Multi-AZ is enough for most HA requirements (99.99%); AZ failure is the main scenario and it costs much less. Multi-Region only when: (1) DR requires very low RTO/RPO even if an entire region is lost, (2) compliance mandates geographic redundancy, (3) global users need low-latency writes (active-active). Classic exam trap: choosing Multi-Region when the question only asks for "highly available" is over-engineering, wrong under the "simplest solution that meets requirements" criterion.

  5. Distinguish RTO and RPO, and which strategy is optimal for "RPO 5 minutes, RTO 1 hour, most cost-effective"?

    Show answer

    RTO = maximum time to restore the service; RPO = maximum acceptable data loss (measured in time). With an RPO of 5 minutes → periodic backups are not enough, you need continuous replication (DB replica or DRS); an RTO of 1 hour → no need for compute running in advance. The cost-optimal answer: Pilot Light: data is replicated continuously (DB replica ON), compute is off, and it is only scaled up when disaster strikes, within the 1-hour RTO. Warm Standby satisfies it but costs more → wrong under the "most cost-effective" keyword.

  6. What is the core difference between Pilot Light and Warm Standby?

    Show answer

    Pilot Light: only the data layer is alive (DB replica); compute is off/not provisioned. In a disaster you must start + scale, RTO 10–30 minutes. Warm Standby: the full stack runs at minimum capacity and can already serve traffic (can be tested continuously); you only need to scale up + switch DNS, RTO minutes, RPO seconds. Mnemonic: Pilot Light = "the pilot flame" (can't cook yet), Warm Standby = "a small burner already on" (cooks a little, turn up the heat and you're done).

  7. What requirement does AWS Backup Vault Lock address?

    Show answer

    WORM (write-once-read-many) for backups: it prevents deleting/modifying backups before their retention ends, even by root/admin (compliance mode), protecting against ransomware deleting backups and meeting compliance retention. Combine it with cross-account backup into a separate account (a backup account in Organizations) so a compromise of the production account cannot reach the backups. Keyword: "protect backups from accidental or malicious deletion" → Backup Vault Lock (+ cross-account copy).

  8. Why does a low DNS TTL matter for failover, and what is the solution when clients cache DNS for a long time?

    Show answer

    Route 53 failover only changes the DNS answer; clients that still cache the old record per the TTL keep calling the dead endpoint. A low TTL (30–60s) makes traffic shift quickly, at the cost of more queries. When you cannot control client caching (ISP resolvers, apps holding connections): use AWS Global Accelerator: anycast static IPs, failover at the network layer independent of DNS, shifting traffic within seconds. This is a common differentiator between Route 53 failover and Global Accelerator.

  9. GuardDuty vs Inspector vs Macie vs Detective: which service does what?

    Show answer

    GuardDuty: continuous ML-based threat detection on CloudTrail/VPC Flow Logs/DNS logs; detects compromised credentials, crypto mining, C2 traffic. Inspector: scans for vulnerabilities (CVEs) on EC2, ECR images, Lambda. Macie: discovers sensitive data (PII) in S3. Detective: root-cause investigation after a finding (graph analysis). The standard chain: GuardDuty detects → Security Hub aggregates → Detective investigates. Keyword "PII in S3" → Macie; "CVE/vulnerability" → Inspector.

  10. What problem do Multi-Region KMS keys solve, and what don't they solve?

Show answer

They solve: the same key material in multiple regions (primary + replicas) → data encrypted in region A can be decrypted in region B without re-encryption; needed for DR, Aurora Global/DynamoDB Global Tables with client-side encryption, cross-region digital signatures. They don't solve: they are not a global key (each replica is a separate resource with its own policy), they don't sync policies automatically, and they are not a way to "lock data in one region" (that is the job of an SCP with aws:RequestedRegion).

  1. How does a Security Group differ from a NACL, and which layer blocks DDoS?
Show answer

Security Group: stateful, attached to an ENI/instance, allow rules only, evaluates all rules. NACL: stateless (you must open the return direction + ephemeral ports), attached to a subnet, has deny rules, evaluated in rule-number order; used to block a specific IP/CIDR (SGs cannot deny). DDoS is not blocked at these 2 layers: L3/4 → Shield (Standard is automatic, Advanced adds DRT + cost protection), L7 → WAF rate-based rules, volumetric → CloudFront/Route 53 absorb it at the edge.

  1. Where does AWS Network Firewall sit in the architecture, and how does it differ from Security Groups/WAF?
Show answer

Network Firewall is deployed into a dedicated firewall subnet and inspects traffic between the VPC and the internet/on-prem (route tables steer traffic through the firewall endpoint); it is often centralized in an inspection VPC with Transit Gateway for multi-VPC. Capabilities beyond SG/NACL: stateful deep packet inspection, IPS signatures (Suricata rules), domain filtering for egress. WAF only does L7 HTTP on ALB/CloudFront/API GW; Network Firewall does L3–L7 network-wide. Keyword "centralized egress filtering / IPS for all VPCs" → Network Firewall + TGW.

  1. A company with 150 accounts wants every ALB in every account to have the same set of WAF rules attached, including ALBs created in the future. What is the solution with the least operational overhead?
Show answer

AWS Firewall Manager (from the delegated admin account) with a WAF policy scoped to OUs/accounts: Firewall Manager automatically creates the web ACL in each account and automatically attaches it to new resources matching the scope (ALB, API Gateway, CloudFront), and reports non-compliance if someone detaches it. Requirements: Organizations with all features + AWS Config enabled in the accounts. CloudFormation StackSets only deploy the web ACL; they don't attach it to ALBs created later and don't detect a detach drift.

  1. Which controls make up a "data perimeter", and what are the corresponding services/condition keys?
Show answer

Three sides: (1) Identity perimeter: only trusted principals access my resources → RCP or resource policy with aws:PrincipalOrgID (+ aws:PrincipalIsAWSService for service principals); (2) Resource perimeter: my principals only access resources in my org → SCP with aws:ResourceOrgID; (3) Network perimeter: only from trusted networks → VPC endpoint policy / resource policy with aws:SourceVpc, aws:SourceVpce, aws:SourceIp. The question "prevent exfiltration to external S3 bucket" → SCP aws:ResourceOrgID; "prevent our bucket from being shared externally" → RCP aws:PrincipalOrgID.

  1. How do SSE-S3, SSE-KMS and SSE-C differ?
Show answer

SSE-S3: AWS manages the key entirely (AES-256), the default for new objects, no per-key audit trail. SSE-KMS: the key lives in KMS; you get a CloudTrail audit of key usage, a key policy controls who can decrypt, and you can use a customer managed key + rotation; subject to KMS API quotas (use S3 Bucket Key to reduce calls). SSE-C: you send the key with every request and AWS does not store it; rarely used, only when you must hold the key yourself but still want S3 to encrypt. Keyword "audit key usage / control who can decrypt" → SSE-KMS.

  1. When should you choose CloudHSM over KMS?
Show answer

When you need: (1) a single-tenant dedicated HSM where AWS has no access to the key material, (2) apps that use PKCS#11/JCE/CNG directly (Oracle TDE, SQL Server TDE, custom crypto, SSL offload), (3) a KMS custom key store backed by CloudHSM, (4) a contractual requirement that "keys are not managed by the cloud provider". You NO LONGER choose CloudHSM just for FIPS 140-3 L3; KMS has also met this level since 02/2025 (140-2 L3 since 2023). For most use cases integrated with AWS services → KMS.

  1. How does ACM issue certificates, and what are its limitations?
Show answer

ACM issues free public certificates with DNS/email validation and renews them automatically, integrated with ALB/NLB, CloudFront, API Gateway. Limitations: you cannot export the private key (for the public certificates); certificates for CloudFront must be in us-east-1; you cannot install them directly on EC2/on-prem (you need ACM Private CA or a paid exportable certificate). Keyword "eliminate certificate renewal overhead" → ACM.

  1. How does AWS Artifact differ from AWS Audit Manager?
Show answer

Artifact: a portal to download AWS's own compliance reports (SOC, PCI, ISO) and sign agreements (BAA for HIPAA, GDPR DPA); evidence for AWS's side of the shared responsibility model. Audit Manager: automatically collects evidence from your own workloads (Config, CloudTrail, Security Hub) against a framework (PCI, HIPAA...) to prepare for the customer-side audit. The question "provide AWS's SOC 2 report to the auditor" → Artifact; "automatically collect evidence for an internal audit" → Audit Manager.

Hands-on Exercises

Part 1: High Availability Architectures

  1. Build a Multi-AZ web tier: ALB + ASG (min 2, across 2 AZs) + RDS Multi-AZ; terminate one instance manually and watch the ASG replace it automatically while the ALB health check removes the dead instance from rotation.

  2. Session store outside the instance: move a demo app from in-memory sessions to ElastiCache Redis; disable sticky sessions on the ALB and verify users are not logged out when an instance is terminated.

  3. Compare scaling policies: configure target tracking at CPU 50%, generate load with stress, and measure the scale-out time; switch to step scaling with a low threshold and compare the reaction speed.

Part 2: Disaster Recovery Strategies

  1. Cross-region Backup/Restore: create an AWS Backup plan for 1 EC2 + 1 RDS with a copy to a second region; perform a restore in the DR region and measure your actual RTO.

  2. Mini Pilot Light: set up a cross-region read replica for RDS MySQL, write a runbook (or CloudFormation) that promotes the replica + launches the web tier from an AMI + updates the Route 53 record; run a drill and record each timestamp.

  3. Route 53 failover: create a health check pointing at the primary endpoint, configure failover routing to an S3 static site (a "we'll be back" page); shut down the primary and measure the time from failure until DNS returns the secondary.

Part 3: Security Advanced

  1. Enable the detection trio: enable GuardDuty, Security Hub, Inspector in the lab account; generate GuardDuty sample findings and watch them flow into Security Hub in ASFF format.

  2. Macie PII scan: upload a CSV file with fake emails/card numbers to S3, run a one-time Macie job and review the findings classifying the sensitive data.

  3. Network Firewall egress filtering: build a VPC with a firewall subnet, write a Suricata rule blocking a domain (.example-bad.com) for egress traffic; verify from an EC2 instance in a private subnet that the domain is blocked while other domains still work.

Part 4: Encryption and Compliance

  1. SSE-KMS + Bucket Key: create a customer managed KMS key and a bucket with SSE-KMS default encryption and Bucket Key enabled; upload/download objects and then look at the CloudTrail Decrypt events. Explain why Bucket Key reduces KMS cost.

  2. Cross-account key policy: write a key policy that lets account B decrypt (with a kms:ViaService condition), test it from a role in account B, and understand how the key policy and IAM policy work together.

  3. ACM + ALB: request a public certificate with DNS validation through Route 53, attach it to the ALB's HTTPS listener, enable a TLS 1.3 security policy and verify with openssl s_client.

References


Next lesson →