mirror of https://github.com/MISP/misp-modules
Add user config to not add file as attachement in a box
parent
79f48eccfe
commit
4ef7261168
|
@ -4,8 +4,12 @@ import base64
|
||||||
from pymisp.tools import openioc
|
from pymisp.tools import openioc
|
||||||
|
|
||||||
misperrors = {'error': 'Error'}
|
misperrors = {'error': 'Error'}
|
||||||
userConfig = {}
|
userConfig = {
|
||||||
inputSource = ['file']
|
'not save ioc': {
|
||||||
|
'type': 'Boolean',
|
||||||
|
'message': 'If you check this box, IOC file will not save as an attachment in MISP'
|
||||||
|
}
|
||||||
|
}inputSource = ['file']
|
||||||
|
|
||||||
moduleinfo = {'version': '0.1', 'author': 'Raphaël Vinot',
|
moduleinfo = {'version': '0.1', 'author': 'Raphaël Vinot',
|
||||||
'description': 'Import OpenIOC package',
|
'description': 'Import OpenIOC package',
|
||||||
|
@ -34,14 +38,17 @@ def handler(q=False):
|
||||||
|
|
||||||
pkg = openioc.load_openioc(package)
|
pkg = openioc.load_openioc(package)
|
||||||
|
|
||||||
# add origin file as attachment
|
if q.get('config'):
|
||||||
if q.get("filename"):
|
if q['config'].get('not save ioc') == "0":
|
||||||
r["results"].append({
|
|
||||||
"values": [q.get('filename')],
|
# add origin file as attachment
|
||||||
"types": ['attachment'],
|
if q.get("filename"):
|
||||||
"categories": ['Support Tool'],
|
r["results"].append({
|
||||||
"data" : q.get('data'),
|
"values": [q.get('filename')],
|
||||||
})
|
"types": ['attachment'],
|
||||||
|
"categories": ['Support Tool'],
|
||||||
|
"data" : q.get('data'),
|
||||||
|
})
|
||||||
|
|
||||||
# return all attributes
|
# return all attributes
|
||||||
for attrib in pkg.attributes:
|
for attrib in pkg.attributes:
|
||||||
|
|
Loading…
Reference in New Issue