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.
- {socketsecurity-1.0.13/socketsecurity.egg-info → socketsecurity-1.0.15}/PKG-INFO +1 -1
- {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/__init__.py +1 -1
- {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/core/__init__.py +25 -17
- {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/socketcli.py +5 -2
- {socketsecurity-1.0.13 → socketsecurity-1.0.15/socketsecurity.egg-info}/PKG-INFO +1 -1
- {socketsecurity-1.0.13 → socketsecurity-1.0.15}/LICENSE +0 -0
- {socketsecurity-1.0.13 → socketsecurity-1.0.15}/README.md +0 -0
- {socketsecurity-1.0.13 → socketsecurity-1.0.15}/pyproject.toml +0 -0
- {socketsecurity-1.0.13 → socketsecurity-1.0.15}/setup.cfg +0 -0
- {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/core/classes.py +0 -0
- {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/core/exceptions.py +0 -0
- {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/core/git_interface.py +0 -0
- {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/core/github.py +0 -0
- {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/core/gitlab.py +0 -0
- {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/core/issues.py +0 -0
- {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/core/licenses.py +0 -0
- {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/core/messages.py +0 -0
- {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity/core/scm_comments.py +0 -0
- {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity.egg-info/SOURCES.txt +0 -0
- {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity.egg-info/dependency_links.txt +0 -0
- {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity.egg-info/entry_points.txt +0 -0
- {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity.egg-info/requires.txt +0 -0
- {socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity.egg-info/top_level.txt +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
__author__ = 'socket.dev'
|
|
2
|
-
__version__ = '1.0.
|
|
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
|
-
|
|
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(
|
|
433
|
-
return
|
|
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
|
-
|
|
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
|
-
|
|
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)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{socketsecurity-1.0.13 → socketsecurity-1.0.15}/socketsecurity.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|