diff --git a/doc/documentation.md b/doc/documentation.md index 1212b5f..9c8709d 100644 --- a/doc/documentation.md +++ b/doc/documentation.md @@ -12,7 +12,7 @@ Query an ASN description history service (https://github.com/CIRCL/ASN-Descripti #### circl_passivedns - + Module to access CIRCL Passive DNS. @@ -20,7 +20,7 @@ Module to access CIRCL Passive DNS. #### circl_passivessl - + Modules to access CIRCL Passive SSL. @@ -34,7 +34,7 @@ Module to expand country codes. #### crowdstrike_falcon - + Module to query Crowdstrike Falcon. @@ -48,7 +48,7 @@ An expansion hover module to expand information about CVE id. #### dbl_spamhaus - + Module to check Spamhaus DBL for a domain name. @@ -62,7 +62,7 @@ A simple DNS expansion service to resolve IP address from MISP attributes. #### domaintools - + DomainTools MISP expansion module. @@ -70,7 +70,7 @@ DomainTools MISP expansion module. #### eupi - + A module to query the Phishing Initiative service (https://phishing-initiative.lu). @@ -78,7 +78,7 @@ A module to query the Phishing Initiative service (https://phishing-initiative.l #### farsight_passivedns - + Module to access Farsight DNSDB Passive DNS. @@ -110,23 +110,23 @@ Module to query IPRep data for IP addresses. #### onyphe - - + +Module to process a query on Onyphe. ----- #### onyphe_full - - + +Module to process a full query on Onyphe. ----- #### otx - + Module to get information from AlienVault OTX. @@ -134,7 +134,7 @@ Module to get information from AlienVault OTX. #### passivetotal - + The PassiveTotal MISP expansion module brings the datasets derived from Internet scanning directly into your MISP instance. This module supports passive DNS, historic SSL, WHOIS, and host attributes. In order to use the module, you must have a valid PassiveTotal account username and API key. Registration is free and can be done by visiting https://www.passivetotal.org/register @@ -156,7 +156,7 @@ Simple Reverse DNS expansion service to resolve reverse DNS from MISP attributes #### shodan - + Module to query on Shodan. @@ -170,7 +170,7 @@ Module to cache web pages of analysis reports, OSINT sources. The module returns #### threatcrowd - + Module to get information from ThreatCrowd. @@ -178,7 +178,7 @@ Module to get information from ThreatCrowd. #### threatminer - + Module to get information from ThreatMiner. @@ -186,7 +186,7 @@ Module to get information from ThreatMiner. #### virustotal - + Module to get information from virustotal. @@ -194,7 +194,7 @@ Module to get information from virustotal. #### vmray_submit - + Module to submit a sample to VMRay. @@ -202,7 +202,7 @@ Module to submit a sample to VMRay. #### vulndb - + Module to query VulnDB (RiskBasedSecurity.com). @@ -218,7 +218,7 @@ Module to query a local instance of uwhois (https://github.com/rafiot/uwhoisd). #### wiki - + An expansion hover module to extract information from Wikidata to have additional information about particular term for analysis. @@ -226,7 +226,7 @@ An expansion hover module to extract information from Wikidata to have additiona #### xforceexchange - + An expansion module for IBM X-Force Exchange. @@ -234,7 +234,7 @@ An expansion module for IBM X-Force Exchange. #### yara_syntax_validator - + An expansion hover module to perform a syntax check on if yara rules are valid or not. @@ -259,7 +259,7 @@ Module to export a MISP event in CEF format. #### goamlexport - + This module is used to export MISP events containing transaction objects into GoAML format. - **requirements**: @@ -328,7 +328,7 @@ Skeleton export module. #### threatStream_misp_export - + Module to export a structured CSV file for uploading to threatStream. - **requirements**: @@ -346,7 +346,7 @@ Module to export a structured CSV file for uploading to threatStream. #### threat_connect_export - + Module to export a structured CSV file for uploading to ThreatConnect. - **requirements**: @@ -388,7 +388,7 @@ Module to import MISP attributes from a csv file. #### cuckooimport - + Module to import Cuckoo JSON. - **features**: @@ -417,7 +417,7 @@ Module to import emails in MISP. #### goamlimport - + Module to import MISP objects about financial transactions from GoAML files. - **requirements**: @@ -490,7 +490,7 @@ Module to import ThreatAnalyzer archive.zip / analysis.json files. #### vmray_import - + Module to import VMRay (VTI) results. - **requirements**: diff --git a/doc/generate_documentation.py b/doc/generate_documentation.py index ce4d60f..283f4bc 100644 --- a/doc/generate_documentation.py +++ b/doc/generate_documentation.py @@ -2,27 +2,32 @@ import os import json -root_path = os.path.dirname(os.path.realpath(__file__)) module_types = ['expansion', 'export_mod', 'import_mod'] titles = ['Expansion Modules', 'Export Modules', 'Import Modules'] markdown= ["# MISP modules documentation\n"] -for _path, title in zip(module_types, titles): - markdown.append('\n## {}\n'.format(title)) - current_path = os.path.join(root_path, _path) - files = sorted(os.listdir(current_path)) - for _file in files: - markdown.append('\n#### {}\n'.format(_file.split('.json')[0])) - filename = os.path.join(current_path, _file) - with open(filename, 'rt', encoding='utf-8') as f: - definition = json.loads(f.read()) - if 'logo' in definition: - markdown.append('\n\n'.format(definition.pop('logo'))) - if 'description' in definition: - markdown.append('\n{}\n'.format(definition.pop('description'))) - for field, value in definition.items(): - if value: - value = ', '.join(value) if isinstance(value, list) else '{}'.format(value.replace('\n', '\n>')) - markdown.append('- **{}**:\n>{}\n'.format(field, value)) - markdown.append('\n-----\n') -with open('documentation.md', 'w') as w: - w.write(''.join(markdown)) + +def generate_doc(root_path): + for _path, title in zip(module_types, titles): + markdown.append('\n## {}\n'.format(title)) + current_path = os.path.join(root_path, _path) + files = sorted(os.listdir(current_path)) + for _file in files: + markdown.append('\n#### {}\n'.format(_file.split('.json')[0])) + filename = os.path.join(current_path, _file) + with open(filename, 'rt', encoding='utf-8') as f: + definition = json.loads(f.read()) + if 'logo' in definition: + markdown.append('\n\n'.format(definition.pop('logo'))) + if 'description' in definition: + markdown.append('\n{}\n'.format(definition.pop('description'))) + for field, value in definition.items(): + if value: + value = ', '.join(value) if isinstance(value, list) else '{}'.format(value.replace('\n', '\n>')) + markdown.append('- **{}**:\n>{}\n'.format(field, value)) + markdown.append('\n-----\n') + with open('documentation.md', 'w') as w: + w.write(''.join(markdown)) + +if __name__ == '__main__': + root_path = os.path.dirname(os.path.realpath(__file__)) + generate_doc(root_path)