mirror of https://github.com/MISP/PyMISP
Merge branch 'master' of github.com:MISP/PyMISP
commit
0198c87b3f
|
@ -13,11 +13,12 @@ def init(url, key):
|
||||||
|
|
||||||
result = m.get_event(event)
|
result = m.get_event(event)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(description='Get an event from a MISP instance.')
|
parser = argparse.ArgumentParser(description='Get an event from a MISP instance.')
|
||||||
parser.add_argument("-e", "--event", required=True, help="Event ID to get.")
|
parser.add_argument("-e", "--event", required=True, help="Event ID to get.")
|
||||||
parser.add_argument("-a", "--attribute", help="Attribute ID to modify. A little dirty for now, argument need to be included in event")
|
parser.add_argument("-a", "--attribute", help="Attribute ID to modify. A little dirty for now, argument need to be included in event")
|
||||||
parser.add_argument("-t", "--tag", required=True, type=int, help="Attribute ID to modify.")
|
parser.add_argument("-t", "--tag", required=True, type=int, help="Tag ID.")
|
||||||
parser.add_argument("-m", "--modify_attribute", action='store_true', help="If set, the tag will be add to the attribute, otherwise to the event.")
|
parser.add_argument("-m", "--modify_attribute", action='store_true', help="If set, the tag will be add to the attribute, otherwise to the event.")
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
|
@ -12,12 +12,13 @@ def init(url, key):
|
||||||
|
|
||||||
result = m.get_event(event)
|
result = m.get_event(event)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(description='Tag something.')
|
parser = argparse.ArgumentParser(description='Tag something.')
|
||||||
parser.add_argument("-u", "--uuid", help="UUID to tag.")
|
parser.add_argument("-u", "--uuid", help="UUID to tag.")
|
||||||
parser.add_argument("-e", "--event", help="Event ID to tag.")
|
parser.add_argument("-e", "--event", help="Event ID to tag.")
|
||||||
parser.add_argument("-a", "--attribute", help="Attribute ID to tag")
|
parser.add_argument("-a", "--attribute", help="Attribute ID to tag")
|
||||||
parser.add_argument("-t", "--tag", required=True, help="Attribute ID to modify.")
|
parser.add_argument("-t", "--tag", required=True, help="Tag ID.")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if not args.event and not args.uuid and not args.attribute:
|
if not args.event and not args.uuid and not args.attribute:
|
||||||
|
@ -26,8 +27,6 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
misp = init(misp_url, misp_key)
|
misp = init(misp_url, misp_key)
|
||||||
|
|
||||||
event = misp.get_event(args.event)
|
|
||||||
|
|
||||||
if args.event and not args.attribute:
|
if args.event and not args.attribute:
|
||||||
result = misp.search(eventid=args.event)
|
result = misp.search(eventid=args.event)
|
||||||
data = result['response']
|
data = result['response']
|
||||||
|
|
Loading…
Reference in New Issue