mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-07 17:52:46 +01:00
Add unit tests for Urlhaus; remove placeholder whois analyzer
This commit is contained in:
@@ -1,24 +1,22 @@
|
||||
import os
|
||||
import json
|
||||
import inspect
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def checkSupportedType(meta, artifact_type):
|
||||
if artifact_type not in meta['supportedTypes']:
|
||||
sys.exit("No supported type detected!")
|
||||
sys.exit(126)
|
||||
else:
|
||||
return True
|
||||
|
||||
|
||||
def loadData(artifact):
|
||||
request_data = json.loads(artifact)
|
||||
artifact_value = request_data['value']
|
||||
artifact_type = request_data['artifactType']
|
||||
return artifact_type, artifact_value
|
||||
def parseArtifact(artifact):
|
||||
data = json.loads(artifact)
|
||||
return data
|
||||
|
||||
|
||||
def loadMeta(file):
|
||||
def loadMetadata(file):
|
||||
dir = os.path.dirname(os.path.realpath(file))
|
||||
filename = os.path.realpath(file).rsplit('/', 1)[1].split('.')[0]
|
||||
with open(str(dir + "/" + filename + ".json"), "r") as metafile:
|
||||
return json.load(metafile)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user