Mã hoá khi lưu trữ và khi truyền
Dữ liệu cần được bảo vệ ở hai trạng thái: khi lưu trữ (at rest) và khi truyền qua mạng (in transit); mỗi trạng thái dùng một cơ chế mã hoá khác nhau.
KMS bảo vệ dữ liệu khi lưu trữ (at rest). Dữ liệu khi truyền (in transit) giữa client, ứng dụng và database cần SSL/TLS, và HTTPS yêu cầu SSL/TLS certificate còn hiệu lực. Mô phỏng sáu tình huống MFTECH gặp trong vận hành:
RDS DB instance của MFTECH đã được mã hoá bằng KMS. Câu hỏi đặt ra: dữ liệu khi truyền từ ứng dụng tới DB instance có được bảo vệ không? Nhấn Chạy để quan sát kết quả. Thay đổi cấu hình và chạy lại để so sánh.
- At rest: KMS.
- In transit: SSL/TLS.
- RDS DB instance chưa mã hoá không bật encryption trực tiếp được: DB snapshot → copy snapshot có encryption → restore.
- Certificate cho CloudFront: ACM certificate tại us-east-1.
- Imported certificate: ACM không tự động gia hạn; theo dõi thời hạn bằng AWS Config rule
acm-certificate-expiration-check(mặc định 14 ngày, cấu hình quadaysToExpiration) + SNS, hoặc sự kiện EventBridge “ACM Certificate Approaching Expiration” (mặc định từ 45 ngày trước).
Encryption at rest and in transit
Data needs protection in two states: at rest (stored) and in transit (moving over the network); each state uses a different encryption mechanism.
KMS protects data at rest. Data in transit between clients, applications and databases needs SSL/TLS, and HTTPS requires a valid SSL/TLS certificate. A simulation of six situations MFTECH meets in operations:
RDS DB instance của MFTECH đã được mã hoá bằng KMS. Câu hỏi đặt ra: dữ liệu khi truyền từ ứng dụng tới DB instance có được bảo vệ không? Nhấn Chạy để quan sát kết quả. Thay đổi cấu hình và chạy lại để so sánh.
- At rest: KMS.
- In transit: SSL/TLS.
- Encryption cannot be turned on directly for an existing unencrypted RDS DB instance: DB snapshot → encrypted snapshot copy → restore.
- Certificate for CloudFront: an ACM certificate in us-east-1.
- Imported certificates: ACM does not renew them automatically; track expiration with the AWS Config rule
acm-certificate-expiration-check(14 days by default, configured throughdaysToExpiration) + SNS, or the EventBridge event “ACM Certificate Approaching Expiration” (from 45 days before by default).