Skip to content

Commit 178591a

Browse files
committed
Add source CIDR filter on OUTPUT chain rule
1 parent dcc3446 commit 178591a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

systemvm/debian/opt/cloud/bin/configure.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,10 @@ def forward_vpc(self, rule):
14791479
if not rule["internal_ports"] == "any":
14801480
fw_prerout_rule += ":" + self.portsToString(rule["internal_ports"], "-")
14811481

1482-
fw_output_rule = "-A OUTPUT -d %s/32" % rule["public_ip"]
1482+
fw_output_rule = "-A OUTPUT"
1483+
if "source_cidr_list" in rule and rule["source_cidr_list"]:
1484+
fw_output_rule += " -s %s" % rule["source_cidr_list"]
1485+
fw_output_rule += " -d %s/32" % rule["public_ip"]
14831486
if not rule["protocol"] == "any":
14841487
fw_output_rule += " -m %s -p %s" % (rule["protocol"], rule["protocol"])
14851488
if not rule["public_ports"] == "any":

0 commit comments

Comments
 (0)