AWS Data Protection Deep Dive
1. AWS KMS (Key Management Service)
Dịch vụ quản lý khóa mã hóa.
Envelope Encryption (Mã hóa phong bì)
KMS không trực tiếp mã hóa dữ liệu lớn (GB, TB). Nó dùng cơ chế 2 lớp.
- CMK (Customer Master Key): Khóa chính, không bao giờ rời khỏi KMS HSM (Hardware Security Module).
- Data Key: Khóa dùng để mã hóa dữ liệu thật. Được sinh ra bởi CMK.
2. Secrets Manager vs Parameter Store
| Feature | Secrets Manager | Systems Manager Parameter Store |
|---|---|---|
| Purpose | Lưu Credentials (DB Password, API Key) | Lưu Config (String, List) & Secrets |
| Rotation | Tự động xoay vòng (Built-in Lambda) | Không (Phải tự viết script) |
| Cost | $0.40 / secret / tháng | Miễn phí (Standard), Có phí (Advanced) |
| Cross-account | Dễ dàng | Phức tạp hơn |
Recommendation
- Dùng Secrets Manager cho Database Password (để tận dụng tính năng Rotation).
- Dùng Parameter Store cho các biến môi trường, config app (rẻ hơn).
3. Encryption at Rest & in Transit
- At Rest: EBS, S3, RDS, DynamoDB đều hỗ trợ "1-click encryption" dùng KMS. Không ảnh hưởng đáng kể đến hiệu năng.
- In Transit: Sử dụng TLS (HTTPS) cho mọi giao tiếp. AWS Certificate Manager (ACM) cung cấp SSL certificate miễn phí cho ELB và CloudFront.