mirror of https://github.com/MISP/PyMISP
parent
d477a3688c
commit
98610fbafc
|
@ -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:
|
||||||
|
@ -48,5 +49,5 @@ if __name__ == '__main__':
|
||||||
if args.uuid:
|
if args.uuid:
|
||||||
uuid = args.uuid
|
uuid = args.uuid
|
||||||
|
|
||||||
print("UUID tagged: %s"%uuid)
|
print("UUID tagged: %s" % uuid)
|
||||||
misp.tag(uuid, args.tag)
|
misp.tag(uuid, args.tag)
|
||||||
|
|
Loading…
Reference in New Issue