pyntcli 0.1.118__py3-none-any.whl → 0.1.120__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyntcli/__init__.py +1 -1
- pyntcli/commands/command.py +9 -57
- pyntcli/commands/har.py +12 -2
- pyntcli/commands/listen.py +14 -62
- pyntcli/commands/newman.py +13 -1
- pyntcli/commands/postman.py +7 -2
- pyntcli/commands/root.py +0 -1
- pyntcli/commands/sub_command.py +123 -0
- pyntcli/commands/util.py +14 -2
- pyntcli/pynt_docker/pynt_container.py +0 -4
- {pyntcli-0.1.118.dist-info → pyntcli-0.1.120.dist-info}/METADATA +1 -1
- {pyntcli-0.1.118.dist-info → pyntcli-0.1.120.dist-info}/RECORD +15 -15
- {pyntcli-0.1.118.dist-info → pyntcli-0.1.120.dist-info}/WHEEL +0 -0
- {pyntcli-0.1.118.dist-info → pyntcli-0.1.120.dist-info}/entry_points.txt +0 -0
- {pyntcli-0.1.118.dist-info → pyntcli-0.1.120.dist-info}/top_level.txt +0 -0
pyntcli/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.120"
|
pyntcli/commands/command.py
CHANGED
|
@@ -4,15 +4,13 @@ import os
|
|
|
4
4
|
import webbrowser
|
|
5
5
|
from http import HTTPStatus
|
|
6
6
|
import time
|
|
7
|
-
import tempfile
|
|
8
|
-
import json
|
|
9
7
|
from subprocess import Popen, PIPE
|
|
10
8
|
from functools import partial
|
|
11
9
|
|
|
10
|
+
from pyntcli.commands.util import build_scan_details_url
|
|
12
11
|
from pyntcli.pynt_docker import pynt_container
|
|
13
12
|
from pyntcli.ui import ui_thread
|
|
14
13
|
from pyntcli.commands import util, sub_command
|
|
15
|
-
from pyntcli.ui import report as cli_reporter
|
|
16
14
|
from pyntcli.transport import pynt_requests
|
|
17
15
|
|
|
18
16
|
|
|
@@ -50,10 +48,6 @@ def command_usage():
|
|
|
50
48
|
class CommandSubCommand(sub_command.PyntSubCommand):
|
|
51
49
|
def __init__(self, name) -> None:
|
|
52
50
|
super().__init__(name)
|
|
53
|
-
self.scan_id = ""
|
|
54
|
-
self.proxy_sleep_interval = 2
|
|
55
|
-
self.proxy_healthcheck_buffer = 10
|
|
56
|
-
self.proxy_server_base_url = "http://localhost:{}/api"
|
|
57
51
|
|
|
58
52
|
def print_usage(self, *args):
|
|
59
53
|
ui_thread.print(command_usage())
|
|
@@ -123,27 +117,6 @@ class CommandSubCommand(sub_command.PyntSubCommand):
|
|
|
123
117
|
time.sleep(self.proxy_sleep_interval)
|
|
124
118
|
raise TimeoutError()
|
|
125
119
|
|
|
126
|
-
def _get_report(self, args, report_format):
|
|
127
|
-
while True:
|
|
128
|
-
res = pynt_requests.get(
|
|
129
|
-
self.proxy_server_base_url.format(args.port)
|
|
130
|
-
+ "/report?format={}".format(report_format),
|
|
131
|
-
params={"scanId": self.scan_id},
|
|
132
|
-
)
|
|
133
|
-
if res.status_code == HTTPStatus.OK:
|
|
134
|
-
return res.text
|
|
135
|
-
if res.status_code == HTTPStatus.ACCEPTED:
|
|
136
|
-
time.sleep(self.proxy_sleep_interval)
|
|
137
|
-
continue
|
|
138
|
-
if res.status_code == 517: # pynt did not recieve any requests
|
|
139
|
-
ui_thread.print(
|
|
140
|
-
ui_thread.PrinterText(
|
|
141
|
-
res.json()["message"], ui_thread.PrinterText.WARNING
|
|
142
|
-
)
|
|
143
|
-
)
|
|
144
|
-
return
|
|
145
|
-
ui_thread.print("Error in polling for scan report: {}".format(res.text))
|
|
146
|
-
return
|
|
147
120
|
|
|
148
121
|
def run_cmd(self, args: argparse.Namespace):
|
|
149
122
|
container_config = pynt_container.DockerContainerConfig(
|
|
@@ -231,34 +204,13 @@ class CommandSubCommand(sub_command.PyntSubCommand):
|
|
|
231
204
|
"scan in progress...",
|
|
232
205
|
100,
|
|
233
206
|
):
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
)
|
|
238
|
-
|
|
239
|
-
json_report = self._get_report(args, "json")
|
|
240
|
-
json_report_path = os.path.join(
|
|
241
|
-
tempfile.gettempdir(), "pynt_report_{}.json".format(int(time.time()))
|
|
242
|
-
)
|
|
207
|
+
app_id = self.get_app_id(args.port, self.scan_id)
|
|
208
|
+
scan_details_url = build_scan_details_url(self.scan_id, app_id)
|
|
209
|
+
html_report_path = self.handle_html_report(args) # this also indicates that the scan is done
|
|
243
210
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
if html_report:
|
|
250
|
-
with open(html_report_path, "w", encoding="utf-8") as html_file:
|
|
251
|
-
html_file.write(html_report)
|
|
252
|
-
webbrowser.open("file://{}".format(html_report_path))
|
|
253
|
-
|
|
254
|
-
if json_report:
|
|
255
|
-
with open(json_report_path, "w", encoding="utf-8") as json_file:
|
|
256
|
-
json_file.write(json_report)
|
|
257
|
-
reporter = cli_reporter.PyntReporter(json_report_path)
|
|
258
|
-
reporter.print_summary()
|
|
211
|
+
if scan_details_url:
|
|
212
|
+
webbrowser.open(scan_details_url)
|
|
213
|
+
else:
|
|
214
|
+
webbrowser.open("file://{}".format(html_report_path))
|
|
259
215
|
|
|
260
|
-
|
|
261
|
-
json_obj = json.loads(json_report)
|
|
262
|
-
if json_obj:
|
|
263
|
-
util.check_for_findings_or_warnings(args, json_obj)
|
|
264
|
-
util.check_severity(args.severity_level, json_obj)
|
|
216
|
+
self.handle_json_report(args)
|
pyntcli/commands/har.py
CHANGED
|
@@ -2,10 +2,9 @@ import argparse
|
|
|
2
2
|
import time
|
|
3
3
|
import os
|
|
4
4
|
from functools import partial
|
|
5
|
-
|
|
5
|
+
import webbrowser
|
|
6
6
|
from pyntcli.pynt_docker import pynt_container
|
|
7
7
|
from pyntcli.ui import ui_thread
|
|
8
|
-
from pyntcli.ui.progress import PyntProgress
|
|
9
8
|
from pyntcli.commands import sub_command, util
|
|
10
9
|
|
|
11
10
|
|
|
@@ -116,11 +115,22 @@ class HarSubCommand(sub_command.PyntSubCommand):
|
|
|
116
115
|
|
|
117
116
|
ui_thread.print_generator(har_docker.stdout)
|
|
118
117
|
|
|
118
|
+
scan_details_url = ""
|
|
119
119
|
with ui_thread.progress(
|
|
120
120
|
"ws://localhost:{}/progress".format(port),
|
|
121
121
|
healthcheck,
|
|
122
122
|
"scan in progress...",
|
|
123
123
|
100,
|
|
124
124
|
):
|
|
125
|
+
scan_details_url = self.get_scan_details_url(port)
|
|
125
126
|
while har_docker.is_alive():
|
|
126
127
|
time.sleep(1)
|
|
128
|
+
|
|
129
|
+
if scan_details_url:
|
|
130
|
+
webbrowser.open(scan_details_url)
|
|
131
|
+
else:
|
|
132
|
+
ui_thread.print(ui_thread.PrinterText(
|
|
133
|
+
"Could not get report url",
|
|
134
|
+
ui_thread.PrinterText.WARNING,
|
|
135
|
+
))
|
|
136
|
+
util.open_report_from_file()
|
pyntcli/commands/listen.py
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import argparse
|
|
2
|
-
from copy import deepcopy
|
|
3
2
|
import os
|
|
4
3
|
import webbrowser
|
|
5
4
|
from http import HTTPStatus
|
|
6
5
|
import time
|
|
7
|
-
import tempfile
|
|
8
|
-
import json
|
|
9
|
-
from subprocess import Popen, PIPE
|
|
10
6
|
from functools import partial
|
|
11
7
|
|
|
8
|
+
from pyntcli.commands.util import build_scan_details_url
|
|
12
9
|
from pyntcli.pynt_docker import pynt_container
|
|
13
10
|
from pyntcli.ui import ui_thread
|
|
14
11
|
from pyntcli.commands import util, sub_command
|
|
15
|
-
from pyntcli.ui import report as cli_reporter
|
|
16
12
|
from pyntcli.transport import pynt_requests
|
|
17
13
|
|
|
18
14
|
|
|
@@ -43,10 +39,6 @@ def listen_usage():
|
|
|
43
39
|
class ListenSubCommand(sub_command.PyntSubCommand):
|
|
44
40
|
def __init__(self, name) -> None:
|
|
45
41
|
super().__init__(name)
|
|
46
|
-
self.scan_id = ""
|
|
47
|
-
self.proxy_sleep_interval = 2
|
|
48
|
-
self.proxy_healthcheck_buffer = 10
|
|
49
|
-
self.proxy_server_base_url = "http://localhost:{}/api"
|
|
50
42
|
|
|
51
43
|
def print_usage(self, *args):
|
|
52
44
|
ui_thread.print(listen_usage())
|
|
@@ -82,27 +74,6 @@ class ListenSubCommand(sub_command.PyntSubCommand):
|
|
|
82
74
|
time.sleep(self.proxy_sleep_interval)
|
|
83
75
|
raise TimeoutError()
|
|
84
76
|
|
|
85
|
-
def _get_report(self, args, report_format):
|
|
86
|
-
while True:
|
|
87
|
-
res = pynt_requests.get(
|
|
88
|
-
self.proxy_server_base_url.format(args.port)
|
|
89
|
-
+ "/report?format={}".format(report_format),
|
|
90
|
-
params={"scanId": self.scan_id},
|
|
91
|
-
)
|
|
92
|
-
if res.status_code == HTTPStatus.OK:
|
|
93
|
-
return res.text
|
|
94
|
-
if res.status_code == HTTPStatus.ACCEPTED:
|
|
95
|
-
time.sleep(self.proxy_sleep_interval)
|
|
96
|
-
continue
|
|
97
|
-
if res.status_code == 517: # pynt did not recieve any requests
|
|
98
|
-
ui_thread.print(
|
|
99
|
-
ui_thread.PrinterText(
|
|
100
|
-
res.json()["message"], ui_thread.PrinterText.WARNING
|
|
101
|
-
)
|
|
102
|
-
)
|
|
103
|
-
return
|
|
104
|
-
ui_thread.print("Error in polling for scan report: {}".format(res.text))
|
|
105
|
-
return
|
|
106
77
|
|
|
107
78
|
def run_cmd(self, args: argparse.Namespace):
|
|
108
79
|
container_config = pynt_container.DockerContainerConfig(
|
|
@@ -178,35 +149,16 @@ class ListenSubCommand(sub_command.PyntSubCommand):
|
|
|
178
149
|
with ui_thread.progress(
|
|
179
150
|
"ws://localhost:{}/progress?scanId={}".format(args.port, self.scan_id),
|
|
180
151
|
partial(lambda *args: None),
|
|
181
|
-
"scan in progress...",
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
)
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
html_report_path = util.get_user_report_path(full_path, "html")
|
|
195
|
-
json_report_path = util.get_user_report_path(full_path, "json")
|
|
196
|
-
|
|
197
|
-
if html_report:
|
|
198
|
-
with open(html_report_path, "w", encoding="utf-8") as html_file:
|
|
199
|
-
html_file.write(html_report)
|
|
200
|
-
webbrowser.open("file://{}".format(html_report_path))
|
|
201
|
-
|
|
202
|
-
if json_report:
|
|
203
|
-
with open(json_report_path, "w", encoding="utf-8") as json_file:
|
|
204
|
-
json_file.write(json_report)
|
|
205
|
-
reporter = cli_reporter.PyntReporter(json_report_path)
|
|
206
|
-
reporter.print_summary()
|
|
207
|
-
|
|
208
|
-
if json_report:
|
|
209
|
-
json_obj = json.loads(json_report)
|
|
210
|
-
if json_obj:
|
|
211
|
-
util.check_for_findings_or_warnings(args, json_obj)
|
|
212
|
-
util.check_severity(args.severity_level, json_obj)
|
|
152
|
+
"scan in progress...",
|
|
153
|
+
100,
|
|
154
|
+
):
|
|
155
|
+
app_id = self.get_app_id(args.port, self.scan_id)
|
|
156
|
+
scan_details_url = build_scan_details_url(self.scan_id, app_id)
|
|
157
|
+
html_report_path = self.handle_html_report(args) # this also indicates that the scan is done
|
|
158
|
+
|
|
159
|
+
if scan_details_url:
|
|
160
|
+
webbrowser.open(scan_details_url)
|
|
161
|
+
else:
|
|
162
|
+
webbrowser.open("file://{}".format(html_report_path))
|
|
163
|
+
|
|
164
|
+
self.handle_json_report(args)
|
pyntcli/commands/newman.py
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import argparse
|
|
2
2
|
import time
|
|
3
3
|
import os
|
|
4
|
+
import webbrowser
|
|
4
5
|
from functools import partial
|
|
5
6
|
|
|
6
7
|
from pyntcli.pynt_docker import pynt_container
|
|
7
8
|
from pyntcli.commands import sub_command, util
|
|
8
9
|
from pyntcli.ui import ui_thread
|
|
9
|
-
from pyntcli.ui.progress import PyntProgress
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
def newman_usage():
|
|
@@ -128,5 +128,17 @@ class NewmanSubCommand(sub_command.PyntSubCommand):
|
|
|
128
128
|
"scan in progress...",
|
|
129
129
|
100,
|
|
130
130
|
):
|
|
131
|
+
scan_details_url = None
|
|
131
132
|
while newman_docker.is_alive():
|
|
133
|
+
if not scan_details_url:
|
|
134
|
+
scan_details_url = self.get_scan_details_url(port)
|
|
132
135
|
time.sleep(1)
|
|
136
|
+
|
|
137
|
+
if scan_details_url:
|
|
138
|
+
webbrowser.open(scan_details_url)
|
|
139
|
+
else:
|
|
140
|
+
ui_thread.print(ui_thread.PrinterText(
|
|
141
|
+
"Could not get report url",
|
|
142
|
+
ui_thread.PrinterText.WARNING,
|
|
143
|
+
))
|
|
144
|
+
util.open_report_from_file()
|
pyntcli/commands/postman.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import argparse
|
|
2
|
-
import time
|
|
3
2
|
import websocket
|
|
4
3
|
import webbrowser
|
|
5
4
|
import os
|
|
@@ -13,6 +12,7 @@ from . import sub_command, util
|
|
|
13
12
|
from pyntcli.pynt_docker import pynt_container
|
|
14
13
|
from pyntcli.ui import ui_thread
|
|
15
14
|
from pyntcli.transport import pynt_requests
|
|
15
|
+
from .util import build_scan_details_url
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class PyntPostmanException(Exception):
|
|
@@ -118,7 +118,12 @@ class PostmanSubCommand(sub_command.PyntSubCommand):
|
|
|
118
118
|
html_report = self.get_report(args.port, "html", scan_id)
|
|
119
119
|
html_report_path = os.path.join(tempfile.gettempdir(), "pynt_report_{}.html".format(int(time.time())))
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
app_id = self.get_app_id(args.port, scan_id)
|
|
122
|
+
scan_details_url = build_scan_details_url(scan_id, app_id)
|
|
123
|
+
|
|
124
|
+
if scan_details_url:
|
|
125
|
+
webbrowser.open(scan_details_url)
|
|
126
|
+
elif html_report:
|
|
122
127
|
with open(html_report_path, "w", encoding="utf-8") as html_file:
|
|
123
128
|
html_file.write(html_report)
|
|
124
129
|
webbrowser.open("file://{}".format(html_report_path))
|
pyntcli/commands/root.py
CHANGED
|
@@ -65,7 +65,6 @@ class BaseCommand:
|
|
|
65
65
|
parser.add_argument("--dev-flags", type=str,
|
|
66
66
|
default="", help=argparse.SUPPRESS)
|
|
67
67
|
parser.add_argument("--host-ca", type=str, default="")
|
|
68
|
-
parser.add_argument("--transport-config", type=str, default="")
|
|
69
68
|
parser.add_argument("--application-id", type=str,
|
|
70
69
|
default="", required=False)
|
|
71
70
|
parser.add_argument("--application-name", type=str,
|
pyntcli/commands/sub_command.py
CHANGED
|
@@ -1,10 +1,133 @@
|
|
|
1
1
|
import argparse
|
|
2
|
+
import os
|
|
3
|
+
import tempfile
|
|
4
|
+
import json
|
|
5
|
+
import time
|
|
6
|
+
|
|
7
|
+
from pyntcli.commands import util
|
|
8
|
+
from pyntcli.commands.util import build_scan_details_url
|
|
9
|
+
from pyntcli.transport import pynt_requests
|
|
10
|
+
from pyntcli.ui import report as cli_reporter
|
|
11
|
+
|
|
12
|
+
from http import HTTPStatus
|
|
13
|
+
from pyntcli.ui import ui_thread
|
|
2
14
|
|
|
3
15
|
class PyntSubCommand:
|
|
4
16
|
def __init__(self, name) -> None:
|
|
5
17
|
self.name = name
|
|
18
|
+
self.scan_id = ""
|
|
19
|
+
self.scan_id_url = "http://localhost:{}/scan/scan_id"
|
|
20
|
+
self.app_id_url = "http://localhost:{}/scan/app_id?scanId={}"
|
|
21
|
+
self.proxy_sleep_interval = 2
|
|
22
|
+
self.proxy_healthcheck_buffer = 10
|
|
23
|
+
self.proxy_server_base_url = "http://localhost:{}/api"
|
|
6
24
|
pass
|
|
7
25
|
|
|
26
|
+
def get_scan_id(self, port):
|
|
27
|
+
try:
|
|
28
|
+
res_scan_id = pynt_requests.get(
|
|
29
|
+
self.scan_id_url.format(port)
|
|
30
|
+
)
|
|
31
|
+
if res_scan_id.status_code == HTTPStatus.OK:
|
|
32
|
+
return res_scan_id.json()["scan_id"]
|
|
33
|
+
else:
|
|
34
|
+
return None
|
|
35
|
+
except Exception as e:
|
|
36
|
+
ui_thread.print_verbose("Error in getting scan id: " + str(e))
|
|
37
|
+
return None
|
|
38
|
+
|
|
39
|
+
def get_app_id(self, port, scan_id):
|
|
40
|
+
try:
|
|
41
|
+
res_app_id = pynt_requests.get(
|
|
42
|
+
self.app_id_url.format(port, scan_id)
|
|
43
|
+
)
|
|
44
|
+
if res_app_id.status_code == HTTPStatus.OK:
|
|
45
|
+
return res_app_id.json()["app_id"]
|
|
46
|
+
else:
|
|
47
|
+
return None
|
|
48
|
+
except Exception as e:
|
|
49
|
+
ui_thread.print_verbose("Error in getting app id: " + str(e))
|
|
50
|
+
return None
|
|
51
|
+
|
|
52
|
+
def get_scan_details_url(self, port):
|
|
53
|
+
try:
|
|
54
|
+
scan_id = self.get_scan_id(port)
|
|
55
|
+
if not scan_id:
|
|
56
|
+
return None
|
|
57
|
+
|
|
58
|
+
app_id = self.get_app_id(port, scan_id)
|
|
59
|
+
if not app_id:
|
|
60
|
+
return None
|
|
61
|
+
|
|
62
|
+
scan_details_url = build_scan_details_url(scan_id, app_id)
|
|
63
|
+
return scan_details_url
|
|
64
|
+
except Exception as e:
|
|
65
|
+
ui_thread.print_verbose("Error in getting report url: " + str(e))
|
|
66
|
+
return None
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def handle_html_report(self, args):
|
|
70
|
+
html_report = self._get_report(args, "html")
|
|
71
|
+
if not html_report:
|
|
72
|
+
return None
|
|
73
|
+
else:
|
|
74
|
+
html_report_path = os.path.join(
|
|
75
|
+
tempfile.gettempdir(), "pynt_report_{}.html".format(int(time.time()))
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
if "report" in args and args.report:
|
|
79
|
+
full_path = os.path.abspath(args.report)
|
|
80
|
+
html_report_path = util.get_user_report_path(full_path, "html")
|
|
81
|
+
|
|
82
|
+
with open(html_report_path, "w", encoding="utf-8") as html_file:
|
|
83
|
+
html_file.write(html_report)
|
|
84
|
+
return html_report_path
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def handle_json_report(self, args):
|
|
88
|
+
json_report = self._get_report(args, "json")
|
|
89
|
+
if json_report:
|
|
90
|
+
json_report_path = os.path.join(
|
|
91
|
+
tempfile.gettempdir(), "pynt_report_{}.json".format(int(time.time()))
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
if "report" in args and args.report:
|
|
95
|
+
full_path = os.path.abspath(args.report)
|
|
96
|
+
json_report_path = util.get_user_report_path(full_path, "json")
|
|
97
|
+
|
|
98
|
+
with open(json_report_path, "w", encoding="utf-8") as json_file:
|
|
99
|
+
json_file.write(json_report)
|
|
100
|
+
reporter = cli_reporter.PyntReporter(json_report_path)
|
|
101
|
+
reporter.print_summary()
|
|
102
|
+
|
|
103
|
+
json_obj = json.loads(json_report)
|
|
104
|
+
if json_obj:
|
|
105
|
+
util.check_for_findings_or_warnings(args, json_obj)
|
|
106
|
+
util.check_severity(args.severity_level, json_obj)
|
|
107
|
+
|
|
108
|
+
def _get_report(self, args, report_format):
|
|
109
|
+
while True:
|
|
110
|
+
res = pynt_requests.get(
|
|
111
|
+
self.proxy_server_base_url.format(args.port)
|
|
112
|
+
+ "/report?format={}".format(report_format),
|
|
113
|
+
params={"scanId": self.scan_id},
|
|
114
|
+
)
|
|
115
|
+
if res.status_code == HTTPStatus.OK:
|
|
116
|
+
return res.text
|
|
117
|
+
if res.status_code == HTTPStatus.ACCEPTED:
|
|
118
|
+
time.sleep(self.proxy_sleep_interval)
|
|
119
|
+
continue
|
|
120
|
+
if res.status_code == 517: # pynt did not recieve any requests
|
|
121
|
+
ui_thread.print(
|
|
122
|
+
ui_thread.PrinterText(
|
|
123
|
+
res.json()["message"], ui_thread.PrinterText.WARNING
|
|
124
|
+
)
|
|
125
|
+
)
|
|
126
|
+
return None
|
|
127
|
+
ui_thread.print("Error in polling for scan report: {}".format(res.text))
|
|
128
|
+
return None
|
|
129
|
+
|
|
130
|
+
|
|
8
131
|
def get_name(self):
|
|
9
132
|
return self.name
|
|
10
133
|
|
pyntcli/commands/util.py
CHANGED
|
@@ -7,6 +7,7 @@ import webbrowser
|
|
|
7
7
|
import json
|
|
8
8
|
import pyntcli.log.log as log
|
|
9
9
|
import pyntcli.store.store as store
|
|
10
|
+
from pyntcli.auth.login import PYNT_APP_URL
|
|
10
11
|
|
|
11
12
|
from pyntcli.commands.static_file_extensions import STATIC_FILE_EXTENSIONS
|
|
12
13
|
from pyntcli.pynt_docker import pynt_container
|
|
@@ -93,8 +94,6 @@ def create_default_file_mounts(args):
|
|
|
93
94
|
if os.stat(html_report_path).st_size == 0:
|
|
94
95
|
raise HtmlReportNotCreatedException()
|
|
95
96
|
|
|
96
|
-
webbrowser.open("file://{}".format(html_report_path))
|
|
97
|
-
|
|
98
97
|
if os.stat(html_report_path).st_size > 0:
|
|
99
98
|
report.PyntReporter(json_report_path).print_summary()
|
|
100
99
|
|
|
@@ -102,6 +101,19 @@ def create_default_file_mounts(args):
|
|
|
102
101
|
check_severity(args.severity_level, json.load(open(json_report_path)))
|
|
103
102
|
|
|
104
103
|
|
|
104
|
+
def open_report_from_file():
|
|
105
|
+
html_report_path = os.path.join(store.get_default_store_dir(), "results.html")
|
|
106
|
+
if not os.path.exists(html_report_path):
|
|
107
|
+
raise FileNotFoundError(f"Report file not found: {html_report_path}")
|
|
108
|
+
webbrowser.open("file://{}".format(html_report_path))
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def build_scan_details_url(scan_id, app_id):
|
|
112
|
+
if not scan_id or not app_id:
|
|
113
|
+
return None
|
|
114
|
+
return "{}/dashboard/application/{}/{}".format(PYNT_APP_URL, app_id, scan_id)
|
|
115
|
+
|
|
116
|
+
|
|
105
117
|
# Deprecate - keep it for backward customers that use it
|
|
106
118
|
def check_for_findings_or_warnings(args, json_report):
|
|
107
119
|
security_tests = json_report.get("securityTests", {})
|
|
@@ -153,10 +153,6 @@ def build_docker_args(integration_name: str, args: argparse.Namespace, port_args
|
|
|
153
153
|
ca_name = os.path.basename(args.host_ca)
|
|
154
154
|
docker_arguments += ["--host-ca", ca_name]
|
|
155
155
|
|
|
156
|
-
if "transport_config" in args and args.transport_config:
|
|
157
|
-
tc_name = os.path.basename(args.transport_config)
|
|
158
|
-
docker_arguments += ["--transport-config", tc_name]
|
|
159
|
-
|
|
160
156
|
if "verbose" in args and args.verbose:
|
|
161
157
|
docker_arguments.append("--verbose")
|
|
162
158
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
ignoreTests/conftest.py,sha256=gToq5K74GtgeGQXjFvXSzMaE6axBYxAzcFG5XJPOXjI,427
|
|
2
2
|
ignoreTests/auth/login.py,sha256=7GeBirHTD9t6EassLYsegCw1FZHkfjvVW1Z5uybHzgM,3801
|
|
3
3
|
ignoreTests/store/cred_store.py,sha256=_7-917EtNC9eKEumO2_lt-7KuDmCwOZFaowCm7DbA_A,254
|
|
4
|
-
pyntcli/__init__.py,sha256=
|
|
4
|
+
pyntcli/__init__.py,sha256=qZaJL6hRW3OhE4-FtmUfO70sz9UXhqQClXOGflMKspI,24
|
|
5
5
|
pyntcli/main.py,sha256=RD0W2_0ogYBCXubo-YewxHYkiIXxNv6NkZOh3n1VujE,5964
|
|
6
6
|
pyntcli/analytics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
pyntcli/analytics/send.py,sha256=0hJ0WJNFHLqyohtRr_xOg5WEXzxHrUOlcePPg-k65Hk,3846
|
|
@@ -9,23 +9,23 @@ pyntcli/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
9
9
|
pyntcli/auth/login.py,sha256=qtdoCgWIPi3_YXehI7SVk_E8aDVhH39wGc87tlkazSE,5558
|
|
10
10
|
pyntcli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
11
|
pyntcli/commands/burp.py,sha256=9kcqjC9Rgj5oZimGZuA_oO71Hn2Z3py8k5vr-eMKnUM,14317
|
|
12
|
-
pyntcli/commands/command.py,sha256=
|
|
13
|
-
pyntcli/commands/har.py,sha256=
|
|
12
|
+
pyntcli/commands/command.py,sha256=ZeK2MFhSZnWPb4vtwsBBTAef2dk65-ERP6qvA-Gv7iE,9186
|
|
13
|
+
pyntcli/commands/har.py,sha256=rs858ruqpIby-ecEzcTrwma0GFBumdjnmm1o307NP-U,5112
|
|
14
14
|
pyntcli/commands/id_command.py,sha256=UBEgMIpm4vauTCsKyixltiGUolNg_OfHEJvJ_i5BpJY,943
|
|
15
|
-
pyntcli/commands/listen.py,sha256=
|
|
16
|
-
pyntcli/commands/newman.py,sha256=
|
|
17
|
-
pyntcli/commands/postman.py,sha256=
|
|
15
|
+
pyntcli/commands/listen.py,sha256=HKq2oXIkj_qKTV_o5dDQBu7YuVGWtRODtNG2AjodAKk,6933
|
|
16
|
+
pyntcli/commands/newman.py,sha256=TNcs_G5DAT_ToSS5LIM0KFTgxoyjOzVEo8wfDhA0C24,5734
|
|
17
|
+
pyntcli/commands/postman.py,sha256=h3ZZoIYmP2N5WyL8LrRqvBjPJ2pvNlIoBU-bvXCO9lE,5207
|
|
18
18
|
pyntcli/commands/pynt_cmd.py,sha256=oRKgiG9i84sxkS-C5Nw4vv9mIO6zL8YfqhOUJ-XVpas,7934
|
|
19
|
-
pyntcli/commands/root.py,sha256=
|
|
19
|
+
pyntcli/commands/root.py,sha256=H3-nS41YGrFjx4_fyKo8FVH3HB5z57oiE3jSaXqAkd8,4369
|
|
20
20
|
pyntcli/commands/static_file_extensions.py,sha256=PZJb02BI-64tbU-j3rdCNsXzTh7gkIDGxGKbKNw3h5k,1995
|
|
21
|
-
pyntcli/commands/sub_command.py,sha256=
|
|
21
|
+
pyntcli/commands/sub_command.py,sha256=SxTSDXE7x4y6W-8hW5GmRu15a2-8gUUoU9XDHE-2yMc,4814
|
|
22
22
|
pyntcli/commands/template.py,sha256=wl-0GhIUUqdO39fyoO7mMsEKXnYqG32XkQdUJhLkdiA,8047
|
|
23
|
-
pyntcli/commands/util.py,sha256=
|
|
23
|
+
pyntcli/commands/util.py,sha256=awNG4qz9ni1S6l1hIROnoGxIOj5UVPcaFk6mmkmwrgk,5058
|
|
24
24
|
pyntcli/log/__init__.py,sha256=cOGwOYzMoshEbZiiasBGkj6wF0SBu3Jdpl-AuakDesw,19
|
|
25
25
|
pyntcli/log/log.py,sha256=YXCvcCzuhQ5QUT2L02uQEdN_lTCzLEuet4OnLuEnjlM,112
|
|
26
26
|
pyntcli/pynt_docker/__init__.py,sha256=PQIOVxc7XXtMLfEX7ojgwf_Z3mmTllO3ZvzUZTPOxQY,30
|
|
27
27
|
pyntcli/pynt_docker/container_utils.py,sha256=DeI-uSgdcO_2rGs2dvQ5gBDNo_iKKuPIQO2D9oej5Gw,1485
|
|
28
|
-
pyntcli/pynt_docker/pynt_container.py,sha256=
|
|
28
|
+
pyntcli/pynt_docker/pynt_container.py,sha256=9X0JVTUoLCQF2rIDMR182-S618jmOOOG0GeCzgRe5Bs,13681
|
|
29
29
|
pyntcli/saas_client/__init__.py,sha256=HPBzoC5a6F5_WkHubcjq_W4m1OQ9i0TX8QXBtJlKm1M,26
|
|
30
30
|
pyntcli/saas_client/saas_client.py,sha256=Cpf1pitVlxjW7KpchPL7Q-DgUqw6A8ldCtDlBXaPig0,1663
|
|
31
31
|
pyntcli/store/__init__.py,sha256=1fP8cEAQCF_myja3gnhHH9FEqtBiOJ-2aBmUXSKBdFA,41
|
|
@@ -42,8 +42,8 @@ pyntcli/ui/report.py,sha256=W-icPSZrGLOubXgam0LpOvHLl_aZg9Zx9qIkL8Ym5PE,1930
|
|
|
42
42
|
pyntcli/ui/ui_thread.py,sha256=XUBgLpYQjVhrilU-ofw7VSXgTiwneSdTxm61EvC3x4Q,5091
|
|
43
43
|
tests/test_utils.py,sha256=t5fTQUk1U_Js6iMxcGYGqt4C-crzOJ0CqCKtLkRtUi0,2050
|
|
44
44
|
tests/commands/test_pynt_cmd.py,sha256=J4JrEuD_qSVN76Fu6bKRjrxWSwCTXVEAzVPYdXMa0tI,8826
|
|
45
|
-
pyntcli-0.1.
|
|
46
|
-
pyntcli-0.1.
|
|
47
|
-
pyntcli-0.1.
|
|
48
|
-
pyntcli-0.1.
|
|
49
|
-
pyntcli-0.1.
|
|
45
|
+
pyntcli-0.1.120.dist-info/METADATA,sha256=U_YCBMiYyTmNtoi8DhbBiQ0F-JKPPklznIkLsuyS9Ec,427
|
|
46
|
+
pyntcli-0.1.120.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
47
|
+
pyntcli-0.1.120.dist-info/entry_points.txt,sha256=kcGmqAxXDttNk2EPRcqunc_LTVp61gzakz0v-GEE2SY,43
|
|
48
|
+
pyntcli-0.1.120.dist-info/top_level.txt,sha256=64XSgBzSpgwjYjEKHZE7q3JH2a816zEeyZBXfJi3AKI,42
|
|
49
|
+
pyntcli-0.1.120.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|