Instead of allowing SSH (port 22) from anywhere (0.0.0.0/0), specify only trusted IP addresses or IP ranges.
Inbound Rule:
- Type: SSH
- Protocol: TCP
- Port Range: 22
- Source: <Your IP address or IP range (e.g., 203.0.113.0/24)>
Consider using a custom port for SSH or other critical services. Update your instance configuration accordingly.
Inbound Rule:
- Type: Custom TCP
- Protocol: TCP
- Port Range: 2222 (example)
- Source:
If your web application does not need to be accessible to the public, restrict access to only trusted IPs.
Inbound Rule:
- Type: HTTP or HTTPS
- Protocol: TCP
- Port Range: 80 or 443
- Source: