|
6 | 6 | import cmd2 |
7 | 7 | from cmd2 import Fg as COLORS |
8 | 8 | from faraday_cli.config import active_config |
9 | | -from faraday_cli.shell.utils import apply_tags |
10 | 9 |
|
11 | 10 |
|
12 | 11 | @cmd2.with_default_category("Tools Reports") |
@@ -36,21 +35,21 @@ def __init__(self): |
36 | 35 | help="Show output in json (dont send to faraday)", |
37 | 36 | ) |
38 | 37 | report_parser.add_argument( |
39 | | - "--tag-vuln", |
| 38 | + "--vuln-tag", |
40 | 39 | type=str, |
41 | 40 | help="Tag to add to vulnerabilities", |
42 | 41 | required=False, |
43 | 42 | action="append", |
44 | 43 | ) |
45 | 44 | report_parser.add_argument( |
46 | | - "--tag-host", |
| 45 | + "--host-tag", |
47 | 46 | type=str, |
48 | 47 | help="Tag to add to hosts", |
49 | 48 | required=False, |
50 | 49 | action="append", |
51 | 50 | ) |
52 | 51 | report_parser.add_argument( |
53 | | - "--tag-service", |
| 52 | + "--service-tag", |
54 | 53 | type=str, |
55 | 54 | help="Tag to add to services", |
56 | 55 | required=False, |
@@ -117,18 +116,18 @@ def process_report(self, args: argparse.Namespace): |
117 | 116 | fg=COLORS.GREEN, |
118 | 117 | ) |
119 | 118 | ) |
| 119 | + plugin.vuln_tag = args.vuln_tag |
| 120 | + plugin.host_tag = args.host_tag |
| 121 | + plugin.service_tag = args.service_tag |
120 | 122 | plugin.processReport( |
121 | 123 | report_path.absolute().as_posix(), getpass.getuser() |
122 | 124 | ) |
123 | | - report_json = apply_tags( |
124 | | - plugin.get_data(), args.tag_host, args.tag_service, args.tag_vuln |
125 | | - ) |
126 | 125 | if args.json_output: |
127 | | - self._cmd.poutput(json.dumps(report_json, indent=4)) |
| 126 | + self._cmd.poutput(json.dumps(plugin.get_data(), indent=4)) |
128 | 127 | else: |
129 | 128 | self._cmd.data_queue.put( |
130 | 129 | { |
131 | 130 | "workspace": destination_workspace, |
132 | | - "json_data": report_json, |
| 131 | + "json_data": plugin.get_data(), |
133 | 132 | } |
134 | 133 | ) |
0 commit comments