Tạo Security Group
Tạo Security Group trong Amazon VPC
ℹ️ Tổng quan
- Security Group là tường lửa ảo cho các tài nguyên AWS
- Hoạt động như danh sách kiểm soát truy cập (ACL) ở cấp instance
- Cho phép kiểm soát lưu lượng vào/ra theo port và protocol
🔒 Tạo Security Group cho Public Subnet
- Truy cập giao diện VPC
- Chọn Security Groups từ menu bên trái
- Click Create security group

- Cấu hình thông tin cơ bản
- Security Group name: Nhập
Public subnet - SG
- Description: Nhập Allow SSH and Ping for servers in public subnet
- VPC: Chọn VPC ASG

- Thiết lập Inbound Rules
- Click Add rule
- Rule 1:
- Type: SSH
- Source: My IP (địa chỉ IPv4 public của bạn)
- Rule 2:
- Type: All ICMP - IPv4
- Source: Anywhere (cho phép ping từ mọi nơi)

- Xác nhận Outbound Rules và tạo Security Group

- Kiểm tra Security Group đã tạo

🔒 Tạo Security Group cho Private Subnet
- Truy cập lại giao diện Security Groups
- Click Create security group

- Cấu hình thông tin cơ bản
- Security Group name: Nhập
Private subnet - SG
- Description: Nhập Allow SSH and Ping for servers in private subnet
- VPC: Chọn VPC ASG

- Thiết lập Inbound Rules cho SSH
- Click Add rule
- Type: SSH
- Source: Custom
- Chọn Security Group Public subnet - SG

- Thêm rule cho ICMP
- Click Add rule
- Type: All ICMP - IPv4
- Source: Anywhere

- Hoàn tất tạo Security Group

Cấu hình Security Group cho VPC Endpoints
-
Tạo security group bổ sung cho VPC endpoints:
- Quay lại Security Groups
- Nhấp Create security group
- Security group name: Nhập
VPC-Endpoints-SG
- Description: Nhập
Security group for VPC endpoints
- VPC: Chọn VPC ASG từ dropdown
-
Cấu hình quy tắc security group cho VPC Endpoints:
-
Cập nhật Private Subnet Security Group để truy cập VPC endpoint:
- Chọn Private subnet - SG
- Nhấp Actions > Edit outbound rules
- Đảm bảo quy tắc outbound sau tồn tại:
- Type: HTTPS
- Destination: 0.0.0.0/0
- Description:
HTTPS to AWS services and VPC endpoints
- Nhấp Save rules
💡 Xác nhận Cấu hình
14. Kiểm tra ba Security Groups đã tạo:
- Public subnet - SG: Cho phép SSH từ IP của bạn và ICMP từ VPC
- Private subnet - SG: Cho phép SSH từ Public subnet và ICMP từ VPC
- VPC-Endpoints-SG: Cho phép HTTPS từ VPC để truy cập AWS services
