Exclude internal reference

pull/106/head
Tristan METAYER 2017-02-21 17:12:17 +01:00
parent dd2646a0f4
commit 20cb534203
1 changed files with 10 additions and 8 deletions

View File

@ -3,14 +3,14 @@ import base64
misperrors = {'error': 'Error'} misperrors = {'error': 'Error'}
# possible module-types: 'expansion', 'hover' or both
moduleinfo = {'version': '1', moduleinfo = {'version': '1',
'author': 'TM', 'author': 'TM',
'description': 'export lite', 'description': 'export lite',
'module-type': ['export']} 'module-type': ['export']}
# config fields that your code expects from the site admin #~ config form admin site but do not work
moduleconfig = ["indent_json_export"] #~ moduleconfig = ["indent_json_export"]
moduleconfig = []
#~ mispattributes = {'input':'all'} ? #~ mispattributes = {'input':'all'} ?
mispattributes = {} mispattributes = {}
@ -29,6 +29,7 @@ def handler(q=False):
if 'data' not in request: if 'data' not in request:
return False return False
#~ Misp json structur
liteEvent = {'Event':{}} liteEvent = {'Event':{}}
for evt in request['data']: for evt in request['data']:
@ -38,11 +39,12 @@ def handler(q=False):
attrs = evt['Attribute'] attrs = evt['Attribute']
for attr in attrs: for attr in attrs:
liteAttr = {} if 'Internal reference' not in attr['category']:
liteAttr['category'] = attr['category'] liteAttr = {}
liteAttr['type'] = attr['type'] liteAttr['category'] = attr['category']
liteAttr['value'] = attr['value'] liteAttr['type'] = attr['type']
liteEvent['Event']['Attribute'].append(liteAttr) liteAttr['value'] = attr['value']
liteEvent['Event']['Attribute'].append(liteAttr)
return {"response":[], return {"response":[],
'data': str(base64.b64encode( 'data': str(base64.b64encode(