From 1833897d18fe0930984215372e1343cff1531b61 Mon Sep 17 00:00:00 2001 From: lhinds Date: Sat, 8 Jul 2017 16:51:27 +0100 Subject: Utilize yaml.safe_load The patch changes instances of yaml.load with yaml.safe_load which is more secure at blocking arbitrary code execution. The following blog has a decent explaination: https://www.kevinlondon.com/2015/08/15/dangerous-python-functions-pt2.html Change-Id: I8201baab6cb31ab31228eca83134f87a57c2f5d2 Signed-off-by: lhinds --- deploy/setup_vnic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'deploy/setup_vnic.py') diff --git a/deploy/setup_vnic.py b/deploy/setup_vnic.py index 7dcd8d94..de3b5ed6 100644 --- a/deploy/setup_vnic.py +++ b/deploy/setup_vnic.py @@ -13,7 +13,7 @@ import yaml if __name__ == "__main__": network_config_file = os.environ["NETWORK"] - network_config = yaml.load(open(network_config_file, "r")) + network_config = yaml.safe_load(open(network_config_file, "r")) os.system( "sudo ovs-vsctl --may-exist add-port br-external mgmt_vnic -- set Interface mgmt_vnic type=internal") # noqa os.system("sudo ip addr flush mgmt_vnic") -- cgit 1.2.3-korg