Security
AWS Security & Encryption - Tổng Quan & Diagrams
Tổng quan KMS, Shield, WAF, GuardDuty, Inspector, Macie, ACM, Cognito (Diagram)
📋 Mục lục
- Overview Diagram
- Encryption: Tổng quan
- KMS - Key Management Service
- Encryption At Rest vs In Transit
- Threat Detection & Protection
- Secrets & Certificate Management
- Authentication: Cognito
- Tổng hợp: Khi nào dùng service nào?
- Security Layers tổng thể
- Best Practices
- Exam Tips
Overview Diagram
Toàn cảnh hệ thống Security & Encryption trong AWS
Bảng so sánh nhanh
| Service | Câu hỏi trả lời | Ví dụ |
|---|---|---|
| Shield | Chống DDoS? | UDP flood, SYN flood |
| WAF | Chặn web attack? | SQL injection, XSS, bot |
| GuardDuty | Ai đang tấn công? | Unusual API calls, crypto mining |
| Inspector | Có lỗ hổng bảo mật? | CVE trong EC2, ECR images |
| Macie | Có dữ liệu nhạy cảm lộ? | PII, credit cards trong S3 |
| Security Hub | Tổng hợp findings? | Aggregate từ tất cả services |
| KMS | Encrypt/Decrypt data? | S3, EBS, RDS encryption |
| CloudHSM | Cần FIPS Level 3? | Banking, government compliance |
| ACM | SSL/TLS certificates? | HTTPS cho ALB, CloudFront |
| Secrets Manager | Lưu passwords? | DB credentials, API keys |
| Cognito | User authentication? | Login, social auth, JWT |
| Artifact | AWS compliance reports? | Download SOC, PCI, ISO certs từ AWS |
| Audit Manager | Chuẩn bị audit? | Thu thập evidence tự động cho GDPR, HIPAA, PCI DSS |
Encryption: Tổng quan
3 loại Encryption trong AWS
KMS - Key Management Service
"Quản lý keys để encrypt/decrypt data"
KMS vs CloudHSM
Encryption At Rest vs In Transit
Cách encrypt từng loại resource
Threat Detection & Protection
Tầng bảo vệ từ ngoài vào trong
So sánh Threat Detection services
| Service | Scan gì? | Target | Tự động? |
|---|---|---|---|
| GuardDuty | Threats & attacks | VPC Flow, CloudTrail, DNS | ✅ Continuous, ML-based |
| Inspector | Vulnerabilities (CVE) | EC2, ECR, Lambda | ✅ Continuous scanning |
| Macie | Sensitive data (PII) | S3 buckets | ✅ / Scheduled jobs |
| Security Hub | Aggregate findings | All security services | ✅ Centralized view |
Shield + WAF: Chống tấn công từ bên ngoài
Secrets & Certificate Management
Lưu trữ và quản lý secrets
Secrets Manager vs Parameter Store
Authentication: Cognito
User Pools vs Identity Pools
Tổng hợp: Khi nào dùng service nào?
[!NOTE] Shield vs WAF cho DDoS:
- Layer 3/4 (UDP flood, SYN flood) → CHỈ Shield xử lý được (WAF không hiểu traffic này)
- Layer 7 (HTTP flood) → CẢ HAI đều chặn được: Shield Advanced detect pattern bất thường, WAF dùng rate-based rules
- Exam hỏi "chống DDoS?" → đáp án là Shield. Hỏi "rate limit HTTP?" → WAF
Câu hỏi thường gặp trong exam
| Câu hỏi | Đáp án |
|---|---|
| "Encrypt S3 objects?" | KMS (SSE-KMS) hoặc SSE-S3 |
| "FIPS 140-2 Level 3?" | CloudHSM (không phải KMS!) |
| "Auto-rotate DB password?" | Secrets Manager |
| "Free SSL certificate?" | ACM |
| "CloudFront SSL cert ở region nào?" | us-east-1 (bắt buộc) |
| "Chống DDoS?" | Shield (Standard = free) |
| "Block specific IPs?" | WAF (IP Set rules) |
| "Ai đang crypto mining trên EC2?" | GuardDuty |
| "EC2 có CVE vulnerabilities?" | Inspector |
| "PII data trong S3 buckets?" | Macie |
| "User login cho mobile app?" | Cognito User Pool |
| "Mobile access S3 directly?" | Cognito Identity Pool |
| "Tổng hợp security findings?" | Security Hub |
| "Quản lý WAF multi-account?" | Firewall Manager |
| "Download AWS compliance reports?" | Artifact (AWS's certs) |
| "Thu thập evidence cho audit?" | Audit Manager (YOUR compliance) |
Security Layers tổng thể
Defense in Depth - Bảo mật nhiều lớp
Best Practices
Exam Tips
[!TIP] Ghi nhớ nhanh:
- KMS = encrypt data, quản lý keys (dùng cho hầu hết services)
- CloudHSM = FIPS Level 3, dedicated hardware (banking/government)
- ACM = SSL/TLS certificates (FREE)
- Secrets Manager = passwords + auto-rotation
- Parameter Store = config values (FREE tier)
- Shield = DDoS protection (Standard = FREE)
- WAF = web attacks (SQL injection, XSS, bots)
- GuardDuty = threat detection (ML-based)
- Inspector = vulnerability scanning (CVE)
- Macie = PII discovery trong S3
- Cognito = user authentication (User Pool + Identity Pool)
- Artifact = download AWS's compliance reports (SOC, PCI, ISO)
- Audit Manager = thu thập evidence tự động cho YOUR audit
[!CAUTION] Dễ nhầm lẫn:
- KMS vs CloudHSM? → KMS = Level 2, CloudHSM = Level 3
- Secrets Manager vs Parameter Store? → SM = auto-rotate / PS = free
- Shield Standard vs Advanced? → Standard = free, auto / Advanced = $3K, DRT
- GuardDuty vs Inspector? → GD = threats / Inspector = vulnerabilities
- Macie vs GuardDuty? → Macie = S3 sensitive data / GD = account threats
- User Pool vs Identity Pool? → UP = authentication / IP = AWS credentials
- ACM region cho CloudFront? → us-east-1 ONLY!
- SSE-S3 vs SSE-KMS? → KMS có audit trail + key control
- Artifact vs Audit Manager? → Artifact = AWS's reports / Audit Manager = YOUR evidence