Skip to content

Commit 742f845

Browse files
committed
Add source CIDR filter on OUTPUT chain rule
1 parent b76dbcd commit 742f845

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
@@ -1229,7 +1229,10 @@ def forward_vpc(self, rule):
12291229
if not rule["internal_ports"] == "any":
12301230
fw_prerout_rule += ":" + self.portsToString(rule["internal_ports"], "-")
12311231

1232-
fw_output_rule = "-A OUTPUT -d %s/32" % rule["public_ip"]
1232+
fw_output_rule = "-A OUTPUT"
1233+
if "source_cidr_list" in rule and rule["source_cidr_list"]:
1234+
fw_output_rule += " -s %s" % rule["source_cidr_list"]
1235+
fw_output_rule += " -d %s/32" % rule["public_ip"]
12331236
if not rule["protocol"] == "any":
12341237
fw_output_rule += " -m %s -p %s" % (rule["protocol"], rule["protocol"])
12351238
if not rule["public_ports"] == "any":

0 commit comments

Comments
 (0)