Sort instances by reference to avoid attacks

parent d754afe3
...@@ -28,6 +28,7 @@ from slapos.recipe.librecipe import BaseSlapRecipe ...@@ -28,6 +28,7 @@ from slapos.recipe.librecipe import BaseSlapRecipe
import os import os
import pkg_resources import pkg_resources
import hashlib import hashlib
import operator
import sys import sys
import zc.buildout import zc.buildout
import zc.recipe.egg import zc.recipe.egg
...@@ -76,6 +77,10 @@ class Recipe(BaseSlapRecipe): ...@@ -76,6 +77,10 @@ class Recipe(BaseSlapRecipe):
slave_dict = {} slave_dict = {}
service_dict = {} service_dict = {}
# Sort slave instance by reference to avoid most security issues
slave_instance_list = sorted(slave_instance_list,
key=operator.itemgetter('slave_reference'))
for slave_instance in slave_instance_list: for slave_instance in slave_instance_list:
backend_url = slave_instance.get("url", None) backend_url = slave_instance.get("url", None)
reference = slave_instance.get("slave_reference") reference = slave_instance.get("slave_reference")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment