From dbcd26c977bc21052c4e2b9073d5799b4129a5ef Mon Sep 17 00:00:00 2001 From: Andrija Panic <45762285+andrijapanicsb@users.noreply.github.com> Date: Fri, 11 Oct 2019 13:56:48 +0200 Subject: [PATCH 1/2] Update CsApp.py --- systemvm/debian/opt/cloud/bin/cs/CsApp.py | 28 +++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/systemvm/debian/opt/cloud/bin/cs/CsApp.py b/systemvm/debian/opt/cloud/bin/cs/CsApp.py index 575ab2ac5b26..c1eccb5d382a 100755 --- a/systemvm/debian/opt/cloud/bin/cs/CsApp.py +++ b/systemvm/debian/opt/cloud/bin/cs/CsApp.py @@ -88,17 +88,17 @@ class CsDnsmasq(CsApp): def add_firewall_rules(self): """ Add the necessary firewall rules """ - self.fw.append(["", "front", - "-A INPUT -i %s -p udp -m udp --dport 67 -j ACCEPT" % self.dev - ]) - - if self.config.has_dns(): - self.fw.append([ - "", "front", - "-A INPUT -i %s -d %s/32 -p udp -m udp --dport 53 -j ACCEPT" % (self.dev, self.ip) - ]) - - self.fw.append([ - "", "front", - "-A INPUT -i %s -d %s/32 -p tcp -m tcp --dport 53 -j ACCEPT" % (self.dev, self.ip) - ]) +# self.fw.append(["", "front", +# "-A INPUT -i %s -p udp -m udp --dport 67 -j ACCEPT" % self.dev +# ]) +# +# if self.config.has_dns(): +# self.fw.append([ +# "", "front", +# "-A INPUT -i %s -d %s/32 -p udp -m udp --dport 53 -j ACCEPT" % (self.dev, self.ip) +# ]) +# +# self.fw.append([ +# "", "front", +# "-A INPUT -i %s -d %s/32 -p tcp -m tcp --dport 53 -j ACCEPT" % (self.dev, self.ip) +# ]) From 08b12675bc78bfe3ccb80e2b6c356570dc6635c7 Mon Sep 17 00:00:00 2001 From: Daan Hoogland Date: Fri, 18 Oct 2019 14:54:25 +0200 Subject: [PATCH 2/2] remove completely if not used --- systemvm/debian/opt/cloud/bin/cs/CsAddress.py | 6 +----- systemvm/debian/opt/cloud/bin/cs/CsApp.py | 21 ------------------- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/systemvm/debian/opt/cloud/bin/cs/CsAddress.py b/systemvm/debian/opt/cloud/bin/cs/CsAddress.py index 8e678251fe32..b5f48cd1222f 100755 --- a/systemvm/debian/opt/cloud/bin/cs/CsAddress.py +++ b/systemvm/debian/opt/cloud/bin/cs/CsAddress.py @@ -21,7 +21,7 @@ import time import CsHelper from CsDatabag import CsDataBag -from CsApp import CsApache, CsDnsmasq, CsPasswdSvc +from CsApp import CsApache, CsPasswdSvc from CsRoute import CsRoute from CsRule import CsRule @@ -566,10 +566,6 @@ def post_config_change(self, method): logging.error( "Not able to setup source-nat for a regular router yet") - if self.config.has_dns() or self.config.is_dhcp(): - dns = CsDnsmasq(self) - dns.add_firewall_rules() - if self.config.has_metadata(): app = CsApache(self) app.setup() diff --git a/systemvm/debian/opt/cloud/bin/cs/CsApp.py b/systemvm/debian/opt/cloud/bin/cs/CsApp.py index c1eccb5d382a..0b0ee1c6153c 100755 --- a/systemvm/debian/opt/cloud/bin/cs/CsApp.py +++ b/systemvm/debian/opt/cloud/bin/cs/CsApp.py @@ -81,24 +81,3 @@ def stop(self): def restart(self): CsHelper.service("cloud-password-server@%s" % self.ip, "restart") - -class CsDnsmasq(CsApp): - """ Set up dnsmasq """ - - def add_firewall_rules(self): - """ Add the necessary firewall rules - """ -# self.fw.append(["", "front", -# "-A INPUT -i %s -p udp -m udp --dport 67 -j ACCEPT" % self.dev -# ]) -# -# if self.config.has_dns(): -# self.fw.append([ -# "", "front", -# "-A INPUT -i %s -d %s/32 -p udp -m udp --dport 53 -j ACCEPT" % (self.dev, self.ip) -# ]) -# -# self.fw.append([ -# "", "front", -# "-A INPUT -i %s -d %s/32 -p tcp -m tcp --dport 53 -j ACCEPT" % (self.dev, self.ip) -# ])