sandbox-cli 0.2.49__tar.gz → 0.2.50__tar.gz

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.
Files changed (37) hide show
  1. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/PKG-INFO +7 -7
  2. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/pyproject.toml +13 -12
  3. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/cli/downloader.py +9 -15
  4. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/cli/images.py +2 -2
  5. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/cli/scanner/__init__.py +6 -6
  6. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/internal/config.py +2 -2
  7. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/internal/helpers.py +16 -8
  8. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/utils/downloader/__init__.py +41 -23
  9. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/utils/scanner/__init__.py +2 -6
  10. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/utils/scanner/advanced.py +5 -12
  11. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/utils/scanner/rescan.py +2 -2
  12. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/.gitignore +0 -0
  13. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/LICENSE +0 -0
  14. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/NOTICE +0 -0
  15. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/README.md +0 -0
  16. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/__main__.py +0 -0
  17. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/cli/__init__.py +0 -0
  18. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/cli/reporter.py +0 -0
  19. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/cli/rules/__init__.py +0 -0
  20. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/cli/unpack.py +0 -0
  21. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/console.py +0 -0
  22. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/internal/__init__.py +0 -0
  23. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/models/__init__.py +0 -0
  24. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/models/detections.py +0 -0
  25. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/models/sandbox_arguments.py +0 -0
  26. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/utils/__init__.py +0 -0
  27. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/utils/compiler/__init__.py +0 -0
  28. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/utils/compiler/abc.py +0 -0
  29. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/utils/compiler/docker.py +0 -0
  30. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/utils/compiler/ssh.py +0 -0
  31. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/utils/extractors.py +0 -0
  32. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/utils/merge_dll_hooks.py +0 -0
  33. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/utils/unpack/__init__.py +0 -0
  34. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/utils/unpack/plugins/__init__.py +0 -0
  35. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/utils/unpack/plugins/abc.py +0 -0
  36. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/utils/unpack/plugins/correlation.py +0 -0
  37. {sandbox_cli-0.2.49 → sandbox_cli-0.2.50}/sandbox_cli/utils/unpack/plugins/sort_by_plugins.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sandbox-cli
3
- Version: 0.2.49
3
+ Version: 0.2.50
4
4
  Summary: Command line tool for interaction with sandboxes
5
5
  Project-URL: Homepage, https://github.com/Security-Experts-Community/sandbox-cli
6
6
  Project-URL: Documentation, https://security-experts-community.github.io/sandbox-cli
@@ -12,14 +12,14 @@ License-File: LICENSE
12
12
  License-File: NOTICE
13
13
  Requires-Python: >=3.11
14
14
  Requires-Dist: aiofiles>=25.1.0
15
- Requires-Dist: asyncssh>=2.22.0
15
+ Requires-Dist: asyncssh>=2.24.0
16
16
  Requires-Dist: colorama>=0.4.6
17
- Requires-Dist: cryptography>=46.0.5
18
- Requires-Dist: cyclopts>=4.10.2
17
+ Requires-Dist: cryptography>=49.0.0
18
+ Requires-Dist: cyclopts>=4.20.0
19
19
  Requires-Dist: docker>=7.1.0
20
- Requires-Dist: ptsandbox>=5.0.11
21
- Requires-Dist: pyzipper>=0.3.6
22
- Requires-Dist: rich>=14.3.3
20
+ Requires-Dist: ptsandbox>=5.0.14
21
+ Requires-Dist: pyzipper>=0.4.0
22
+ Requires-Dist: rich>=15.0.0
23
23
  Requires-Dist: zstandard>=0.25.0
24
24
  Description-Content-Type: text/markdown
25
25
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sandbox-cli"
3
- version = "0.2.49"
3
+ version = "0.2.50"
4
4
  description = "Command line tool for interaction with sandboxes"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -9,14 +9,14 @@ license-files = ["LICENSE", "NOTICE"]
9
9
  authors = [{ name = "Alexey Kolesnikov" }]
10
10
  dependencies = [
11
11
  "aiofiles>=25.1.0",
12
- "asyncssh>=2.22.0",
12
+ "asyncssh>=2.24.0",
13
13
  "colorama>=0.4.6",
14
- "cryptography>=46.0.5",
15
- "cyclopts>=4.10.2",
14
+ "cryptography>=49.0.0",
15
+ "cyclopts>=4.20.0",
16
16
  "docker>=7.1.0",
17
- "ptsandbox>=5.0.11",
18
- "pyzipper>=0.3.6",
19
- "rich>=14.3.3",
17
+ "ptsandbox>=5.0.14",
18
+ "pyzipper>=0.4.0",
19
+ "rich>=15.0.0",
20
20
  "zstandard>=0.25.0",
21
21
  ]
22
22
 
@@ -28,11 +28,12 @@ Issues = "https://github.com/Security-Experts-Community/sandbox-cli/issues"
28
28
 
29
29
  [dependency-groups]
30
30
  dev = [
31
- "black>=24.10.0",
32
- "isort>=5.13.2",
33
- "mypy>=1.14.1",
34
- "types-aiofiles>=24.1.0.20241221",
35
- "types-docker>=7.1.0.20241229",
31
+ "black>=26.5.1",
32
+ "isort>=7.0.0",
33
+ "mypy>=2.1.0",
34
+ "types-aiofiles>=25.1.0.20260518",
35
+ "types-docker>=7.1.0.20260712",
36
+ "types-colorama>=0.4.15.20260508",
36
37
  ]
37
38
  docs = ["mkdocs>=1.6.1", "mkdocs-material>=9.6.7", "termynal>=0.13.0"]
38
39
 
@@ -61,11 +61,11 @@ async def download_command(
61
61
  str,
62
62
  Parameter(
63
63
  name=["--key", "-k"],
64
- help=f"The key to access the sandbox **{'**,**'.join(x.name.get_secret_value() for x in settings.sandbox_keys)}**",
64
+ help=f"The key to access the sandbox **{'**,**'.join(x.name for x in settings.sandbox_keys)}**",
65
65
  validator=validate_key,
66
66
  group="Sandbox",
67
67
  ),
68
- ] = settings.sandbox_keys[0].name.get_secret_value(),
68
+ ] = settings.sandbox_keys[0].name,
69
69
  out_dir: Annotated[
70
70
  Path,
71
71
  Parameter(
@@ -255,7 +255,7 @@ async def download_command(
255
255
  else:
256
256
  Unpack(out_dir).run()
257
257
 
258
- async def create_task(sandbox: Sandbox, task_id: str) -> None:
258
+ async def create_task(sandbox: Sandbox, task_id: str | UUID) -> None:
259
259
  progress_task_id = progress.add_task(description=rf"\[[green1]{task_id}[/]] fetching info", start=True)
260
260
 
261
261
  def finalize_progress() -> None:
@@ -299,7 +299,7 @@ async def download_command(
299
299
  tasks: list[Coroutine[Any, Any, Artifact.EngineResult | None]] = []
300
300
 
301
301
  if query is not None:
302
- sandbox = Sandbox(get_key_by_name(key_name=key))
302
+ sandbox: Sandbox = Sandbox(get_key_by_name(key_name=key))
303
303
 
304
304
  limit = 40 if count > 40 else count
305
305
  viewed, next_cursor = 0, ""
@@ -312,22 +312,16 @@ async def download_command(
312
312
  viewed += limit
313
313
  next_cursor = response.next_cursor
314
314
 
315
- # clear last line
316
- sys.stdout.write("\033[F\033[K")
317
-
318
315
  for task in tasks_id:
319
- sandbox, task_id = get_key_and_task(key, task)
320
- if not sandbox or not task_id:
316
+ sandbox_key, task_id = get_key_and_task(key, task)
317
+ if not (sandbox_key and task_id):
321
318
  continue
322
319
 
323
- await create_task(sandbox, task_id)
320
+ await create_task(sandbox_key, task_id)
324
321
 
325
322
  with progress:
326
323
  await asyncio.gather(*tasks)
327
324
 
328
- # clear last line
329
- sys.stdout.write("\033[F\033[K")
330
-
331
325
 
332
326
  def download_email(
333
327
  emails: Annotated[
@@ -349,11 +343,11 @@ def download_email(
349
343
  str,
350
344
  Parameter(
351
345
  name=["--key", "-k"],
352
- help=f"The key to access the sandbox **{'**,**'.join(x.name.get_secret_value() for x in settings.sandbox_keys)}**",
346
+ help=f"The key to access the sandbox **{'**,**'.join(x.name for x in settings.sandbox_keys)}**",
353
347
  validator=validate_key,
354
348
  group="Sandbox",
355
349
  ),
356
- ] = settings.sandbox_keys[0].name.get_secret_value(),
350
+ ] = settings.sandbox_keys[0].name,
357
351
  ) -> None:
358
352
  """
359
353
  Upload an email and get its headers.
@@ -15,11 +15,11 @@ async def get_images(
15
15
  str,
16
16
  Parameter(
17
17
  name=["--key", "-k"],
18
- help=f"The key to access the sandbox **{'**,**'.join(x.name.get_secret_value() for x in settings.sandbox_keys)}**",
18
+ help=f"The key to access the sandbox **{'**,**'.join(x.name for x in settings.sandbox_keys)}**",
19
19
  validator=validate_key,
20
20
  group="Sandbox",
21
21
  ),
22
- ] = settings.sandbox_keys[0].name.get_secret_value(),
22
+ ] = settings.sandbox_keys[0].name,
23
23
  ) -> None:
24
24
  """
25
25
  Get available images in the sandbox.
@@ -115,11 +115,11 @@ async def re_scan(
115
115
  str,
116
116
  Parameter(
117
117
  name=["--key", "-k"],
118
- help=f"The key to access the sandbox **{'**,**'.join(x.name.get_secret_value() for x in settings.sandbox_keys)}**",
118
+ help=f"The key to access the sandbox **{'**,**'.join(x.name for x in settings.sandbox_keys)}**",
119
119
  validator=validate_key,
120
120
  group="Sandbox Options",
121
121
  ),
122
- ] = settings.sandbox_keys[0].name.get_secret_value(),
122
+ ] = settings.sandbox_keys[0].name,
123
123
  is_local: Annotated[
124
124
  bool,
125
125
  Parameter(
@@ -233,11 +233,11 @@ async def scan(
233
233
  str,
234
234
  Parameter(
235
235
  name=["--key", "-k"],
236
- help=f"The key to access the sandbox **{'**,**'.join(x.name.get_secret_value() for x in settings.sandbox_keys)}**",
236
+ help=f"The key to access the sandbox **{'**,**'.join(x.name for x in settings.sandbox_keys)}**",
237
237
  validator=validate_key,
238
238
  group="Sandbox Options",
239
239
  ),
240
- ] = settings.sandbox_keys[0].name.get_secret_value(),
240
+ ] = settings.sandbox_keys[0].name,
241
241
  is_local: Annotated[
242
242
  bool,
243
243
  Parameter(
@@ -481,11 +481,11 @@ async def scan_new(
481
481
  str,
482
482
  Parameter(
483
483
  name=["--key", "-k"],
484
- help=f"The key to access the sandbox **{'**,**'.join(x.name.get_secret_value() for x in settings.sandbox_keys)}**",
484
+ help=f"The key to access the sandbox **{'**,**'.join(x.name for x in settings.sandbox_keys)}**",
485
485
  validator=validate_key,
486
486
  group="Sandbox Options",
487
487
  ),
488
- ] = settings.sandbox_keys[0].name.get_secret_value(),
488
+ ] = settings.sandbox_keys[0].name,
489
489
  is_local: Annotated[
490
490
  bool,
491
491
  Parameter(
@@ -7,7 +7,7 @@ from typing import Any
7
7
 
8
8
  import pydantic
9
9
  from ptsandbox import SandboxKey
10
- from pydantic import BaseModel, Field
10
+ from pydantic import BaseModel, Field, SecretStr
11
11
 
12
12
  from sandbox_cli.console import console
13
13
 
@@ -78,7 +78,7 @@ class Settings(BaseModel):
78
78
  def sandbox_key(self) -> SandboxKey:
79
79
  return SandboxKey(
80
80
  name=self.name,
81
- key=self.key,
81
+ key=SecretStr(self.key),
82
82
  host=self.host,
83
83
  max_workers=self.max_workers,
84
84
  description=self.description,
@@ -13,7 +13,7 @@ from sandbox_cli.models.sandbox_arguments import SandboxArguments
13
13
 
14
14
  def get_key_by_name(key_name: str) -> SandboxKey:
15
15
  for sandbox_key in settings.sandbox_keys:
16
- if sandbox_key.name.get_secret_value() == key_name:
16
+ if sandbox_key.name == key_name:
17
17
  return sandbox_key
18
18
  raise KeyError()
19
19
 
@@ -30,10 +30,8 @@ def validate_key(_: Any, value: Any) -> None:
30
30
  try:
31
31
  get_key_by_name(value)
32
32
  except KeyError:
33
- available = "', '".join(x.name.get_secret_value() for x in settings.sandbox_keys)
34
- console.error(
35
- f'Key "{value}" doesn\'t exist in config. Available keys: "{available}"'
36
- )
33
+ available = "', '".join(x.name for x in settings.sandbox_keys)
34
+ console.error(f'Key "{value}" doesn\'t exist in config. Available keys: "{available}"')
37
35
  sys.exit(1)
38
36
 
39
37
 
@@ -75,15 +73,25 @@ def format_link(
75
73
 
76
74
  def save_scan_arguments(out_dir: Path, scan_args: SandboxArguments) -> None:
77
75
  scan_config_path = out_dir / "scan_config.json"
78
- scan_config_path.write_text(scan_args.model_dump_json(exclude="debug_options", indent=4), encoding="utf-8")
76
+ scan_config_path.write_text(
77
+ scan_args.model_dump_json(exclude={"debug_options"}, indent=4),
78
+ encoding="utf-8",
79
+ )
79
80
 
80
81
 
81
82
  def open_link(link: str) -> None:
82
83
  if settings.browser is not None:
83
- webbrowser.register("new_default_browser", None, webbrowser.GenericBrowser([settings.browser.path, *settings.browser.args]), preferred=True)
84
+ webbrowser.register(
85
+ "new_default_browser",
86
+ None,
87
+ webbrowser.GenericBrowser([str(settings.browser.path), *settings.browser.args]),
88
+ preferred=True,
89
+ )
84
90
  if not webbrowser.open(link):
85
91
  console.error("Can't open link in the specified browser. Please check browser path and args.")
86
92
  return
87
93
 
88
94
  if not webbrowser.open_new_tab(link):
89
- console.error("Can't open link in the default browser. Try adding path and args for your browser to the config file.")
95
+ console.error(
96
+ "Can't open link in the default browser. Try adding path and args for your browser to the config file."
97
+ )
@@ -40,7 +40,7 @@ async def _save_artifact(
40
40
  scan_id: UUID,
41
41
  sandbox: Sandbox,
42
42
  out_dir: Path,
43
- path: Path,
43
+ name: str,
44
44
  file_uri: str,
45
45
  overwrite: bool = False,
46
46
  decompress: bool = False,
@@ -54,7 +54,7 @@ async def _save_artifact(
54
54
  return
55
55
 
56
56
  # sanitize path
57
- path = out_dir / Path(str(path).replace(" ", "_"))
57
+ path = out_dir / name.replace(" ", "_")
58
58
  if not overwrite:
59
59
  n = 1
60
60
  while path.exists():
@@ -133,13 +133,13 @@ async def download(
133
133
  ) -> None:
134
134
  tasks: list[Coroutine[Any, Any, None]] = []
135
135
 
136
- def add_task(out_dir: Path, path: Path, file_uri: str, decompress: bool = False, overwrite: bool = False) -> None:
136
+ def add_task(out_dir: Path, name: str, file_uri: str, decompress: bool = False, overwrite: bool = False) -> None:
137
137
  tasks.append(
138
138
  _save_artifact(
139
139
  scan_id=report.scan_id,
140
140
  sandbox=sandbox,
141
141
  out_dir=out_dir,
142
- path=path,
142
+ name=name,
143
143
  file_uri=file_uri,
144
144
  progress=progress,
145
145
  idx=idx,
@@ -178,16 +178,34 @@ async def download(
178
178
  LogType.EVENT_RAW,
179
179
  LogType.NETWORK,
180
180
  }:
181
- add_task(output, log.file_name, log.file_uri, overwrite=True)
181
+ add_task(
182
+ out_dir=output,
183
+ name=log.file_name,
184
+ file_uri=log.file_uri,
185
+ overwrite=True,
186
+ )
182
187
 
183
188
  if (all or video) and log.type == LogType.SCREENSHOT:
184
- add_task(output, log.file_name, log.file_uri, overwrite=True)
189
+ add_task(
190
+ out_dir=output,
191
+ name=log.file_name,
192
+ file_uri=log.file_uri,
193
+ overwrite=True,
194
+ )
185
195
 
186
196
  if (all or crashdumps) and log.file_name in {"crashdump.bin", "crashdump.metadata"}:
187
- add_task(output / "crashdumps", log.file_name, log.file_uri)
197
+ add_task(
198
+ out_dir=output / "crashdumps",
199
+ name=log.file_name,
200
+ file_uri=log.file_uri,
201
+ )
188
202
 
189
203
  if (all or debug) and log.type in {LogType.DEBUG, LogType.GRAPH}:
190
- add_task(output / "debug", log.file_name, log.file_uri)
204
+ add_task(
205
+ out_dir=output / "debug",
206
+ name=log.file_name,
207
+ file_uri=log.file_uri,
208
+ )
191
209
 
192
210
  if artifacts or files or procdumps or all:
193
211
  if not sandbox_result.details:
@@ -205,37 +223,37 @@ async def download(
205
223
 
206
224
  if artifact.type == ArtifactType.FILE and (files or artifacts or all):
207
225
  add_task(
208
- output / "artifacts",
209
- artifact.file_info.file_path.removeprefix("/"),
210
- artifact.file_info.file_uri,
226
+ out_dir=output / "artifacts",
227
+ name=artifact.file_info.file_path.removeprefix("/"),
228
+ file_uri=artifact.file_info.file_uri,
211
229
  )
212
230
  if artifact.type == ArtifactType.PROCESS_DUMP and (procdumps or artifacts or all):
213
231
  add_task(
214
- output / "process_dump",
215
- artifact.file_info.details.process_dump.process_name.removeprefix("/"), # type: ignore
216
- artifact.file_info.file_uri,
232
+ out_dir=output / "process_dump",
233
+ name=artifact.file_info.details.process_dump.process_name.removeprefix("/"), # type: ignore
234
+ file_uri=artifact.file_info.file_uri,
217
235
  decompress=decompress,
218
236
  )
219
237
 
220
238
  if artifact.type == ArtifactType.AMSI and (amsi or all):
221
239
  add_task(
222
- output / "amsi",
223
- f"{artifact.file_info.sha256}.bin",
224
- artifact.file_info.file_uri,
240
+ out_dir=output / "amsi",
241
+ name=f"{artifact.file_info.sha256}.bin",
242
+ file_uri=artifact.file_info.file_uri,
225
243
  )
226
244
 
227
245
  if artifact.type == ArtifactType.DEX_DUMP and (dex or all):
228
246
  add_task(
229
- output / "dex",
230
- f"{artifact.file_info.sha256}.bin",
231
- artifact.file_info.file_uri,
247
+ out_dir=output / "dex",
248
+ name=f"{artifact.file_info.sha256}.bin",
249
+ file_uri=artifact.file_info.file_uri,
232
250
  )
233
251
 
234
252
  if all and artifact.type not in _KNOWN_ARTIFACT_TYPES:
235
253
  add_task(
236
- output / "other",
237
- artifact.file_info.sha256,
238
- artifact.file_info.file_uri,
254
+ out_dir=output / "other",
255
+ name=artifact.file_info.sha256,
256
+ file_uri=artifact.file_info.file_uri,
239
257
  )
240
258
 
241
259
  if not tasks:
@@ -239,17 +239,13 @@ async def scan_internal(
239
239
  ) -> None:
240
240
  sandbox_arguments = SandboxArguments(
241
241
  type=ScanType.SCAN,
242
- sandbox_key_name=key.name.get_secret_value(),
242
+ sandbox_key_name=key.name,
243
243
  sandbox_options=sandbox_options.sandbox,
244
244
  )
245
245
  save_scan_arguments(out_dir, sandbox_arguments)
246
-
247
- # try:
248
246
  await process_file(sandbox_options, file_path, out_dir, idx)
249
- # except Exception as ex:
250
- # console.log(f"[cyan]{idx}[/] {file_path} Error: {ex!r}")
251
247
 
252
- console.info(f"Using key: name={key.name.get_secret_value()} max_workers={key.max_workers}")
248
+ console.info(f"Using key: name={key.name} max_workers={key.max_workers}")
253
249
 
254
250
  tasks: list[Coroutine[Any, Any, None]] = []
255
251
  sandbox, sandbox_options, images = await _prepare_scan_options(
@@ -78,9 +78,9 @@ async def _get_compiled_rules(progress: Progress, rules_dir: Path | None, is_loc
78
78
 
79
79
 
80
80
  def get_elapsed_time(task: Task) -> str:
81
- hours = int(task.elapsed) // 3600
82
- minutes = (int(task.elapsed) % 3600) // 60
83
- seconds = int(task.elapsed) % 60
81
+ hours = int(task.elapsed or 0) // 3600
82
+ minutes = (int(task.elapsed or 0) % 3600) // 60
83
+ seconds = int(task.elapsed or 0) % 60
84
84
  return f"[yellow]{hours}:{minutes:02d}:{seconds:02d}[/]"
85
85
 
86
86
 
@@ -399,17 +399,13 @@ async def scan_internal_advanced(
399
399
  ) -> None:
400
400
  sandbox_arguments = SandboxArguments(
401
401
  type=ScanType.SCAN_NEW,
402
- sandbox_key_name=key.name.get_secret_value(),
402
+ sandbox_key_name=key.name,
403
403
  sandbox_options=sandbox_options,
404
404
  )
405
405
  save_scan_arguments(out_dir, sandbox_arguments)
406
-
407
- # try:
408
406
  await process_file(sandbox_options, file_path, out_dir, idx)
409
- # except Exception as ex:
410
- # console.log(f"[cyan]{idx}[/] {file_path} Error: {ex!r}")
411
407
 
412
- console.info(f"Using key: name={key.name.get_secret_value()} max_workers={key.max_workers}")
408
+ console.info(f"Using key: name={key.name} max_workers={key.max_workers}")
413
409
 
414
410
  tasks: list[Coroutine[Any, Any, None]] = []
415
411
  with progress:
@@ -454,6 +450,3 @@ async def scan_internal_advanced(
454
450
 
455
451
  await asyncio.gather(*tasks)
456
452
  await sandbox.api.session.close()
457
-
458
- # clear last line
459
- sys.stdout.write("\033[F\033[K")
@@ -246,14 +246,14 @@ async def rescan_internal(
246
246
 
247
247
  await process_trace(drakvuf_trace, tcpdump_pcap, trace, out_dir, idx)
248
248
 
249
- console.info(f"Using key: name={key.name.get_secret_value()} max_workers={key.max_workers}")
249
+ console.info(f"Using key: name={key.name} max_workers={key.max_workers}")
250
250
 
251
251
  tasks: list[Coroutine[Any, Any, None]] = []
252
252
  with progress:
253
253
  sandbox, sandbox_options = await _prepare_rescan_options(progress, rules_dir, key, is_local)
254
254
  sandbox_arguments = SandboxArguments(
255
255
  type=ScanType.RE_SCAN,
256
- sandbox_key_name=key.name.get_secret_value(),
256
+ sandbox_key_name=key.name,
257
257
  sandbox_options=sandbox_options.sandbox,
258
258
  )
259
259
 
File without changes
File without changes
File without changes
File without changes