def __init__(self):
self.__set_encoding()
# Prepare in/out/err streams
self.fperror = sys.stderr
self.fpinput = sys.stdin
self.fpoutput = sys.stdout
# Load input
self.__input = json.load(self.fpinput)
# Set parameters
self.data_type = self.get_param('dataType', None, 'Missing dataType field')
self.tlp = self.get_param('tlp', 2)
self.enable_check_tlp = self.get_param('config.check_tlp', False)
self.max_tlp = self.get_param('config.max_tlp', 2)
# Set proxy configuration if available
self.http_proxy = self.get_param('config.proxy.http')
self.https_proxy = self.get_param('config.proxy.https')
self.__set_proxies()
# Finally run check tlp
if not (self.__check_tlp()):
self.error('TLP is higher than allowed.')
# Not breaking compatibility
self.artifact = self.__input
# Check for auto extraction config
self.auto_extract = self.get_param('config.auto_extract', True)
# Not breaking compatibility
评论列表
文章目录