Skip to content

Commit

Permalink
#212 add submodules summary and build_taxonomy support
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromeleonard committed Jun 1, 2018
1 parent 86abb17 commit 3ddbb70
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions analyzers/FileInfo/submodules/submodule_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class SubmoduleBaseclass(object):
def __init__(self):
self.name = 'This is where the module name should go.'
self.results = []
self.summary = []

def get_name(self):
"""
Expand All @@ -12,6 +13,21 @@ def get_name(self):
"""
return self.name

def build_taxonomy(self, level, namespace, predicate, value):
"""
:param level: info, safe, suspicious or malicious
:param namespace: Name of analyzer
:param predicate: Name of service
:param value: value
:return: dict
"""
return {
'level': level,
'namespace': namespace,
'predicate': predicate,
'value': value
}

def check_file(self, **kwargs):
"""
Checks if a file can be analyzed by the respective submodule. This can be done using the file-parameter or the
Expand Down Expand Up @@ -40,15 +56,17 @@ def analyze_file(self, path):
"""
pass

def add_result_subsection(self, subsection_header, results):
def add_result_subsection(self, subsection_header, results, summary={"taxonomies": []}):
"""
Adding a subsection to the section of the analyzer module
:param subsection_header: header of the subsection
:param results: result dictionary or list
:param summary: result dictionary
:return:
"""
self.results.append({
"submodule_section_header": subsection_header,
"submodule_section_content": results
"submodule_section_content": results,
"submodule_section_summary": summary
})

0 comments on commit 3ddbb70

Please sign in to comment.