Merge pull request #426 from kovacsbalu/fix-tag-examples

Fix tag examples
pull/428/head
Raphaël Vinot 2019-07-25 10:38:23 +02:00 committed by GitHub
commit 4974a4dd62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -13,11 +13,12 @@ def init(url, key):
result = m.get_event(event)
if __name__ == '__main__':
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("-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.")
args = parser.parse_args()

View File

@ -12,12 +12,13 @@ def init(url, key):
result = m.get_event(event)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Tag something.')
parser.add_argument("-u", "--uuid", help="UUID 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("-t", "--tag", required=True, help="Attribute ID to modify.")
parser.add_argument("-t", "--tag", required=True, help="Tag ID.")
args = parser.parse_args()
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)
event = misp.get_event(args.event)
if args.event and not args.attribute:
result = misp.search(eventid=args.event)
data = result['response']
@ -48,5 +47,5 @@ if __name__ == '__main__':
if args.uuid:
uuid = args.uuid
print("UUID tagged: %s"%uuid)
print("UUID tagged: %s" % uuid)
misp.tag(uuid, args.tag)