scanoss 1.9.0__py3-none-any.whl → 1.10.0__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.
- scanoss/__init__.py +1 -1
- scanoss/cli.py +19 -16
- scanoss/data/build_date.txt +1 -1
- scanoss/scanner.py +135 -12
- scanoss/scanossgrpc.py +2 -1
- scanoss/threadeddependencies.py +2 -2
- {scanoss-1.9.0.dist-info → scanoss-1.10.0.dist-info}/METADATA +1 -1
- {scanoss-1.9.0.dist-info → scanoss-1.10.0.dist-info}/RECORD +12 -12
- {scanoss-1.9.0.dist-info → scanoss-1.10.0.dist-info}/LICENSE +0 -0
- {scanoss-1.9.0.dist-info → scanoss-1.10.0.dist-info}/WHEEL +0 -0
- {scanoss-1.9.0.dist-info → scanoss-1.10.0.dist-info}/entry_points.txt +0 -0
- {scanoss-1.9.0.dist-info → scanoss-1.10.0.dist-info}/top_level.txt +0 -0
scanoss/__init__.py
CHANGED
scanoss/cli.py
CHANGED
|
@@ -86,7 +86,6 @@ def setup_args() -> None:
|
|
|
86
86
|
'256: disable best match only, 512: hide identified files, '
|
|
87
87
|
'1024: enable download_url, 2048: enable GitHub full path, '
|
|
88
88
|
'4096: disable extended server stats)')
|
|
89
|
-
p_scan.add_argument('--skip-snippets', '-S', action='store_true', help='Skip the generation of snippets')
|
|
90
89
|
p_scan.add_argument('--post-size', '-P', type=int, default=32,
|
|
91
90
|
help='Number of kilobytes to limit the post to while scanning (optional - default 32)')
|
|
92
91
|
p_scan.add_argument('--timeout', '-M', type=int, default=180,
|
|
@@ -94,17 +93,12 @@ def setup_args() -> None:
|
|
|
94
93
|
p_scan.add_argument('--retry', '-R', type=int, default=5,
|
|
95
94
|
help='Retry limit for API communication (optional - default 5)')
|
|
96
95
|
p_scan.add_argument('--no-wfp-output', action='store_true', help='Skip WFP file generation')
|
|
97
|
-
p_scan.add_argument('--all-extensions', action='store_true', help='Scan all file extensions')
|
|
98
|
-
p_scan.add_argument('--all-folders', action='store_true', help='Scan all folders')
|
|
99
|
-
p_scan.add_argument('--all-hidden', action='store_true', help='Scan all hidden files/folders')
|
|
100
|
-
p_scan.add_argument('--obfuscate', action='store_true', help='Obfuscate file paths and names')
|
|
101
96
|
p_scan.add_argument('--dependencies', '-D', action='store_true', help='Add Dependency scanning')
|
|
102
97
|
p_scan.add_argument('--dependencies-only', action='store_true', help='Run Dependency scanning only')
|
|
103
98
|
p_scan.add_argument('--sc-command', type=str,
|
|
104
99
|
help='Scancode command and path if required (optional - default scancode).')
|
|
105
100
|
p_scan.add_argument('--sc-timeout', type=int, default=600,
|
|
106
101
|
help='Timeout (in seconds) for scancode to complete (optional - default 600)')
|
|
107
|
-
p_scan.add_argument('--hpsm', '-H', action='store_true', help='Scan using High Precision Snippet Matching')
|
|
108
102
|
|
|
109
103
|
# Sub-command: fingerprint
|
|
110
104
|
p_wfp = subparsers.add_parser('fingerprint', aliases=['fp', 'wfp'],
|
|
@@ -116,12 +110,6 @@ def setup_args() -> None:
|
|
|
116
110
|
p_wfp.add_argument('--stdin', '-s', metavar='STDIN-FILENAME', type=str,
|
|
117
111
|
help='Fingerprint the file contents supplied via STDIN (optional)')
|
|
118
112
|
p_wfp.add_argument('--output', '-o', type=str, help='Output result file name (optional - default stdout).')
|
|
119
|
-
p_wfp.add_argument('--obfuscate', action='store_true', help='Obfuscate fingerprints')
|
|
120
|
-
p_wfp.add_argument('--skip-snippets', '-S', action='store_true', help='Skip the generation of snippets')
|
|
121
|
-
p_wfp.add_argument('--all-extensions', action='store_true', help='Fingerprint all file extensions')
|
|
122
|
-
p_wfp.add_argument('--all-folders', action='store_true', help='Fingerprint all folders')
|
|
123
|
-
p_wfp.add_argument('--all-hidden', action='store_true', help='Fingerprint all hidden files/folders')
|
|
124
|
-
p_wfp.add_argument('--hpsm', '-H', action='store_true', help='Use High Precision Snippet Matching algorithm.')
|
|
125
113
|
|
|
126
114
|
# Sub-command: dependency
|
|
127
115
|
p_dep = subparsers.add_parser('dependencies', aliases=['dp', 'dep'],
|
|
@@ -260,6 +248,19 @@ def setup_args() -> None:
|
|
|
260
248
|
help='SCANOSS API URL (optional - default: https://osskb.org/api/scan/direct)')
|
|
261
249
|
p.add_argument('--ignore-cert-errors', action='store_true', help='Ignore certificate errors')
|
|
262
250
|
|
|
251
|
+
# Global Scan/Fingerprint filter options
|
|
252
|
+
for p in [p_scan, p_wfp]:
|
|
253
|
+
p.add_argument('--obfuscate', action='store_true', help='Obfuscate fingerprints')
|
|
254
|
+
p.add_argument('--all-extensions', action='store_true', help='Fingerprint all file extensions')
|
|
255
|
+
p.add_argument('--all-folders', action='store_true', help='Fingerprint all folders')
|
|
256
|
+
p.add_argument('--all-hidden', action='store_true', help='Fingerprint all hidden files/folders')
|
|
257
|
+
p.add_argument('--hpsm', '-H', action='store_true', help='Use High Precision Snippet Matching algorithm.')
|
|
258
|
+
p.add_argument('--skip-snippets', '-S', action='store_true', help='Skip the generation of snippets')
|
|
259
|
+
p.add_argument('--skip-extension', '-E', type=str, action='append', help='File Extension to skip.')
|
|
260
|
+
p.add_argument('--skip-folder', '-O', type=str, action='append', help='Folder to skip.')
|
|
261
|
+
p.add_argument('--skip-size', '-Z', type=int, default=0,
|
|
262
|
+
help='Minimum file size to consider for fingerprinting (optional - default 0 bytes [unlimited])')
|
|
263
|
+
|
|
263
264
|
# Global Scan/GRPC options
|
|
264
265
|
for p in [p_scan, c_crypto, c_vulns, c_search, c_versions, c_semgrep]:
|
|
265
266
|
p.add_argument('--key', '-k', type=str,
|
|
@@ -374,8 +375,9 @@ def wfp(parser, args):
|
|
|
374
375
|
scan_options = 0 if args.skip_snippets else ScanType.SCAN_SNIPPETS.value # Skip snippet generation or not
|
|
375
376
|
scanner = Scanner(debug=args.debug, trace=args.trace, quiet=args.quiet, obfuscate=args.obfuscate,
|
|
376
377
|
scan_options=scan_options, all_extensions=args.all_extensions,
|
|
377
|
-
all_folders=args.all_folders, hidden_files_folders=args.all_hidden, hpsm=args.hpsm
|
|
378
|
-
|
|
378
|
+
all_folders=args.all_folders, hidden_files_folders=args.all_hidden, hpsm=args.hpsm,
|
|
379
|
+
skip_size=args.skip_size, skip_extensions=args.skip_extension, skip_folders=args.skip_folder
|
|
380
|
+
)
|
|
379
381
|
if args.stdin:
|
|
380
382
|
contents = sys.stdin.buffer.read()
|
|
381
383
|
scanner.wfp_contents(args.stdin, contents, scan_output)
|
|
@@ -530,14 +532,15 @@ def scan(parser, args):
|
|
|
530
532
|
scan_options=scan_options, sc_timeout=args.sc_timeout, sc_command=args.sc_command,
|
|
531
533
|
grpc_url=args.api2url, obfuscate=args.obfuscate,
|
|
532
534
|
ignore_cert_errors=args.ignore_cert_errors, proxy=args.proxy, grpc_proxy=args.grpc_proxy,
|
|
533
|
-
pac=pac_file, ca_cert=args.ca_cert, retry=args.retry, hpsm=args.hpsm
|
|
535
|
+
pac=pac_file, ca_cert=args.ca_cert, retry=args.retry, hpsm=args.hpsm,
|
|
536
|
+
skip_size=args.skip_size, skip_extensions=args.skip_extension, skip_folders=args.skip_folder
|
|
534
537
|
)
|
|
535
538
|
if args.wfp:
|
|
536
539
|
if not scanner.is_file_or_snippet_scan():
|
|
537
540
|
print_stderr(f'Error: Cannot specify WFP scanning if file/snippet options are disabled ({scan_options})')
|
|
538
541
|
exit(1)
|
|
539
542
|
if scanner.is_dependency_scan() and not args.dep:
|
|
540
|
-
print_stderr(f'Error: Cannot specify WFP & Dependency scanning without a dependency file (
|
|
543
|
+
print_stderr(f'Error: Cannot specify WFP & Dependency scanning without a dependency file (--dep)')
|
|
541
544
|
exit(1)
|
|
542
545
|
scanner.scan_wfp_with_options(args.wfp, args.dep)
|
|
543
546
|
elif args.stdin:
|
scanoss/data/build_date.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
date:
|
|
1
|
+
date: 20240209161953, utime: 1707495593
|
scanoss/scanner.py
CHANGED
|
@@ -58,7 +58,7 @@ FILTERED_DIRS = { # Folders to skip
|
|
|
58
58
|
FILTERED_DIR_EXT = { # Folder endings to skip
|
|
59
59
|
".egg-info"
|
|
60
60
|
}
|
|
61
|
-
FILTERED_EXT =
|
|
61
|
+
FILTERED_EXT = [ # File extensions to skip
|
|
62
62
|
".1", ".2", ".3", ".4", ".5", ".6", ".7", ".8", ".9", ".ac", ".adoc", ".am",
|
|
63
63
|
".asciidoc", ".bmp", ".build", ".cfg", ".chm", ".class", ".cmake", ".cnf",
|
|
64
64
|
".conf", ".config", ".contributors", ".copying", ".crt", ".csproj", ".css",
|
|
@@ -78,7 +78,7 @@ FILTERED_EXT = { # File extensions to skip
|
|
|
78
78
|
# File endings
|
|
79
79
|
"-doc", "changelog", "config", "copying", "license", "authors", "news", "licenses", "notice",
|
|
80
80
|
"readme", "swiftdoc", "texidoc", "todo", "version", "ignore", "manifest", "sqlite", "sqlite3"
|
|
81
|
-
|
|
81
|
+
]
|
|
82
82
|
FILTERED_FILES = { # Files to skip
|
|
83
83
|
"gradlew", "gradlew.bat", "mvnw", "mvnw.cmd", "gradle-wrapper.jar", "maven-wrapper.jar",
|
|
84
84
|
"thumbs.db", "babel.config.js", "license.txt", "license.md", "copying.lib", "makefile"
|
|
@@ -100,12 +100,17 @@ class Scanner(ScanossBase):
|
|
|
100
100
|
all_extensions: bool = False, all_folders: bool = False, hidden_files_folders: bool = False,
|
|
101
101
|
scan_options: int = 7, sc_timeout: int = 600, sc_command: str = None, grpc_url: str = None,
|
|
102
102
|
obfuscate: bool = False, ignore_cert_errors: bool = False, proxy: str = None, grpc_proxy: str = None,
|
|
103
|
-
ca_cert: str = None, pac: PACFile = None, retry: int = 5, hpsm: bool = False
|
|
103
|
+
ca_cert: str = None, pac: PACFile = None, retry: int = 5, hpsm: bool = False,
|
|
104
|
+
skip_size: int = 0, skip_extensions=None, skip_folders=None
|
|
104
105
|
):
|
|
105
106
|
"""
|
|
106
107
|
Initialise scanning class, including Winnowing, ScanossApi and ThreadedScanning
|
|
107
108
|
"""
|
|
108
109
|
super().__init__(debug, trace, quiet)
|
|
110
|
+
if skip_folders is None:
|
|
111
|
+
skip_folders = []
|
|
112
|
+
if skip_extensions is None:
|
|
113
|
+
skip_extensions = []
|
|
109
114
|
self.wfp = wfp if wfp else "scanner_output.wfp"
|
|
110
115
|
self.scan_output = scan_output
|
|
111
116
|
self.output_format = output_format
|
|
@@ -117,6 +122,8 @@ class Scanner(ScanossBase):
|
|
|
117
122
|
self.scan_options = scan_options
|
|
118
123
|
self._skip_snippets = True if not scan_options & ScanType.SCAN_SNIPPETS.value else False
|
|
119
124
|
self.hpsm = hpsm
|
|
125
|
+
self.skip_folders = skip_folders
|
|
126
|
+
self.skip_size = skip_size
|
|
120
127
|
ver_details = Scanner.version_details()
|
|
121
128
|
|
|
122
129
|
self.winnowing = Winnowing(debug=debug, quiet=quiet, skip_snippets=self._skip_snippets,
|
|
@@ -143,6 +150,9 @@ class Scanner(ScanossBase):
|
|
|
143
150
|
self.post_file_count = post_size if post_size > 0 else 32 # Max number of files for any given POST (default 32)
|
|
144
151
|
if self._skip_snippets:
|
|
145
152
|
self.max_post_size = 8 * 1024 # 8k Max post size if we're skipping snippets
|
|
153
|
+
self.skip_extensions = FILTERED_EXT
|
|
154
|
+
if skip_extensions: # Append extra file extensions to skip
|
|
155
|
+
self.skip_extensions.extend(skip_extensions)
|
|
146
156
|
|
|
147
157
|
def __filter_files(self, files: list) -> list:
|
|
148
158
|
"""
|
|
@@ -160,8 +170,8 @@ class Scanner(ScanossBase):
|
|
|
160
170
|
if f_lower in FILTERED_FILES: # Check for exact files to ignore
|
|
161
171
|
ignore = True
|
|
162
172
|
if not ignore:
|
|
163
|
-
for ending in
|
|
164
|
-
if f_lower.endswith(ending):
|
|
173
|
+
for ending in self.skip_extensions: # Check for file endings to ignore (static and user supplied)
|
|
174
|
+
if ending and f_lower.endswith(ending):
|
|
165
175
|
ignore = True
|
|
166
176
|
break
|
|
167
177
|
if not ignore:
|
|
@@ -181,10 +191,12 @@ class Scanner(ScanossBase):
|
|
|
181
191
|
ignore = True
|
|
182
192
|
if not ignore and not self.all_folders: # Skip this check if we're allowing all folders
|
|
183
193
|
d_lower = d.lower()
|
|
184
|
-
if d_lower in FILTERED_DIRS: # Ignore specific folders
|
|
194
|
+
if d_lower in FILTERED_DIRS: # Ignore specific folders (case insensitive)
|
|
195
|
+
ignore = True
|
|
196
|
+
elif self.skip_folders and d in self.skip_folders: # Ignore user-supplied folders (case sensitive)
|
|
185
197
|
ignore = True
|
|
186
198
|
if not ignore:
|
|
187
|
-
for de in FILTERED_DIR_EXT: # Ignore specific folder endings
|
|
199
|
+
for de in FILTERED_DIR_EXT: # Ignore specific folder endings (case insensitive)
|
|
188
200
|
if d_lower.endswith(de):
|
|
189
201
|
ignore = True
|
|
190
202
|
break
|
|
@@ -385,7 +397,8 @@ class Scanner(ScanossBase):
|
|
|
385
397
|
except Exception as e:
|
|
386
398
|
self.print_trace(
|
|
387
399
|
f'Ignoring missing symlink file: {file} ({e})') # Can fail if there is a broken symlink
|
|
388
|
-
|
|
400
|
+
# Ignore broken links and empty files or if a user-specified size limit is supplied
|
|
401
|
+
if f_size > 0 and (self.skip_size <= 0 or f_size > self.skip_size):
|
|
389
402
|
self.print_trace(f'Fingerprinting {path}...')
|
|
390
403
|
if spinner:
|
|
391
404
|
spinner.next()
|
|
@@ -598,6 +611,117 @@ class Scanner(ScanossBase):
|
|
|
598
611
|
success = False
|
|
599
612
|
return success
|
|
600
613
|
|
|
614
|
+
def scan_files(self, files: []) -> bool:
|
|
615
|
+
"""
|
|
616
|
+
Scan the specified list of files, producing fingerprints, send to the SCANOSS API and return results
|
|
617
|
+
Please note that by providing an explicit list you bypass any exclusions that may be defined on the scanner
|
|
618
|
+
:param files: list[str]
|
|
619
|
+
List of filenames to scan
|
|
620
|
+
:return True if successful, False otherwise
|
|
621
|
+
"""
|
|
622
|
+
success = True
|
|
623
|
+
if not files:
|
|
624
|
+
raise Exception(f"ERROR: Please provide a non-empty list of filenames to scan")
|
|
625
|
+
self.print_msg(f'Scanning {len(files)} files...')
|
|
626
|
+
spinner = None
|
|
627
|
+
if not self.quiet and self.isatty:
|
|
628
|
+
spinner = Spinner('Fingerprinting ')
|
|
629
|
+
save_wfps_for_print = not self.no_wfp_file or not self.threaded_scan
|
|
630
|
+
wfp_list = []
|
|
631
|
+
scan_block = ''
|
|
632
|
+
scan_size = 0
|
|
633
|
+
queue_size = 0
|
|
634
|
+
file_count = 0 # count all files fingerprinted
|
|
635
|
+
wfp_file_count = 0 # count number of files in each queue post
|
|
636
|
+
scan_started = False
|
|
637
|
+
for file in files:
|
|
638
|
+
if self.threaded_scan and self.threaded_scan.stop_scanning():
|
|
639
|
+
self.print_stderr('Warning: Aborting fingerprinting as the scanning service is not available.')
|
|
640
|
+
break
|
|
641
|
+
f_size = 0
|
|
642
|
+
try:
|
|
643
|
+
f_size = os.stat(file).st_size
|
|
644
|
+
except Exception as e:
|
|
645
|
+
self.print_trace(
|
|
646
|
+
f'Ignoring missing symlink file: {file} ({e})') # Can fail if there is a broken symlink
|
|
647
|
+
if f_size > 0: # Ignore broken links and empty files
|
|
648
|
+
self.print_trace(f'Fingerprinting {file}...')
|
|
649
|
+
if spinner:
|
|
650
|
+
spinner.next()
|
|
651
|
+
wfp = self.winnowing.wfp_for_file(file, file)
|
|
652
|
+
if wfp is None or wfp == '':
|
|
653
|
+
self.print_stderr(f'Warning: No WFP returned for {file}')
|
|
654
|
+
continue
|
|
655
|
+
if save_wfps_for_print:
|
|
656
|
+
wfp_list.append(wfp)
|
|
657
|
+
file_count += 1
|
|
658
|
+
if self.threaded_scan:
|
|
659
|
+
wfp_size = len(wfp.encode("utf-8"))
|
|
660
|
+
# If the WFP is bigger than the max post size and we already have something stored in the scan block, add it to the queue
|
|
661
|
+
if scan_block != '' and (wfp_size + scan_size) >= self.max_post_size:
|
|
662
|
+
self.threaded_scan.queue_add(scan_block)
|
|
663
|
+
queue_size += 1
|
|
664
|
+
scan_block = ''
|
|
665
|
+
wfp_file_count = 0
|
|
666
|
+
scan_block += wfp
|
|
667
|
+
scan_size = len(scan_block.encode("utf-8"))
|
|
668
|
+
wfp_file_count += 1
|
|
669
|
+
# If the scan request block (group of WFPs) or larger than the POST size or we have reached the file limit, add it to the queue
|
|
670
|
+
if wfp_file_count > self.post_file_count or scan_size >= self.max_post_size:
|
|
671
|
+
self.threaded_scan.queue_add(scan_block)
|
|
672
|
+
queue_size += 1
|
|
673
|
+
scan_block = ''
|
|
674
|
+
wfp_file_count = 0
|
|
675
|
+
if not scan_started and queue_size > self.nb_threads: # Start scanning if we have something to do
|
|
676
|
+
scan_started = True
|
|
677
|
+
if not self.threaded_scan.run(wait=False):
|
|
678
|
+
self.print_stderr(
|
|
679
|
+
f'Warning: Some errors encounted while scanning. Results might be incomplete.')
|
|
680
|
+
success = False
|
|
681
|
+
# End for loop
|
|
682
|
+
if self.threaded_scan and scan_block != '':
|
|
683
|
+
self.threaded_scan.queue_add(scan_block) # Make sure all files have been submitted
|
|
684
|
+
if spinner:
|
|
685
|
+
spinner.finish()
|
|
686
|
+
|
|
687
|
+
if file_count > 0:
|
|
688
|
+
if save_wfps_for_print: # Write a WFP file if no threading is requested
|
|
689
|
+
self.print_debug(f'Writing fingerprints to {self.wfp}')
|
|
690
|
+
with open(self.wfp, 'w') as f:
|
|
691
|
+
f.write(''.join(wfp_list))
|
|
692
|
+
else:
|
|
693
|
+
self.print_debug(f'Skipping writing WFP file {self.wfp}')
|
|
694
|
+
if self.threaded_scan:
|
|
695
|
+
success = self.__run_scan_threaded(scan_started, file_count)
|
|
696
|
+
else:
|
|
697
|
+
Scanner.print_stderr(f'Warning: No files found to scan from: {files}')
|
|
698
|
+
return success
|
|
699
|
+
|
|
700
|
+
def scan_files_with_options(self, files: [], deps_file: str = None, file_map: dict = None) -> bool:
|
|
701
|
+
"""
|
|
702
|
+
Scan the given list of files for whatever scaning options that have been configured
|
|
703
|
+
:param files: list of files to scan
|
|
704
|
+
:param deps_file: pre-parsed dependency file to decorate
|
|
705
|
+
:param file_map: mapping of obfuscated files back into originals
|
|
706
|
+
:return: True if successful, False otherwise
|
|
707
|
+
"""
|
|
708
|
+
success = True
|
|
709
|
+
if not files:
|
|
710
|
+
raise Exception(f"ERROR: Please specify a list of files to scan")
|
|
711
|
+
if not self.is_file_or_snippet_scan():
|
|
712
|
+
raise Exception(f"ERROR: file or snippet scan options have to be set to scan files: {files}")
|
|
713
|
+
if self.is_dependency_scan() or deps_file:
|
|
714
|
+
raise Exception(f"ERROR: The dependency scan option is currently not supported when scanning a list of files")
|
|
715
|
+
if self.scan_output:
|
|
716
|
+
self.print_msg(f'Writing results to {self.scan_output}...')
|
|
717
|
+
if self.is_file_or_snippet_scan():
|
|
718
|
+
if not self.scan_files(files):
|
|
719
|
+
success = False
|
|
720
|
+
if self.threaded_scan:
|
|
721
|
+
if not self.__finish_scan_threaded(file_map):
|
|
722
|
+
success = False
|
|
723
|
+
return success
|
|
724
|
+
|
|
601
725
|
def scan_contents(self, filename: str, contents: bytes) -> bool:
|
|
602
726
|
"""
|
|
603
727
|
Scan the given contents as a file
|
|
@@ -741,7 +865,7 @@ class Scanner(ScanossBase):
|
|
|
741
865
|
raise Exception(f"ERROR: Specified WFP file does not exist or is not a file: {wfp_file}")
|
|
742
866
|
|
|
743
867
|
if not self.is_file_or_snippet_scan() and not self.is_dependency_scan():
|
|
744
|
-
raise Exception(f"ERROR: No scan options defined to scan
|
|
868
|
+
raise Exception(f"ERROR: No scan options defined to scan WFP: {wfp}")
|
|
745
869
|
|
|
746
870
|
if self.scan_output:
|
|
747
871
|
self.print_msg(f'Writing results to {self.scan_output}...')
|
|
@@ -749,18 +873,17 @@ class Scanner(ScanossBase):
|
|
|
749
873
|
if not self.threaded_deps.run(deps_file=deps_file, wait=False): # Kick off a background dependency scan
|
|
750
874
|
success = False
|
|
751
875
|
if self.is_file_or_snippet_scan():
|
|
752
|
-
if not self.scan_wfp_file_threaded(wfp_file
|
|
876
|
+
if not self.scan_wfp_file_threaded(wfp_file):
|
|
753
877
|
success = False
|
|
754
878
|
if self.threaded_scan:
|
|
755
879
|
if not self.__finish_scan_threaded(file_map):
|
|
756
880
|
success = False
|
|
757
881
|
return success
|
|
758
882
|
|
|
759
|
-
def scan_wfp_file_threaded(self, file: str = None
|
|
883
|
+
def scan_wfp_file_threaded(self, file: str = None) -> bool:
|
|
760
884
|
"""
|
|
761
885
|
Scan the contents of the specified WFP file (threaded)
|
|
762
886
|
:param file: WFP file to scan (optional)
|
|
763
|
-
:param file_map: mapping of obfuscated files back into originals (optional)
|
|
764
887
|
return: True if successful, False otherwise
|
|
765
888
|
"""
|
|
766
889
|
success = True
|
scanoss/scanossgrpc.py
CHANGED
|
@@ -43,7 +43,8 @@ from .api.dependencies.v2.scanoss_dependencies_pb2 import DependencyRequest, Dep
|
|
|
43
43
|
from .api.common.v2.scanoss_common_pb2 import EchoRequest, EchoResponse, StatusResponse, StatusCode, PurlRequest
|
|
44
44
|
from .api.vulnerabilities.v2.scanoss_vulnerabilities_pb2 import VulnerabilityResponse
|
|
45
45
|
from .api.semgrep.v2.scanoss_semgrep_pb2 import SemgrepResponse
|
|
46
|
-
from .api.components.v2.scanoss_components_pb2 import CompSearchRequest, CompSearchResponse,
|
|
46
|
+
from .api.components.v2.scanoss_components_pb2 import (CompSearchRequest, CompSearchResponse,
|
|
47
|
+
CompVersionRequest, CompVersionResponse)
|
|
47
48
|
from .scanossbase import ScanossBase
|
|
48
49
|
from . import __version__
|
|
49
50
|
|
scanoss/threadeddependencies.py
CHANGED
|
@@ -112,8 +112,8 @@ class ThreadedDependencies(ScanossBase):
|
|
|
112
112
|
if deps is None:
|
|
113
113
|
self.print_stderr(f'Problem searching for dependencies for: {what_to_scan}')
|
|
114
114
|
self._errors = True
|
|
115
|
-
elif not deps:
|
|
116
|
-
self.
|
|
115
|
+
elif not deps or len(deps.get("files", [])) == 0:
|
|
116
|
+
self.print_debug(f'No dependencies found to decorate for: {what_to_scan}')
|
|
117
117
|
else:
|
|
118
118
|
decorated_deps = self.grpc_api.get_dependencies(deps)
|
|
119
119
|
if decorated_deps:
|
|
@@ -4,20 +4,20 @@ protoc_gen_swagger/options/annotations_pb2.py,sha256=b25EDD6gssUWnFby9gxgcpLIROT
|
|
|
4
4
|
protoc_gen_swagger/options/annotations_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
|
|
5
5
|
protoc_gen_swagger/options/openapiv2_pb2.py,sha256=vYElGp8E1vGHszvWqX97zNG9GFJ7u2QcdK9ouq0XdyI,14939
|
|
6
6
|
protoc_gen_swagger/options/openapiv2_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
|
|
7
|
-
scanoss/__init__.py,sha256=
|
|
8
|
-
scanoss/cli.py,sha256=
|
|
7
|
+
scanoss/__init__.py,sha256=kNW4sX9iGCu_4Qlaeuymupek7DpOaKBVIfL8PoLvQVE,1163
|
|
8
|
+
scanoss/cli.py,sha256=V-T9_tuG-2GfjULxPjtw_d-mEVZgBlOs3KbAL-tVCv4,41637
|
|
9
9
|
scanoss/components.py,sha256=ZHZ1KA69shxOASZK7USD9yPTITpAc_RXL5q5zpDK23o,12590
|
|
10
10
|
scanoss/csvoutput.py,sha256=hBwr_Fc6mBdOdXgyQcdFrockYH-PJ0jblowlExJ6OPg,9925
|
|
11
11
|
scanoss/cyclonedx.py,sha256=dPhj6sdwl2P8viC-sicAOLZzyklUR82NGFHaEeGYpeA,12065
|
|
12
12
|
scanoss/filecount.py,sha256=o7xb6m387ucnsU4H1OXGzf_AdWsudhAHe49T8uX4Ieo,6660
|
|
13
13
|
scanoss/scancodedeps.py,sha256=dPJsv9BmEsaM1IEzceJCnwLyu6Z0JwPposxdY4q0DAg,10775
|
|
14
|
-
scanoss/scanner.py,sha256=
|
|
14
|
+
scanoss/scanner.py,sha256=04cVbQI1K4Twwdu4kORKqACtvx4xjHOcOPEzUW_snpU,50149
|
|
15
15
|
scanoss/scanossapi.py,sha256=JU5B_TgaFs1hQn0W7RaHm9jBmZXFpFC89kwyKNDA1PA,12562
|
|
16
16
|
scanoss/scanossbase.py,sha256=WxYlWl6WxRArho4VKGFxEla8qYnjOXtF6EnwsHTrKm4,2319
|
|
17
|
-
scanoss/scanossgrpc.py,sha256=
|
|
17
|
+
scanoss/scanossgrpc.py,sha256=lf5LJ8FFzF6OAu0zNUvCvLD6-7bIzQNR5pn3XkRiyRo,20483
|
|
18
18
|
scanoss/scantype.py,sha256=R2-ExLGOrYxaJFtIK2AEo2caD0XrN1zpF5q1qT9Zsyc,1326
|
|
19
19
|
scanoss/spdxlite.py,sha256=ZAJlkgW5U9WUT35D1ZEwIJ-eLkbVLBv3lU_XIArfoik,15441
|
|
20
|
-
scanoss/threadeddependencies.py,sha256=
|
|
20
|
+
scanoss/threadeddependencies.py,sha256=JotQC9X3nnviblKe--OPS-7rr1W-cZjuxsxSPL-tbPg,6284
|
|
21
21
|
scanoss/threadedscanning.py,sha256=T0tL8W1IEX_hLY5ksrAl_iQqtxT_KbyDhTDHo6a7xFE,9387
|
|
22
22
|
scanoss/winnowing.py,sha256=CC4hB0iPHh8CmftnM2w8bmJlS8lAroi3kmJa6hHyfgk,15222
|
|
23
23
|
scanoss/api/__init__.py,sha256=KlDD87JmyZP-10T-fuJo0_v2zt1gxWfTgs70wjky9xg,1139
|
|
@@ -47,12 +47,12 @@ scanoss/api/vulnerabilities/__init__.py,sha256=FLQtiDiv85Q1Chk-sJ9ky9WOV1mulZhEK
|
|
|
47
47
|
scanoss/api/vulnerabilities/v2/__init__.py,sha256=FLQtiDiv85Q1Chk-sJ9ky9WOV1mulZhEKjiBihlwiaM,1139
|
|
48
48
|
scanoss/api/vulnerabilities/v2/scanoss_vulnerabilities_pb2.py,sha256=CFhF80av8tenGvn9AIsGEtRJPuV2dC_syA5JLZb2lDw,5464
|
|
49
49
|
scanoss/api/vulnerabilities/v2/scanoss_vulnerabilities_pb2_grpc.py,sha256=HlS4k4Zmx6RIAqaO9I96jD-eyF5yU6Xx04pVm7pdqOg,6864
|
|
50
|
-
scanoss/data/build_date.txt,sha256=
|
|
50
|
+
scanoss/data/build_date.txt,sha256=BzICu2lLBdWOULEC4j0yzP_SrZ4mkTzDp5dZUMyD5CI,40
|
|
51
51
|
scanoss/data/spdx-exceptions.json,sha256=s7UTYxC7jqQXr11YBlIWYCNwN6lRDFTR33Y8rpN_dA4,17953
|
|
52
52
|
scanoss/data/spdx-licenses.json,sha256=A6Z0q82gaTLtnopBfzeIVZjJFxkdRW1g2TuumQc-lII,228794
|
|
53
|
-
scanoss-1.
|
|
54
|
-
scanoss-1.
|
|
55
|
-
scanoss-1.
|
|
56
|
-
scanoss-1.
|
|
57
|
-
scanoss-1.
|
|
58
|
-
scanoss-1.
|
|
53
|
+
scanoss-1.10.0.dist-info/LICENSE,sha256=LLUaXoiyOroIbr5ubAyrxBOwSRLTm35ETO2FmLpy8QQ,1074
|
|
54
|
+
scanoss-1.10.0.dist-info/METADATA,sha256=W1j9E0Pg4ISCu4EUYsQFEwnkvtvMC5lqDOai-zhIGi8,5906
|
|
55
|
+
scanoss-1.10.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
56
|
+
scanoss-1.10.0.dist-info/entry_points.txt,sha256=Uy28xnaDL5KQ7V77sZD5VLDXPNxYYzSr5tsqtiXVzAs,48
|
|
57
|
+
scanoss-1.10.0.dist-info/top_level.txt,sha256=V11PrQ6Pnrc-nDF9xnisnJ8e6-i7HqSIKVNqduRWcL8,27
|
|
58
|
+
scanoss-1.10.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|