Ravindra BagaleCourses & study guides English Track your progress

Project: Shield, WAF, CloudFront, Route 53 आणि ALB सह DDoS-Resilient Architecture

Project: Shield+WAF+CloudFront+R53+ALB/ASG + Firewall Manager + runbooks. Ch1–3 reuse. CDN deep = survey link.

या chapter मध्ये तुम्ही काय शिकाल

  • Layered edge का
  • Reference architecture
  • How to wire
  • Incident runbooks
  • Prove + cleanup

1. Project brief

Ananya Iyer (बेंगळुरू CRM): R53 → CF+WAF → ALB/ASG, Shield Advanced, Firewall Manager, L3/L4 vs L7 runbooks.

CF/HTTPS: survey. WAF = ch1–2. Shield = ch3.

2. Layered resilience का?

हे का लागतं?

एक control अपुरा. DNS + edge + Shield + WAF + ASG + FMS + humans.

3. Reference architecture काय?

हे काय आहे?

User → R53 → CF+WAF+Shield → ALB → ASG → AppFMS = baseline ACL
Runbooks L3/L4 + L7
  1. R53 alias + health + failover
  2. CF TLS/cache/OAC
  3. WAF on CF
  4. Shield Advanced
  5. ALB/ASG + caps
  6. FMS baseline
  7. Logging+alarms

4. How: checklist + CLI

कसं करायचं (step by step)

# 0) Decisions
# - Shield Advanced: yes (memo from ch3)
# - WAF scope for public: CLOUDFRONT in us-east-1
# - Regional WAF on ALB: optional second layer

# 1) Web ACL (us-east-1, CLOUDFRONT) — rules from ch2 pattern
aws wafv2 create-web-acl --name crm-public-edge --scope CLOUDFRONT --region us-east-1 \
  --default-action Allow={} --visibility-config SampledRequestsEnabled=true,CloudWatchMetricsEnabled=true,MetricName=crmPublicEdge \
  --rules file://edge-rules.json

# 2) Attach to CloudFront distribution (WebACLId = ACL ARN)
# (distribution create/update — see survey chapter for HTTPS/OAC)

# 3) Route 53 alias A/AAAA to CloudFront; health check on /health
# 4) Shield Advanced protections on CF, R53 hosted zone, ALB; create protection group
# 5) Firewall Manager security policy: WAFv2 → associate to CloudFront resources in org OUs
# 6) Alarms: Shield DDoS detected, WAF BlockedRequests spike, ALB 5xx, ASG at MaxSize

5. Firewall Manager

FMS = central WAF/Shield/SG policies. इथे: Public OU वर CRS+SQLi required.

6. Incident runbooks

Runbook A — L3/L4

  1. Declare + page.
  2. Shield metrics.
  3. DNS/edge up?
  4. Engage SRT.
  5. ASG caps.
  6. Status page.
  7. Evidence.

Runbook B — L7

  1. WAF metrics.
  2. Tighten rules.
  3. Count→Block.
  4. CAPTCHA browsers.
  5. SRT L7.
  6. Expiry ticket.

Runbook C — false positive

  1. ruleId.
  2. Count/Allow.
  3. ACL delete नको.
  4. Comms.

7. Multi-industry

  • Ecommerce flash
  • Fintech APIs
  • Healthcare redact
  • Gaming titles
  • Gov FMS

8. Lab: diagram + tabletop + proof

Org block नसेल तर ap-south-1 (Mumbai). आधी budget alert.

कसं करायचं (step by step)

  1. Draw diagram.
  2. ACL+CF.
  3. 403 proof.
  4. Runbooks.
  5. FMS draft.

Cleanup (billing थांबवा)

  1. Cleanup ACL.
  2. Revert emergency.
  3. Shield budget.

9. सामान्य errors आणि fixes

प्रत्येक row = खरी चूक. Panic करण्याआधी fix वाचा.

Error / लक्षणFix
No blocksScope + Count.
False positiveCount + Allow.
Rate silentThreshold + IP source.
Health 403Allow health IPs.
CAPTCHA on APIAPI = Block/rate.
Empty logsARN + bucket policy.
CF associate failus-east-1.
Shield costConfirm pricing.
ASG spiralMaxSize+budget.
FMS conflictExemptions.
Empty failoverStage status.
Wrong runbookClassify layer.

10. Troubleshooting checklist

  1. Scope check.
  2. Sampled requests.
  3. Priority order.
  4. curl -v.
  5. Log ruleId.
  6. CF region.
  7. ALB ARN.
  8. Shield health.

11. FAQ

प्र. WAF = network firewall?

नाही — WAF = L7 HTTP.

प्र. CF असताना WAF?

CF ≠ WAF; L7 rules साठी WAF.

प्र. Count vs Block?

Count शिकण्यासाठी; Block नंतर.

प्र. Standard vs Advanced?

Free L3/L4 vs paid extras.

प्र. CF+ALB WAF?

Edge primary; ALB optional.

प्र. FMS vs Config?

Deploy vs audit.

प्र. Runbook owner?

On-call + security.

प्र. ASG = DDoS control?

Caps + Shield/WAF.

12. Interview Q&A

प्र. Draw edge?

R53 CF WAF Shield ALB.

प्र. One-liners?

DDoS/L7/ports.

प्र. FMS why?

Org baseline.

प्र. L7 first 5m?

Metrics→tighten→comms.

प्र. MNC bill shock?

Max+budget+Shield+cache.

प्र. MNC evidence?

Time+ids+metrics.

प्र. Vs survey?

Full resilience.

प्र. Protection group?

crm-public CFs.

13. Tips — English, मराठी आणि हिंदी

Ravindra Bagale's Tip (EN)

Architecture without a runbook is a slide deck. Print Runbook A/B/C next to the on-call laptop.

Ravindra Bagale's Tip (MR)

Runbook नसलेली architecture = slide deck. A/B/C print करून on-call जवळ ठेवा.

Tip (HI)

बिना runbook की architecture स्लाइड है। A/B/C प्रिंट कर on-call के पास रखें.

घरी करून बघा

  1. Diagram+403.
  2. 15m tabletop.
  3. FMS OUs.

थोडक्यात सांगायचं तर

  1. Layers.
  2. Edge WAF.
  3. Runbooks.
  4. Caps.
  5. Survey.

14. Publish करण्याआधी WAF checklist

  1. Threat एका वाक्यात.
  2. Global vs regional scope.
  3. Default action.
  4. Priority bands.
  5. Count first.
  6. CAPTCHA for humans.
  7. Logging first.
  8. Allow + 403 tests.
  9. On-call owner.
  10. CF+WAF survey link.

15. Copy-paste WAF CLI runbook

# Region for REGIONAL Web ACL (ALB / API GW). Use --scope CLOUDFRONT + us-east-1 for CDN.
export AWS_REGION=ap-south-1
export NAME=rb-waf-lab-$(date +%s)

# IP set (office allowlist example)
aws wafv2 create-ip-set --name $NAME-office --scope REGIONAL --region $AWS_REGION \
  --ip-address-version IPV4 --addresses 203.0.113.10/32

# Web ACL skeleton (default Allow; add rules in console or JSON)
aws wafv2 create-web-acl --name $NAME --scope REGIONAL --region $AWS_REGION \
  --default-action Allow={} --visibility-config SampledRequestsEnabled=true,CloudWatchMetricsEnabled=true,MetricName=$NAME \
  --rules file://rules.json

# Associate to ALB
aws wafv2 associate-web-acl --web-acl-arn $WEB_ACL_ARN --resource-arn $ALB_ARN --region $AWS_REGION

# Logging
aws wafv2 put-logging-configuration --logging-configuration \
  ResourceArn=$WEB_ACL_ARN,LogDestinationConfigs=$LOG_BUCKET_ARN

# Test
curl -s -o /dev/null -w "%{http_code}\n" https://app.example.com/
# expect 200 for allow path; 403 for blocked path

16. Interview-friendly priority bands

  • 0–99: emergency Block
  • 100–199: Allow exceptions
  • 200–499: geo/bot
  • 500–799: Managed Rules
  • 800–899: custom
  • 900–999: rate-based

छोटा number = उच्च priority. पहिला terminating action जिंकतो. Count terminate होत नाही.

17. Industry story bank

एकच WAF pattern; फक्त IP/geo/URI/rate बदला.

  • Fintech: /login /otp rate + CAPTCHA.
  • Healthcare: geo + SQLi.
  • EdTech: Challenge scrapers.
  • Ecommerce: Bot + 429.
  • Media: search rate.
  • SaaS: webhook allowlist.
  • Logistics: geo + rate.
  • Gov: CRS + CAPTCHA.
  • Gaming: Shield + rate.
  • Travel: geo + card-test block.

18. False-positive unlock runbook

  1. Sampled / logs → rule id.
  2. curl -v reproduce.
  3. Block→Count.
  4. Narrow Allow above.
  5. Label exclusions.
  6. Retest + ticket.
  7. Default Allow + empty नको.

19. PR review checklist

  • Correct scope.
  • Priority table.
  • Count → Block date.
  • Logs encrypted.
  • 200 + 403 proofs.
  • Survey link.
  • Shield decision.
  • CF+WAF survey: chapter
  • Well-Architected — पुढचा.
  • S3 policy projects.

21. Metric आणि alarm starter pack

Day-one alarms. Thresholds = starting points.

  • BlockedRequests spike
  • CountedRequests review
  • ALB 5xx
  • ASG at max
  • DDoSDetected
  • CF error rate
  • R53 unhealthy
  • Log delivery

22. Sampled requests वाचन

  1. Sampled → rule.
  2. Action/URI/country.
  3. TP/FP/CAPTCHA.
  4. Request ids → ticket.
  5. Samples+logs.

23. Glossary

TermMeaning
Web ACLRules + default
ScopeREGIONAL / CLOUDFRONT
Managed rule groupAWS/marketplace
LabelDownstream tag
Rate-based5-min threshold
SRTAdvanced humans
Protection groupShield bundle
Firewall ManagerOrg policies
Cost protectionAttack bill relief
ChallengeSilent JS

24. 15-minute tabletop

  1. Scenario inject.
  2. Classify.
  3. First clicks + page.
  4. Comms.
  5. Gap note.

25. Cost notes

WAF = ACL+rules+requests; Bot/ATP जास्त. Shield Advanced = monthly+usage. Logs = storage. Budgets ठेवा.

26. WAF पलीकडे hygiene

  • No CF bypass.
  • IAM least privilege.
  • Log bucket BPA.
  • Quarterly IP/geo.
  • Redact secrets.
  • Break-glass doc.

27. इतर chapters शी pairing

Origin OAC = S3 projects. Security pillar = Well-Architected. CDN/HTTPS = CF+WAF survey.

28. Request flow deep dive

Browser → R53 → CF → WAF → (ALB WAF) → app. Shield पहातो. Logs → SOC.

  1. DNS+TLS (Shield).
  2. Edge WAF.
  3. Cache.
  4. Origin + regional WAF.
  5. ASG serve.
  6. Metrics/logs/SRT.

29. Rule JSON anatomy

{
  "Name": "RateLogin1000",
  "Priority": 900,
  "Action": {"Block": {"CustomResponse": {"ResponseCode": 429}}},
  "VisibilityConfig": {
    "SampledRequestsEnabled": true,
    "CloudWatchMetricsEnabled": true,
    "MetricName": "RateLogin1000"
  },
  "Statement": {
    "RateBasedStatement": {
      "Limit": 1000,
      "AggregateKeyType": "IP",
      "ScopeDownStatement": {
        "ByteMatchStatement": {
          "SearchString": "/login",
          "FieldToMatch": {"UriPath": {}},
          "TextTransformations": [{"Priority": 0, "Type": "LOWERCASE"}],
          "PositionalConstraint": "STARTS_WITH"
        }
      }
    }
  }
}

30. Text transformations

  • LOWERCASE
  • URL_DECODE
  • HTML_ENTITY_DECODE
  • CMD_LINE
  • Compress/Strip
  • Ordered transforms

31. Office-hours drills

  1. Drill 1 Count.
  2. Drill 2 priority.
  3. Drill 3 curl.
  4. Drill 4 Shield.
  5. Drill 5 runbook.
  6. Drill 6 region.
  7. Drill 7 order.
  8. Drill 8 redact.

32. Change calendar

  • Day 0
  • Day 1
  • Day 2–3
  • Day 4
  • Day 5
  • Day 7
  • Day 14
  • Day 30

उजळणी, मुलाखत आणि तुलना cards

हा lesson काही मिनिटांत revise करा. Cards phone वर save करा किंवा PNG download करा. प्रत्येक card वरचा QR हा lesson उघडतो.

उजळणी card: DDoS-resilient edge. Layer the edge. Full edge stack. Draw → attach → protect → runbooks. CRM edge + caps.
उजळणी card: DDoS-resilient edge · PNG download करा · Card page उघडा
उजळणी card: Incident runbooks. Need runbooks. A/B/C runbooks. Page → classify → act. Print runbooks.
उजळणी card: Incident runbooks · PNG download करा · Card page उघडा
तुलना: Edge WAF on CloudFront vs Regional WAF on ALB. Edge WAF on CloudFront: Stop before origin. Regional WAF on ALB: Defense-in-depth.
तुलना: Edge WAF on CloudFront vs Regional WAF on ALB · PNG download करा · Card page उघडा
तुलना: Firewall Manager policy vs Local account Web ACL only. Firewall Manager policy: Org enforce. Local account Web ACL only: Easy to forget.
तुलना: Firewall Manager policy vs Local account Web ACL only · PNG download करा · Card page उघडा
मुलाखत card: Edge draw करा. Architecture. Full path. MaxSize + failover.
मुलाखत card: Edge draw करा · PNG download करा · Card page उघडा
मुलाखत card: Firewall Manager का?. Org. Org policies. No forgotten CRS.
मुलाखत card: Firewall Manager का? · PNG download करा · Card page उघडा
मुलाखत card: L7 पहिले 5 मिनिटे?. Incident. Metrics→tighten→comms. Runbook B.
मुलाखत card: L7 पहिले 5 मिनिटे? · PNG download करा · Card page उघडा
मुलाखत card: Survey vs project?. Scope. Complement not duplicate. Link survey.
मुलाखत card: Survey vs project? · PNG download करा · Card page उघडा

अजून cards: Ravi Sir's Cards.

सराव Tasks

या scenario बद्दल

Amravati Agro Market हा अमरावती मधला शेती व्यवसाय आहे. Anjali Thakre त्यांचं IT व cloud काम पाहतात. त्यांचे पैसे INR मध्ये मोजले जातात आणि AWS resources ap-south-1 Region मध्ये चालतात. खालच्या tasks मध्ये तुम्ही या lesson मध्ये शिकलेलं वापरून त्यांची खरी कामं करता. सगळी नावं, account IDs, IP addresses व numbers सरावासाठी काल्पनिक आहेत.

0 / 16

सोपं Edge

का: Edge.

काय करायचं: CF WAF तर 1.

कसं करायचं:
  1. Task मधले numbers लिहून घ्या.
  2. कागदावर step by step काढा.
  3. Box मध्ये फक्त final उत्तर लिहा.
  4. Check answer दाबा.

सोपं FMS

का: Org.

काय करायचं: FMS तर 1.

कसं करायचं:
  1. Task मधले numbers लिहून घ्या.
  2. कागदावर step by step काढा.
  3. Box मध्ये फक्त final उत्तर लिहा.
  4. Check answer दाबा.

सोपं MaxSize

का: Bill.

काय करायचं: MaxSize तर 1.

कसं करायचं:
  1. Task मधले numbers लिहून घ्या.
  2. कागदावर step by step काढा.
  3. Box मध्ये फक्त final उत्तर लिहा.
  4. Check answer दाबा.

सोपं Flow

का: Order.

काय करायचं: Route53.

कसं करायचं:
  1. Task मधल्या top-level keys पासून सुरू करा.
  2. Child keys 2 spaces ने indent करा (tabs नकोत).
  3. प्रत्येक property मध्ये task मधली value भरा.
  4. Check answer दाबा. Keys चा क्रम महत्त्वाचा नाही.

सोपं List CF

का: Edge.

काय करायचं: List CF ACLs.

कसं करायचं:
  1. Task वाचा आणि ते कोणत्या AWS service बद्दल आहे ते ठरवा.
  2. aws लिहा, मग service चं नाव, मग operation (action शब्द).
  3. प्रत्येक आवश्यक flag (--name) व त्यापुढे task मधली value लिहा.
  4. Flags कोणत्याही क्रमाने चालतात. Check answer दाबा.

मध्यम Runbook A

का: Volumetric.

काय करायचं: A = L3/L4 तर 1.

कसं करायचं:
  1. Task मधले numbers लिहून घ्या.
  2. कागदावर step by step काढा.
  3. Box मध्ये फक्त final उत्तर लिहा.
  4. Check answer दाबा.

मध्यम Runbook B

का: HTTP.

काय करायचं: B = L7 तर 1.

कसं करायचं:
  1. Task मधले numbers लिहून घ्या.
  2. कागदावर step by step काढा.
  3. Box मध्ये फक्त final उत्तर लिहा.
  4. Check answer दाबा.

मध्यम FP

का: Unlock.

काय करायचं: No ACL delete तर 1.

कसं करायचं:
  1. Task मधले numbers लिहून घ्या.
  2. कागदावर step by step काढा.
  3. Box मध्ये फक्त final उत्तर लिहा.
  4. Check answer दाबा.

मध्यम Scope

का: CF.

काय करायचं: CLOUDFRONT.

कसं करायचं:
  1. Task मधल्या top-level keys पासून सुरू करा.
  2. Child keys 2 spaces ने indent करा (tabs नकोत).
  3. प्रत्येक property मध्ये task मधली value भरा.
  4. Check answer दाबा. Keys चा क्रम महत्त्वाचा नाही.

मध्यम Protections

का: Advanced.

काय करायचं: List protections.

कसं करायचं:
  1. Task वाचा आणि ते कोणत्या AWS service बद्दल आहे ते ठरवा.
  2. aws लिहा, मग service चं नाव, मग operation (action शब्द).
  3. प्रत्येक आवश्यक flag (--name) व त्यापुढे task मधली value लिहा.
  4. Flags कोणत्याही क्रमाने चालतात. Check answer दाबा.

मध्यम Hosted zones

का: DNS.

काय करायचं: List zones.

कसं करायचं:
  1. Task वाचा आणि ते कोणत्या AWS service बद्दल आहे ते ठरवा.
  2. aws लिहा, मग service चं नाव, मग operation (action शब्द).
  3. प्रत्येक आवश्यक flag (--name) व त्यापुढे task मधली value लिहा.
  4. Flags कोणत्याही क्रमाने चालतात. Check answer दाबा.

अवघड R53

का: Comms.

काय करायचं: Failover तर 1.

कसं करायचं:
  1. Task मधले numbers लिहून घ्या.
  2. कागदावर step by step काढा.
  3. Box मध्ये फक्त final उत्तर लिहा.
  4. Check answer दाबा.

अवघड Evidence

का: Cost.

काय करायचं: Evidence तर 1.

कसं करायचं:
  1. Task मधले numbers लिहून घ्या.
  2. कागदावर step by step काढा.
  3. Box मध्ये फक्त final उत्तर लिहा.
  4. Check answer दाबा.

अवघड Runbook

का: L7.

काय करायचं: L7_HTTP.

कसं करायचं:
  1. Task मधल्या top-level keys पासून सुरू करा.
  2. Child keys 2 spaces ने indent करा (tabs नकोत).
  3. प्रत्येक property मध्ये task मधली value भरा.
  4. Check answer दाबा. Keys चा क्रम महत्त्वाचा नाही.

अवघड FMS

का: WAF.

काय करायचं: WAFv2.

कसं करायचं:
  1. Task मधल्या top-level keys पासून सुरू करा.
  2. Child keys 2 spaces ने indent करा (tabs नकोत).
  3. प्रत्येक property मध्ये task मधली value भरा.
  4. Check answer दाबा. Keys चा क्रम महत्त्वाचा नाही.

अवघड ASG

का: Caps.

काय करायचं: Describe ASGs.

कसं करायचं:
  1. Task वाचा आणि ते कोणत्या AWS service बद्दल आहे ते ठरवा.
  2. aws लिहा, मग service चं नाव, मग operation (action शब्द).
  3. प्रत्येक आवश्यक flag (--name) व त्यापुढे task मधली value लिहा.
  4. Flags कोणत्याही क्रमाने चालतात. Check answer दाबा.