From 1509ac5cd96507fb391f0266d30ef312babb1fb7 Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Thu, 11 Apr 2019 09:55:17 -0500 Subject: [PATCH] Resolves Bandit 104 errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From Bandit's docs: Binding to all network interfaces can potentially open up a service to traffic on unintended interfaces, that may not be properly documented or secured. This plugin test looks for a string pattern “0.0.0.0” that may indicate a hardcoded binding to all network interfaces. This change fixes B104 errors by removing an unused method and ignoring a default line used for manifest generation. Change-Id: Id9cf501829be0166dff933e013c7ac47088bb763 --- spyglass/parser/engine.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/spyglass/parser/engine.py b/spyglass/parser/engine.py index dd9d5ce..86f3777 100755 --- a/spyglass/parser/engine.py +++ b/spyglass/parser/engine.py @@ -86,18 +86,6 @@ class ProcessDataSource(object): LOG.debug("Genesis Node Details:\n{}".format( pprint.pformat(self.genesis_node))) - def _get_genesis_node_ip(self): - """Returns the genesis node ip""" - - ip = "0.0.0.0" - LOG.info("Getting Genesis Node IP") - if not self.genesis_node: - self._get_genesis_node_details() - ips = self.genesis_node.get("ip", "") - if ips: - ip = ips.get("oam", "0.0.0.0") - return ip - def _validate_intermediary_data(self, data): """Validates the intermediary data before generating manifests. @@ -312,7 +300,7 @@ class ProcessDataSource(object): # OAM have default routes. Only for cruiser. TBD if net_type == "oam": - routes = ["0.0.0.0/0"] + routes = ["0.0.0.0/0"] # nosec else: routes = [] vlan_network_data_[net_type]["routes"] = routes