socketsecurity 1.0.13__tar.gz → 1.0.15__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 (23) hide show
  1. {socketsecurity-1.0.13/socketsecurity.egg-info → socketsecurity-1.0.15}/PKG-INFO +1 -1
  2. {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/__init__.py +1 -1
  3. {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/core/__init__.py +25 -17
  4. {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/socketcli.py +5 -2
  5. {socketsecurity-1.0.13 → socketsecurity-1.0.15/socketsecurity.egg-info}/PKG-INFO +1 -1
  6. {socketsecurity-1.0.13 → socketsecurity-1.0.15}/LICENSE +0 -0
  7. {socketsecurity-1.0.13 → socketsecurity-1.0.15}/README.md +0 -0
  8. {socketsecurity-1.0.13 → socketsecurity-1.0.15}/pyproject.toml +0 -0
  9. {socketsecurity-1.0.13 → socketsecurity-1.0.15}/setup.cfg +0 -0
  10. {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/core/classes.py +0 -0
  11. {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/core/exceptions.py +0 -0
  12. {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/core/git_interface.py +0 -0
  13. {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/core/github.py +0 -0
  14. {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/core/gitlab.py +0 -0
  15. {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/core/issues.py +0 -0
  16. {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/core/licenses.py +0 -0
  17. {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/core/messages.py +0 -0
  18. {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/core/scm_comments.py +0 -0
  19. {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity.egg-info/SOURCES.txt +0 -0
  20. {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity.egg-info/dependency_links.txt +0 -0
  21. {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity.egg-info/entry_points.txt +0 -0
  22. {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity.egg-info/requires.txt +0 -0
  23. {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: socketsecurity
3
- Version: 1.0.13
3
+ Version: 1.0.15
4
4
  Summary: Socket Security CLI for CI/CD
5
5
  Author-email: Douglas Coburn <douglas@socket.dev>
6
6
  Maintainer-email: Douglas Coburn <douglas@socket.dev>
@@ -1,2 +1,2 @@
1
1
  __author__ = 'socket.dev'
2
- __version__ = '1.0.13'
2
+ __version__ = '1.0.15'
@@ -46,8 +46,8 @@ org_slug = None
46
46
  all_new_alerts = False
47
47
  security_policy = {}
48
48
  log = logging.getLogger("socketdev")
49
- log_format = "%(asctime)s %(funcName)20s() %(message)s"
50
- logging.basicConfig(format=log_format)
49
+ # log_format = "%(asctime)s %(funcName)20s() %(message)s"
50
+ # logging.basicConfig(format=log_format)
51
51
  log.addHandler(logging.NullHandler())
52
52
 
53
53
  socket_globs = {
@@ -398,13 +398,14 @@ class Core:
398
398
  :param files: override finding the manifest files using the glob matcher
399
399
  :return:
400
400
  """
401
- all_files = []
402
401
  files_provided = False
403
402
  log.debug("Starting Find Files")
404
403
  start_time = time.time()
405
404
  if files is not None and len(files) > 0:
406
405
  files_provided = True
407
406
  for ecosystem in socket_globs:
407
+ if files is None:
408
+ files = []
408
409
  patterns = socket_globs[ecosystem]
409
410
  for file_name in patterns:
410
411
  pattern = patterns[file_name]["pattern"]
@@ -412,25 +413,20 @@ class Core:
412
413
 
413
414
  if not files_provided:
414
415
  log.debug(f"Globbing {file_path}")
415
- files = glob(file_path, recursive=True)
416
+ glob_start = time.time()
417
+ test = glob(file_path, recursive=True)
418
+ files = files + test
419
+ glob_end = time.time()
420
+ glob_total_time = glob_end - glob_start
421
+ log.debug(f"Glob for pattern {file_path} took {glob_total_time:.2f} seconds")
416
422
  else:
417
423
  log.debug("Files found from commit")
418
424
  files = Core.match_supported_files(path, files)
419
- for file in files:
420
- log.debug(f"Checking {file} for match")
421
- if platform.system() == "Windows":
422
- file = file.replace("\\", "/")
423
- if path not in file:
424
- file = f"{path}/{file}"
425
- found_path, file_name = file.rsplit("/", 1)
426
- details = (found_path, file_name)
427
- if details not in all_files:
428
- all_files.append(details)
429
425
  log.debug("Finished Find Files")
430
426
  end_time = time.time()
431
427
  total_time = end_time - start_time
432
- log.info(f"Found {len(all_files)} in {total_time: 2f} seconds")
433
- return all_files
428
+ log.info(f"Found {len(files)} in {total_time:.2f} seconds")
429
+ return files
434
430
 
435
431
  @staticmethod
436
432
  def create_full_scan(files: list, params: FullScanParams, workspace: str) -> FullScan:
@@ -442,7 +438,16 @@ class Core:
442
438
  :return:
443
439
  """
444
440
  send_files = []
445
- for path, name in files:
441
+ create_full_start = time.time()
442
+ log.debug("Creating new full scan")
443
+ for file in files:
444
+ if platform.system() == "Windows":
445
+ file = file.replace("\\", "/")
446
+ if "/" in file:
447
+ path, name = file.rsplit("/", 1)
448
+ else:
449
+ path = "."
450
+ name = file
446
451
  full_path = f"{path}/{name}"
447
452
  if full_path.startswith(workspace):
448
453
  key = full_path[len(workspace):]
@@ -464,6 +469,9 @@ class Core:
464
469
  results = response.json()
465
470
  full_scan = FullScan(**results)
466
471
  full_scan.sbom_artifacts = Core.get_sbom_data(full_scan.id)
472
+ create_full_end = time.time()
473
+ total_time = create_full_end - create_full_start
474
+ log.debug(f"New Full Scan created in {total_time:.2f} seconds")
467
475
  return full_scan
468
476
 
469
477
  @staticmethod
@@ -1,5 +1,7 @@
1
1
  import argparse
2
2
  import json
3
+
4
+ import socketsecurity.core
3
5
  from socketsecurity.core import Core, __version__
4
6
  from socketsecurity.core.classes import FullScanParams, Diff, Package, Issue
5
7
  from socketsecurity.core.messages import Messages
@@ -10,7 +12,9 @@ import os
10
12
  import sys
11
13
  import logging
12
14
 
13
- logging.basicConfig(level=logging.INFO)
15
+ log_format = "%(asctime)s: %(message)s"
16
+ logging.basicConfig(level=logging.INFO, format=log_format)
17
+ socketsecurity.core.log.setLevel(level=logging.INFO)
14
18
  log = logging.getLogger("socketcli")
15
19
  blocking_disabled = False
16
20
 
@@ -211,7 +215,6 @@ def main_code():
211
215
  arguments = parser.parse_args()
212
216
  debug = arguments.enable_debug
213
217
  if debug:
214
- log_format = "%(asctime)s %(funcName)20s() %(message)s"
215
218
  logging.basicConfig(level=logging.DEBUG, format=log_format)
216
219
  log.setLevel(logging.DEBUG)
217
220
  Core.enable_debug_log(logging.DEBUG)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: socketsecurity
3
- Version: 1.0.13
3
+ Version: 1.0.15
4
4
  Summary: Socket Security CLI for CI/CD
5
5
  Author-email: Douglas Coburn <douglas@socket.dev>
6
6
  Maintainer-email: Douglas Coburn <douglas@socket.dev>
File without changes