@ -0,0 +1,289 @@ |
||||
# -*- coding: utf-8; mode: python -*- |
||||
## |
||||
## Format |
||||
## |
||||
## ACTION: [AUDIENCE:] COMMIT_MSG [!TAG ...] |
||||
## |
||||
## Description |
||||
## |
||||
## ACTION is one of 'chg', 'fix', 'new' |
||||
## |
||||
## Is WHAT the change is about. |
||||
## |
||||
## 'chg' is for refactor, small improvement, cosmetic changes... |
||||
## 'fix' is for bug fixes |
||||
## 'new' is for new features, big improvement |
||||
## |
||||
## AUDIENCE is optional and one of 'dev', 'usr', 'pkg', 'test', 'doc'|'docs' |
||||
## |
||||
## Is WHO is concerned by the change. |
||||
## |
||||
## 'dev' is for developpers (API changes, refactors...) |
||||
## 'usr' is for final users (UI changes) |
||||
## 'pkg' is for packagers (packaging changes) |
||||
## 'test' is for testers (test only related changes) |
||||
## 'doc' is for doc guys (doc only changes) |
||||
## |
||||
## COMMIT_MSG is ... well ... the commit message itself. |
||||
## |
||||
## TAGs are additionnal adjective as 'refactor' 'minor' 'cosmetic' |
||||
## |
||||
## They are preceded with a '!' or a '@' (prefer the former, as the |
||||
## latter is wrongly interpreted in github.) Commonly used tags are: |
||||
## |
||||
## 'refactor' is obviously for refactoring code only |
||||
## 'minor' is for a very meaningless change (a typo, adding a comment) |
||||
## 'cosmetic' is for cosmetic driven change (re-indentation, 80-col...) |
||||
## 'wip' is for partial functionality but complete subfunctionality. |
||||
## |
||||
## Example: |
||||
## |
||||
## new: usr: support of bazaar implemented |
||||
## chg: re-indentend some lines !cosmetic |
||||
## new: dev: updated code to be compatible with last version of killer lib. |
||||
## fix: pkg: updated year of licence coverage. |
||||
## new: test: added a bunch of test around user usability of feature X. |
||||
## fix: typo in spelling my name in comment. !minor |
||||
## |
||||
## Please note that multi-line commit message are supported, and only the |
||||
## first line will be considered as the "summary" of the commit message. So |
||||
## tags, and other rules only applies to the summary. The body of the commit |
||||
## message will be displayed in the changelog without reformatting. |
||||
|
||||
|
||||
## |
||||
## ``ignore_regexps`` is a line of regexps |
||||
## |
||||
## Any commit having its full commit message matching any regexp listed here |
||||
## will be ignored and won't be reported in the changelog. |
||||
## |
||||
ignore_regexps = [ |
||||
r'@minor', r'!minor', |
||||
r'@cosmetic', r'!cosmetic', |
||||
r'@refactor', r'!refactor', |
||||
r'@wip', r'!wip', |
||||
r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*[p|P]kg:', |
||||
r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*[d|D]ev:', |
||||
r'^(.{3,3}\s*:)?\s*[fF]irst commit.?\s*$', |
||||
] |
||||
|
||||
|
||||
## ``section_regexps`` is a list of 2-tuples associating a string label and a |
||||
## list of regexp |
||||
## |
||||
## Commit messages will be classified in sections thanks to this. Section |
||||
## titles are the label, and a commit is classified under this section if any |
||||
## of the regexps associated is matching. |
||||
## |
||||
## Please note that ``section_regexps`` will only classify commits and won't |
||||
## make any changes to the contents. So you'll probably want to go check |
||||
## ``subject_process`` (or ``body_process``) to do some changes to the subject, |
||||
## whenever you are tweaking this variable. |
||||
## |
||||
section_regexps = [ |
||||
('New', [ |
||||
r'^[nN]ew\s*:\s*((dev|use?r|pkg|test|doc|docs)\s*:\s*)?([^\n]*)$', |
||||
]), |
||||
('Changes', [ |
||||
r'^[cC]hg\s*:\s*((dev|use?r|pkg|test|doc|docs)\s*:\s*)?([^\n]*)$', |
||||
]), |
||||
('Fix', [ |
||||
r'^[fF]ix\s*:\s*((dev|use?r|pkg|test|doc|docs)\s*:\s*)?([^\n]*)$', |
||||
]), |
||||
|
||||
('Other', None ## Match all lines |
||||
), |
||||
|
||||
] |
||||
|
||||
|
||||
## ``body_process`` is a callable |
||||
## |
||||
## This callable will be given the original body and result will |
||||
## be used in the changelog. |
||||
## |
||||
## Available constructs are: |
||||
## |
||||
## - any python callable that take one txt argument and return txt argument. |
||||
## |
||||
## - ReSub(pattern, replacement): will apply regexp substitution. |
||||
## |
||||
## - Indent(chars=" "): will indent the text with the prefix |
||||
## Please remember that template engines gets also to modify the text and |
||||
## will usually indent themselves the text if needed. |
||||
## |
||||
## - Wrap(regexp=r"\n\n"): re-wrap text in separate paragraph to fill 80-Columns |
||||
## |
||||
## - noop: do nothing |
||||
## |
||||
## - ucfirst: ensure the first letter is uppercase. |
||||
## (usually used in the ``subject_process`` pipeline) |
||||
## |
||||
## - final_dot: ensure text finishes with a dot |
||||
## (usually used in the ``subject_process`` pipeline) |
||||
## |
||||
## - strip: remove any spaces before or after the content of the string |
||||
## |
||||
## - SetIfEmpty(msg="No commit message."): will set the text to |
||||
## whatever given ``msg`` if the current text is empty. |
||||
## |
||||
## Additionally, you can `pipe` the provided filters, for instance: |
||||
#body_process = Wrap(regexp=r'\n(?=\w+\s*:)') | Indent(chars=" ") |
||||
#body_process = Wrap(regexp=r'\n(?=\w+\s*:)') |
||||
#body_process = noop |
||||
body_process = ReSub(r'((^|\n)[A-Z]\w+(-\w+)*: .*(\n\s+.*)*)+$', r'') | strip |
||||
|
||||
|
||||
## ``subject_process`` is a callable |
||||
## |
||||
## This callable will be given the original subject and result will |
||||
## be used in the changelog. |
||||
## |
||||
## Available constructs are those listed in ``body_process`` doc. |
||||
subject_process = (strip | |
||||
ReSub(r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*((dev|use?r|pkg|test|doc|docs)\s*:\s*)?([^\n@]*)(@[a-z]+\s+)*$', r'\4') | |
||||
SetIfEmpty("No commit message.") | ucfirst | final_dot) |
||||
|
||||
|
||||
## ``tag_filter_regexp`` is a regexp |
||||
## |
||||
## Tags that will be used for the changelog must match this regexp. |
||||
## |
||||
tag_filter_regexp = r'^v[0-9]+\.[0-9]+\.[0-9]+$' |
||||
|
||||
|
||||
|
||||
## ``unreleased_version_label`` is a string or a callable that outputs a string |
||||
## |
||||
## This label will be used as the changelog Title of the last set of changes |
||||
## between last valid tag and HEAD if any. |
||||
unreleased_version_label = "%%version%% (unreleased)" |
||||
|
||||
|
||||
## ``output_engine`` is a callable |
||||
## |
||||
## This will change the output format of the generated changelog file |
||||
## |
||||
## Available choices are: |
||||
## |
||||
## - rest_py |
||||
## |
||||
## Legacy pure python engine, outputs ReSTructured text. |
||||
## This is the default. |
||||
## |
||||
## - mustache(<template_name>) |
||||
## |
||||
## Template name could be any of the available templates in |
||||
## ``templates/mustache/*.tpl``. |
||||
## Requires python package ``pystache``. |
||||
## Examples: |
||||
## - mustache("markdown") |
||||
## - mustache("restructuredtext") |
||||
## |
||||
## - makotemplate(<template_name>) |
||||
## |
||||
## Template name could be any of the available templates in |
||||
## ``templates/mako/*.tpl``. |
||||
## Requires python package ``mako``. |
||||
## Examples: |
||||
## - makotemplate("restructuredtext") |
||||
## |
||||
#output_engine = rest_py |
||||
#output_engine = mustache("restructuredtext") |
||||
output_engine = mustache("markdown") |
||||
#output_engine = makotemplate("restructuredtext") |
||||
|
||||
|
||||
## ``include_merge`` is a boolean |
||||
## |
||||
## This option tells git-log whether to include merge commits in the log. |
||||
## The default is to include them. |
||||
include_merge = True |
||||
|
||||
|
||||
## ``log_encoding`` is a string identifier |
||||
## |
||||
## This option tells gitchangelog what encoding is outputed by ``git log``. |
||||
## The default is to be clever about it: it checks ``git config`` for |
||||
## ``i18n.logOutputEncoding``, and if not found will default to git's own |
||||
## default: ``utf-8``. |
||||
#log_encoding = 'utf-8' |
||||
|
||||
|
||||
## ``publish`` is a callable |
||||
## |
||||
## Sets what ``gitchangelog`` should do with the output generated by |
||||
## the output engine. ``publish`` is a callable taking one argument |
||||
## that is an interator on lines from the output engine. |
||||
## |
||||
## Some helper callable are provided: |
||||
## |
||||
## Available choices are: |
||||
## |
||||
## - stdout |
||||
## |
||||
## Outputs directly to standard output |
||||
## (This is the default) |
||||
## |
||||
## - FileInsertAtFirstRegexMatch(file, pattern, idx=lamda m: m.start()) |
||||
## |
||||
## Creates a callable that will parse given file for the given |
||||
## regex pattern and will insert the output in the file. |
||||
## ``idx`` is a callable that receive the matching object and |
||||
## must return a integer index point where to insert the |
||||
## the output in the file. Default is to return the position of |
||||
## the start of the matched string. |
||||
## |
||||
## - FileRegexSubst(file, pattern, replace, flags) |
||||
## |
||||
## Apply a replace inplace in the given file. Your regex pattern must |
||||
## take care of everything and might be more complex. Check the README |
||||
## for a complete copy-pastable example. |
||||
## |
||||
# publish = FileInsertIntoFirstRegexMatch( |
||||
# "CHANGELOG.rst", |
||||
# r'/(?P<rev>[0-9]+\.[0-9]+(\.[0-9]+)?)\s+\([0-9]+-[0-9]{2}-[0-9]{2}\)\n--+\n/', |
||||
# idx=lambda m: m.start(1) |
||||
# ) |
||||
#publish = stdout |
||||
|
||||
|
||||
## ``revs`` is a list of callable or a list of string |
||||
## |
||||
## callable will be called to resolve as strings and allow dynamical |
||||
## computation of these. The result will be used as revisions for |
||||
## gitchangelog (as if directly stated on the command line). This allows |
||||
## to filter exaclty which commits will be read by gitchangelog. |
||||
## |
||||
## To get a full documentation on the format of these strings, please |
||||
## refer to the ``git rev-list`` arguments. There are many examples. |
||||
## |
||||
## Using callables is especially useful, for instance, if you |
||||
## are using gitchangelog to generate incrementally your changelog. |
||||
## |
||||
## Some helpers are provided, you can use them:: |
||||
## |
||||
## - FileFirstRegexMatch(file, pattern): will return a callable that will |
||||
## return the first string match for the given pattern in the given file. |
||||
## If you use named sub-patterns in your regex pattern, it'll output only |
||||
## the string matching the regex pattern named "rev". |
||||
## |
||||
## - Caret(rev): will return the rev prefixed by a "^", which is a |
||||
## way to remove the given revision and all its ancestor. |
||||
## |
||||
## Please note that if you provide a rev-list on the command line, it'll |
||||
## replace this value (which will then be ignored). |
||||
## |
||||
## If empty, then ``gitchangelog`` will act as it had to generate a full |
||||
## changelog. |
||||
## |
||||
## The default is to use all commits to make the changelog. |
||||
#revs = ["^1.0.3", ] |
||||
#revs = [ |
||||
# Caret( |
||||
# FileFirstRegexMatch( |
||||
# "CHANGELOG.rst", |
||||
# r"(?P<rev>[0-9]+\.[0-9]+(\.[0-9]+)?)\s+\([0-9]+-[0-9]{2}-[0-9]{2}\)\n--+\n")), |
||||
# "HEAD" |
||||
#] |
||||
revs = [] |
@ -0,0 +1,53 @@ |
||||
name: Python package |
||||
|
||||
on: |
||||
push: |
||||
branches: [ main ] |
||||
pull_request: |
||||
branches: [ main ] |
||||
|
||||
jobs: |
||||
build: |
||||
|
||||
runs-on: ubuntu-latest |
||||
strategy: |
||||
fail-fast: false |
||||
matrix: |
||||
python-version: ["3.7", "3.8", "3.9", "3.10"] |
||||
|
||||
steps: |
||||
- name: Install packages |
||||
run: | |
||||
sudo apt-get install libpoppler-cpp-dev libzbar0 tesseract-ocr |
||||
- uses: actions/checkout@v2 |
||||
- name: Set up Python ${{ matrix.python-version }} |
||||
uses: actions/setup-python@v2 |
||||
with: |
||||
python-version: ${{ matrix.python-version }} |
||||
- name: Cache Python dependencies |
||||
uses: actions/cache@v2 |
||||
with: |
||||
path: ~/.cache/pip |
||||
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('REQUIREMENTS') }} |
||||
- name: Install dependencies |
||||
run: | |
||||
python -m pip install --upgrade pip |
||||
python -m pip install flake8 pytest |
||||
# pyfaul must be installed manually (?) |
||||
pip install -r REQUIREMENTS pyfaup |
||||
pip install . |
||||
- name: Lint with flake8 |
||||
run: | |
||||
# stop the build if there are Python syntax errors or undefined names |
||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
||||
- name: Test with pytest |
||||
run: | |
||||
# Run server in background |
||||
misp-modules -l 127.0.0.1 -s & |
||||
sleep 5 |
||||
# Check if modules are running |
||||
curl -sS localhost:6666/modules |
||||
# Run tests |
||||
pytest tests |
@ -0,0 +1,4 @@ |
||||
[submodule "misp_modules/lib/misp-objects"] |
||||
path = misp_modules/lib/misp-objects |
||||
url = https://github.com/MISP/misp-objects.git |
||||
branch = main |
@ -0,0 +1,3 @@ |
||||
mkdocs |
||||
pymdown-extensions |
||||
mkdocs-material |
@ -1,8 +0,0 @@ |
||||
{ |
||||
"description": "Query BGP Ranking (https://bgpranking-ng.circl.lu/).", |
||||
"requirements": ["pybgpranking python library"], |
||||
"features": "The module takes an AS number attribute as input and displays its description and history, and position in BGP Ranking.\n\n", |
||||
"references": ["https://github.com/D4-project/BGP-Ranking/"], |
||||
"input": "Autonomous system number.", |
||||
"output": "Text containing a description of the ASN, its history, and the position in BGP Ranking." |
||||
} |
@ -1,9 +0,0 @@ |
||||
{ |
||||
"description": "Module to access Farsight DNSDB Passive DNS.", |
||||
"logo": "logos/farsight.png", |
||||
"requirements": ["An access to the Farsight Passive DNS API (apikey)"], |
||||
"input": "A domain, hostname or IP address MISP attribute.", |
||||
"output": "Text containing information about the input, resulting from the query on the Farsight Passive DNS API.", |
||||
"references": ["https://www.farsightsecurity.com/"], |
||||
"features": "This module takes a domain, hostname or IP address MISP attribute as input to query the Farsight Passive DNS API. The API returns then the result of the query with some information about the value queried." |
||||
} |
@ -1,9 +0,0 @@ |
||||
{ |
||||
"description": "Module to access GreyNoise.io API", |
||||
"logo": "logos/greynoise.png", |
||||
"requirements": [], |
||||
"input": "An IP address.", |
||||
"output": "Additional information about the IP fetched from Greynoise API.", |
||||
"references": ["https://greynoise.io/", "https://github.com/GreyNoise-Intelligence/api.greynoise.io"], |
||||
"features": "The module takes an IP address as input and queries Greynoise for some additional information about it. The result is returned as text." |
||||
} |
@ -1,9 +0,0 @@ |
||||
{ |
||||
"description": "Query Lastline with an analysis link and parse the report into MISP attributes and objects.\nThe analysis link can also be retrieved from the output of the [lastline_submit](https://github.com/MISP/misp-modules/tree/master/misp_modules/modules/expansion/lastline_submit.py) expansion module.", |
||||
"logo": "logos/lastline.png", |
||||
"requirements": [], |
||||
"input": "Link to a Lastline analysis.", |
||||
"output": "MISP attributes and objects parsed from the analysis report.", |
||||
"references": ["https://www.lastline.com"], |
||||
"features": "The module requires a Lastline Portal `username` and `password`.\nThe module uses the new format and it is able to return MISP attributes and objects.\nThe module returns the same results as the [lastline_import](https://github.com/MISP/misp-modules/tree/master/misp_modules/modules/import_mod/lastline_import.py) import module." |
||||
} |
@ -1,8 +0,0 @@ |
||||
{ |
||||
"description": "Module to export a MISP event in CEF format.", |
||||
"requirements": [], |
||||
"features": "The module takes a MISP event in input, to look every attribute. Each attribute matching with some predefined types is then exported in Common Event Format.\nThus, there is no particular feature concerning MISP Events since any event can be exported. However, 4 configuration parameters recognized by CEF format are required and should be provided by users before exporting data: the device vendor, product and version, as well as the default severity of data.", |
||||
"references": ["https://community.softwaregrp.com/t5/ArcSight-Connectors/ArcSight-Common-Event-Format-CEF-Guide/ta-p/1589306?attachment-id=65537"], |
||||
"input": "MISP Event attributes", |
||||
"output": "Common Event Format file" |
||||
} |
@ -1,9 +0,0 @@ |
||||
{ |
||||
"description": "This module is used to export MISP events containing transaction objects into GoAML format.", |
||||
"logo": "logos/goAML.jpg", |
||||
"requirements": ["PyMISP","MISP objects"], |
||||
"features": "The module works as long as there is at least one transaction object in the Event.\n\nThen in order to have a valid GoAML document, please follow these guidelines:\n- For each transaction object, use either a bank-account, person, or legal-entity object to describe the origin of the transaction, and again one of them to describe the target of the transaction.\n- Create an object reference for both origin and target objects of the transaction.\n- A bank-account object needs a signatory, which is a person object, put as object reference of the bank-account.\n- A person can have an address, which is a geolocation object, put as object reference of the person.\n\nSupported relation types for object references that are recommended for each object are the folowing:\n- transaction:\n\t- 'from', 'from_my_client': Origin of the transaction - at least one of them is required.\n\t- 'to', 'to_my_client': Target of the transaction - at least one of them is required.\n\t- 'address': Location of the transaction - optional.\n- bank-account:\n\t- 'signatory': Signatory of a bank-account - the reference from bank-account to a signatory is required, but the relation-type is optional at the moment since this reference will always describe a signatory.\n\t- 'entity': Entity owning the bank account - optional.\n- person:\n\t- 'address': Address of a person - optional.", |
||||
"references": ["http://goaml.unodc.org/"], |
||||
"input": "MISP objects (transaction, bank-account, person, legal-entity, geolocation), with references, describing financial transactions and their origin and target.", |
||||
"output": "GoAML format file, describing financial transactions, with their origin and target (bank accounts, persons or entities)." |
||||
} |
@ -1,8 +0,0 @@ |
||||
{ |
||||
"description": "Lite export of a MISP event.", |
||||
"requirements": [], |
||||
"features": "This module is simply producing a json MISP event format file, but exporting only Attributes from the Event. Thus, MISP Events exported with this module should have attributes that are not internal references, otherwise the resulting event would be empty.", |
||||
"references": [], |
||||
"input": "MISP Event attributes", |
||||
"output": "Lite MISP Event" |
||||
} |
@ -1,9 +0,0 @@ |
||||
{ |
||||
"description": "Nexthink NXQL query export module", |
||||
"requirements": [], |
||||
"features": "This module export an event as Nexthink NXQL queries that can then be used in your own python3 tool or from wget/powershell", |
||||
"references": ["https://doc.nexthink.com/Documentation/Nexthink/latest/APIAndIntegrations/IntroducingtheWebAPIV2"], |
||||
"input": "MISP Event attributes", |
||||
"output": "Nexthink NXQL queries", |
||||
"logo": "logos/nexthink.svg" |
||||
} |
@ -1,9 +0,0 @@ |
||||
{ |
||||
"description": "OSQuery export of a MISP event.", |
||||
"requirements": [], |
||||
"features": "This module export an event as osquery queries that can be used in packs or in fleet management solution like Kolide.", |
||||
"references": [], |
||||
"input": "MISP Event attributes", |
||||
"output": "osquery SQL queries", |
||||
"logo": "logos/osquery.png" |
||||
} |
@ -1,8 +0,0 @@ |
||||
{ |
||||
"description": "Simple export of a MISP event to PDF.", |
||||
"requirements": ["PyMISP", "reportlab"], |
||||
"features": "The module takes care of the PDF file building, and work with any MISP Event. Except the requirement of reportlab, used to create the file, there is no special feature concerning the Event. Some parameters can be given through the config dict. 'MISP_base_url_for_dynamic_link' is your MISP URL, to attach an hyperlink to your event on your MISP instance from the PDF. Keep it clear to avoid hyperlinks in the generated pdf.\n 'MISP_name_for_metadata' is your CERT or MISP instance name. Used as text in the PDF' metadata\n 'Activate_textual_description' is a boolean (True or void) to activate the textual description/header abstract of an event\n 'Activate_galaxy_description' is a boolean (True or void) to activate the description of event related galaxies.\n 'Activate_related_events' is a boolean (True or void) to activate the description of related event. Be aware this might leak information on confidential events linked to the current event !\n 'Activate_internationalization_fonts' is a boolean (True or void) to activate Noto fonts instead of default fonts (Helvetica). This allows the support of CJK alphabet. Be sure to have followed the procedure to download Noto fonts (~70Mo) in the right place (/tools/pdf_fonts/Noto_TTF), to allow PyMisp to find and use them during PDF generation.\n 'Custom_fonts_path' is a text (path or void) to the TTF file of your choice, to create the PDF with it. Be aware the PDF won't support bold/italic/special style anymore with this option ", |
||||
"references": ["https://acrobat.adobe.com/us/en/acrobat/about-adobe-pdf.html"], |
||||
"input": "MISP Event", |
||||
"output": "MISP Event in a PDF file." |
||||
} |
@ -1,9 +0,0 @@ |
||||
{ |
||||
"description": "Module to export a structured CSV file for uploading to threatStream.", |
||||
"logo": "logos/threatstream.png", |
||||
"requirements": ["csv"], |
||||
"features": "The module takes a MISP event in input, to look every attribute. Each attribute matching with some predefined types is then exported in a CSV format recognized by ThreatStream.", |
||||
"references": ["https://www.anomali.com/platform/threatstream", "https://github.com/threatstream"], |
||||
"input": "MISP Event attributes", |
||||
"output": "ThreatStream CSV format file" |
||||
} |
@ -1,9 +0,0 @@ |
||||
{ |
||||
"description": "Module to export a structured CSV file for uploading to ThreatConnect.", |
||||
"logo": "logos/threatconnect.png", |
||||
"requirements": ["csv"], |
||||
"features": "The module takes a MISP event in input, to look every attribute. Each attribute matching with some predefined types is then exported in a CSV format recognized by ThreatConnect.\nUsers should then provide, as module configuration, the source of data they export, because it is required by the output format.", |
||||
"references": ["https://www.threatconnect.com"], |
||||
"input": "MISP Event attributes", |
||||
"output": "ThreatConnect CSV format file" |
||||
} |
@ -1,65 +0,0 @@ |
||||
# -*- coding: utf-8 -*- |
||||
import os |
||||
import json |
||||
|
||||
module_types = ['expansion', 'export_mod', 'import_mod'] |
||||
titles = ['Expansion Modules', 'Export Modules', 'Import Modules'] |
||||
markdown = ["# MISP modules documentation\n"] |
||||
githublink = 'https://github.com/MISP/misp-modules/tree/master/misp_modules/modules' |
||||
|
||||
|
||||
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)) |
||||
githubpath = '{}/{}'.format(githublink, _path) |
||||
for _file in files: |
||||
modulename = _file.split('.json')[0] |
||||
githubref = '{}/{}.py'.format(githubpath, modulename) |
||||
markdown.append('\n#### [{}]({})\n'.format(modulename, githubref)) |
||||
filename = os.path.join(current_path, _file) |
||||
with open(filename, 'rt') as f: |
||||
definition = json.loads(f.read()) |
||||
if 'logo' in definition: |
||||
markdown.append('\n<img src={} height=60>\n'.format(definition.pop('logo'))) |
||||
if 'description' in definition: |
||||
markdown.append('\n{}\n'.format(definition.pop('description'))) |
||||
for field, value in sorted(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('README.md', 'w') as w: |
||||
w.write(''.join(markdown)) |
||||
|
||||
def generate_docs_for_mkdocs(root_path): |
||||
for _path, title in zip(module_types, titles): |
||||
markdown = [] |
||||
#markdown.append('## {}\n'.format(title)) |
||||
current_path = os.path.join(root_path, _path) |
||||
files = sorted(os.listdir(current_path)) |
||||
githubpath = '{}/{}'.format(githublink, _path) |
||||
for _file in files: |
||||
modulename = _file.split('.json')[0] |
||||
githubref = '{}/{}.py'.format(githubpath, modulename) |
||||
markdown.append('\n#### [{}]({})\n'.format(modulename, githubref)) |
||||
filename = os.path.join(current_path, _file) |
||||
with open(filename, 'rt') as f: |
||||
definition = json.loads(f.read()) |
||||
if 'logo' in definition: |
||||
markdown.append('\n<img src={} height=60>\n'.format(definition.pop('logo'))) |
||||
if 'description' in definition: |
||||
markdown.append('\n{}\n'.format(definition.pop('description'))) |
||||
for field, value in sorted(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(root_path+"/../"+"/docs/"+_path+".md", 'w') as w: |
||||
w.write(''.join(markdown)) |
||||
|
||||
if __name__ == '__main__': |
||||
root_path = os.path.dirname(os.path.realpath(__file__)) |
||||
generate_doc(root_path) |
||||
generate_docs_for_mkdocs(root_path) |
@ -1,8 +0,0 @@ |
||||
{ |
||||
"description": "Module to import MISP attributes from a csv file.", |
||||
"requirements": ["PyMISP"], |
||||
"features": "In order to parse data from a csv file, a header is required to let the module know which column is matching with known attribute fields / MISP types.\n\nThis header either comes from the csv file itself or is part of the configuration of the module and should be filled out in MISP plugin settings, each field separated by COMMAS. Fields that do not match with any type known in MISP or are not MISP attribute fields should be ignored in import, using a space or simply nothing between two separators (example: 'ip-src, , comment, ').\n\nIf the csv file already contains a header that does not start by a '#', you should tick the checkbox 'has_header' to avoid importing it and have potential issues. You can also redefine the header even if it is already contained in the file, by following the rules for headers explained earlier. One reason why you would redefine a header is for instance when you want to skip some fields, or some fields are not valid types.", |
||||
"references": ["https://tools.ietf.org/html/rfc4180", "https://tools.ietf.org/html/rfc7111"], |
||||
"input": "CSV format file.", |
||||
"output": "MISP Event attributes" |
||||
} |
@ -1,9 +0,0 @@ |
||||
{ |
||||
"description": "Module to import Cuckoo JSON.", |
||||
"logo": "logos/cuckoo.png", |
||||
"requirements": [], |
||||
"features": "The module simply imports MISP Attributes from a Cuckoo JSON format file. There is thus no special feature to make it work.", |
||||
"references": ["https://cuckoosandbox.org/", "https://github.com/cuckoosandbox/cuckoo"], |
||||
"input": "Cuckoo JSON file", |
||||
"output": "MISP Event attributes" |
||||
} |
@ -1,8 +0,0 @@ |
||||
{ |
||||
"description": "Module to import emails in MISP.", |
||||
"requirements": [], |
||||
"features": "This module can be used to import e-mail text as well as attachments and urls.\n3 configuration parameters are then used to unzip attachments, guess zip attachment passwords, and extract urls: set each one of them to True or False to process or not the respective corresponding actions.", |
||||
"references": [], |
||||
"input": "E-mail file", |
||||
"output": "MISP Event attributes" |
||||
} |
@ -1,9 +0,0 @@ |
||||
{ |
||||
"description": "Module to import MISP objects about financial transactions from GoAML files.", |
||||
"logo": "logos/goAML.jpg", |
||||
"requirements": ["PyMISP"], |
||||
"features": "Unlike the GoAML export module, there is here no special feature to import data from GoAML external files, since the module will import MISP Objects with their References on its own, as it is required for the export module to rebuild a valid GoAML document.", |
||||
"references": "http://goaml.unodc.org/", |
||||
"input": "GoAML format file, describing financial transactions, with their origin and target (bank accounts, persons or entities).", |
||||
"output": "MISP objects (transaction, bank-account, person, legal-entity, geolocation), with references, describing financial transactions and their origin and target." |
||||
} |
@ -1,8 +0,0 @@ |
||||
{ |
||||
"description": "Module to import MISP JSON format for merging MISP events.", |
||||
"requirements": [], |
||||
"features": "The module simply imports MISP Attributes from an other MISP Event in order to merge events together. There is thus no special feature to make it work.", |
||||
"references": [], |
||||
"input": "MISP Event", |
||||
"output": "MISP Event attributes" |
||||
} |
@ -1,8 +0,0 @@ |
||||
{ |
||||
"description": "Optical Character Recognition (OCR) module for MISP.", |
||||
"requirements": [], |
||||
"features": "The module tries to recognize some text from an image and import the result as a freetext attribute, there is then no special feature asked to users to make it work.", |
||||
"references": [], |
||||
"input": "Image", |
||||
"output": "freetext MISP attribute" |
||||
} |
@ -1,8 +0,0 @@ |
||||
{ |
||||
"description": "Module to import OpenIOC packages.", |
||||
"requirements": ["PyMISP"], |
||||
"features": "The module imports MISP Attributes from OpenIOC packages, there is then no special feature for users to make it work.", |
||||
"references": ["https://www.fireeye.com/blog/threat-research/2013/10/openioc-basics.html"], |
||||
"input": "OpenIOC packages", |
||||
"output": "MISP Event attributes" |
||||
} |
@ -1,8 +0,0 @@ |
||||
{ |
||||
"description": "Module to import ThreatAnalyzer archive.zip / analysis.json files.", |
||||
"requirements": [], |
||||
"features": "The module imports MISP Attributes from a ThreatAnalyzer format file. This file can be either ZIP, or JSON format.\nThere is by the way no special feature for users to make the module work.", |
||||
"references": ["https://www.threattrack.com/malware-analysis.aspx"], |
||||
"input": "ThreatAnalyzer format file", |
||||
"output": "MISP Event attributes" |
||||
} |
@ -1,9 +0,0 @@ |
||||
{ |
||||
"description": "Module to import VMRay (VTI) results.", |
||||
"logo": "logos/vmray.png", |
||||
"requirements": ["vmray_rest_api"], |
||||
"features": "The module imports MISP Attributes from VMRay format, using the VMRay api.\nUsers should then provide as the module configuration the API Key as well as the server url in order to fetch their data to import.", |
||||
"references": ["https://www.vmray.com/"], |
||||
"input": "VMRay format", |
||||
"output": "MISP Event attributes" |
||||
} |
Before Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 171 KiB After Width: | Height: | Size: 171 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 898 B After Width: | Height: | Size: 898 B |
After Width: | Height: | Size: 648 KiB |
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 148 KiB |
After Width: | Height: | Size: 5.7 KiB |