a0d3b4bd23
Co-Authored-By: Brent Murphy <56412096+bm11100@users.noreply.github.com> Co-Authored-By: Daniel Stepanic <57736958+dstepanic17@users.noreply.github.com> Co-Authored-By: David French <56409778+threat-punter@users.noreply.github.com> Co-Authored-By: Joe Desimone <56411054+joe-desimone@users.noreply.github.com> Co-Authored-By: Justin Ibarra <brokensound77@users.noreply.github.com>
22 lines
677 B
Python
22 lines
677 B
Python
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
# or more contributor license agreements. Licensed under the Elastic License;
|
|
# you may not use this file except in compliance with the Elastic License.
|
|
|
|
import argparse
|
|
import importlib
|
|
import os
|
|
|
|
from . import get_ttp_names
|
|
|
|
parser = argparse.ArgumentParser("rta")
|
|
parser.add_argument("ttp_name")
|
|
|
|
parsed_args, remaining = parser.parse_known_args()
|
|
ttp_name, _ = os.path.splitext(os.path.basename(parsed_args.ttp_name))
|
|
|
|
if ttp_name not in get_ttp_names():
|
|
raise ValueError("Unknown RTA {}".format(ttp_name))
|
|
|
|
module = importlib.import_module("rta." + ttp_name)
|
|
exit(module.main(*remaining))
|