Description
An IN rule with cidr_ip = "0.0.0.0/0" includes every IPv4 source. Check whether the service is a public website or is intended only for internal clients.
Potential impact
Any client in the allowed range can attempt a connection if it has a route to the listening service.
Remediation
For internal services, allow only the required sources and ports. Route administrative connections through a VPN or jump host. After applying, verify that new connections succeed only from approved clients.
Examples
The http group’s TCP port 80 rule narrows the source from 0.0.0.0/0 to 10.0.0.0/16. Use the range your clients actually connect from. HTTP traffic still travels unencrypted.
Before
hcl
resource "nifcloud_security_group_rule" "web_ingress" {
security_group_names = ["http"]
type = "IN"
description = "HTTP from anywhere"
from_port = 80
to_port = 80
protocol = "TCP"
cidr_ip = "0.0.0.0/0"
}
After
hcl
resource "nifcloud_security_group_rule" "web_ingress" {
security_group_names = ["http"]
type = "IN"
description = "HTTP from internal network"
from_port = 80
to_port = 80
protocol = "TCP"
cidr_ip = "10.0.0.0/16"
}