Tham chiếu security group giữa các tầng: ALB → EC2 → RDS
Hệ thống web thường có ba tầng: load balancer nhận request, EC2 instance chạy ứng dụng xử lý request, database lưu dữ liệu. Mỗi tầng chỉ nên nhận traffic từ tầng ngay trước nó.
Ứng dụng web của MFTECH gồm ba tầng: ALB tiếp nhận request của người dùng, EC2 chạy ứng dụng, RDS lưu trữ dữ liệu. Mỗi tầng chỉ nên cho phép traffic từ tầng liền trước. Chọn rule inbound cho EC2 và RDS, chạy mô phỏng, và quan sát cả request hợp lệ của người dùng lẫn request truy cập trực tiếp từ bên ngoài.
Chọn rule inbound cho từng tầng, sau đó nhấn "Chạy mô phỏng". Thử cả cấu hình cho phép 0.0.0.0/0 lẫn cấu hình tham chiếu security group để so sánh.
- Chỉ tầng ngoài cùng (ALB) cho phép traffic từ internet.
- Mỗi tầng phía sau chỉ chấp nhận traffic từ security group của tầng liền trước.
- Khi thiếu rule: ALB đánh dấu target unhealthy hoặc ứng dụng gặp lỗi “connection timed out”.
Security group referencing across tiers: ALB → EC2 → RDS
A web system usually has three tiers: a load balancer receives requests, EC2 instances running the application process them, and a database stores data. Each tier should accept traffic only from the tier just before it.
MFTECH’s web application has three tiers: an ALB receives user requests, EC2 runs the application, and RDS stores the data. Each tier should allow traffic only from the tier in front of it. Choose the inbound rules for EC2 and RDS, run the simulation, and watch both legitimate user requests and direct access attempts from outside.
Chọn rule inbound cho từng tầng, sau đó nhấn "Chạy mô phỏng". Thử cả cấu hình cho phép 0.0.0.0/0 lẫn cấu hình tham chiếu security group để so sánh.
- Only the outermost tier (the ALB) allows traffic from the internet.
- Each tier behind it accepts traffic only from the security group of the tier in front of it.
- When a rule is missing: the ALB marks the target as unhealthy or the application gets a “connection timed out” error.