mirror of https://github.com/MISP/misp-modules
Merge pull request #189 from chrisr3d/master
Using userConfig to define the header instead of moduleconfigpull/190/head
commit
65168a2e9d
|
@ -3,11 +3,14 @@ import json, os, base64
|
||||||
import pymisp
|
import pymisp
|
||||||
|
|
||||||
misperrors = {'error': 'Error'}
|
misperrors = {'error': 'Error'}
|
||||||
mispattributes = {'inputSource': ['file'], 'output': ['MISP attributes']}
|
|
||||||
moduleinfo = {'version': '0.1', 'author': 'Christian Studer',
|
moduleinfo = {'version': '0.1', 'author': 'Christian Studer',
|
||||||
'description': 'Import Attributes from a csv file.',
|
'description': 'Import Attributes from a csv file.',
|
||||||
'module-type': ['import']}
|
'module-type': ['import']}
|
||||||
moduleconfig = ['header']
|
moduleconfig = []
|
||||||
|
inputSource = ['file']
|
||||||
|
userConfig = {'header': {
|
||||||
|
'type': 'String',
|
||||||
|
'message': 'Define the header of the csv file, with types (included in MISP attribute types or attribute fields) separated by commas.\nFor fields that do not match these types, please use space or simply nothing between commas.\nFor instance: ip-src,domain, ,timestamp'}}
|
||||||
|
|
||||||
duplicatedFields = {'mispType': {'mispComment': 'comment'},
|
duplicatedFields = {'mispType': {'mispComment': 'comment'},
|
||||||
'attrField': {'attrComment': 'comment'}}
|
'attrField': {'attrComment': 'comment'}}
|
||||||
|
@ -121,7 +124,18 @@ def handler(q=False):
|
||||||
return r
|
return r
|
||||||
|
|
||||||
def introspection():
|
def introspection():
|
||||||
return mispattributes
|
modulesetup = {}
|
||||||
|
try:
|
||||||
|
userConfig
|
||||||
|
modulesetup['userConfig'] = userConfig
|
||||||
|
except NameError:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
inputSource
|
||||||
|
modulesetup['inputSource'] = inputSource
|
||||||
|
except NameError:
|
||||||
|
pass
|
||||||
|
return modulesetup
|
||||||
|
|
||||||
def version():
|
def version():
|
||||||
moduleinfo['config'] = moduleconfig
|
moduleinfo['config'] = moduleconfig
|
||||||
|
|
Loading…
Reference in New Issue