boman-cli 2.5.10__tar.gz → 2.5.12__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.
- {boman_cli-2.5.10 → boman_cli-2.5.12}/PKG-INFO +1 -1
- {boman_cli-2.5.10 → boman_cli-2.5.12}/boman_cli.egg-info/PKG-INFO +1 -1
- {boman_cli-2.5.10 → boman_cli-2.5.12}/bomancli/Config.py +7 -4
- {boman_cli-2.5.10 → boman_cli-2.5.12}/bomancli/main.py +64 -60
- {boman_cli-2.5.10 → boman_cli-2.5.12}/setup.cfg +1 -1
- {boman_cli-2.5.10 → boman_cli-2.5.12}/README.md +0 -0
- {boman_cli-2.5.10 → boman_cli-2.5.12}/boman_cli.egg-info/SOURCES.txt +0 -0
- {boman_cli-2.5.10 → boman_cli-2.5.12}/boman_cli.egg-info/dependency_links.txt +0 -0
- {boman_cli-2.5.10 → boman_cli-2.5.12}/boman_cli.egg-info/entry_points.txt +0 -0
- {boman_cli-2.5.10 → boman_cli-2.5.12}/boman_cli.egg-info/requires.txt +0 -0
- {boman_cli-2.5.10 → boman_cli-2.5.12}/boman_cli.egg-info/top_level.txt +0 -0
- {boman_cli-2.5.10 → boman_cli-2.5.12}/bomancli/_init_.py +0 -0
- {boman_cli-2.5.10 → boman_cli-2.5.12}/bomancli/auth.py +0 -0
- {boman_cli-2.5.10 → boman_cli-2.5.12}/bomancli/base_logger.py +0 -0
- {boman_cli-2.5.10 → boman_cli-2.5.12}/bomancli/dev_attribution.py +0 -0
- {boman_cli-2.5.10 → boman_cli-2.5.12}/bomancli/loc_finder.py +0 -0
- {boman_cli-2.5.10 → boman_cli-2.5.12}/bomancli/sbom_enricher.py +0 -0
- {boman_cli-2.5.10 → boman_cli-2.5.12}/bomancli/templates/template_plan.yaml +0 -0
- {boman_cli-2.5.10 → boman_cli-2.5.12}/bomancli/utils.py +0 -0
- {boman_cli-2.5.10 → boman_cli-2.5.12}/bomancli/validation.py +0 -0
- {boman_cli-2.5.10 → boman_cli-2.5.12}/setup.py +0 -0
|
@@ -121,7 +121,7 @@ class Config:
|
|
|
121
121
|
|
|
122
122
|
log_level = "INFO"
|
|
123
123
|
|
|
124
|
-
version = 'v2.5.
|
|
124
|
+
version = 'v2.5.12'
|
|
125
125
|
|
|
126
126
|
boman_config_file = 'boman.yaml'
|
|
127
127
|
|
|
@@ -167,8 +167,7 @@ class Config:
|
|
|
167
167
|
sbom_scan_status=None
|
|
168
168
|
sbom_target=None
|
|
169
169
|
sbom_output_file=None
|
|
170
|
-
|
|
171
|
-
cache_dir = " --cache-dir /tmp/.trivycache"
|
|
170
|
+
|
|
172
171
|
#IAC scanning
|
|
173
172
|
iac_scan_present=None
|
|
174
173
|
iac_scan_build_dir=None
|
|
@@ -229,4 +228,8 @@ class Config:
|
|
|
229
228
|
|
|
230
229
|
cloc_total_data = None
|
|
231
230
|
|
|
232
|
-
hssc_output_file = 'boman-hssc.csv'
|
|
231
|
+
hssc_output_file = 'boman-hssc.csv'
|
|
232
|
+
|
|
233
|
+
# common for trivy container and sbom scan
|
|
234
|
+
set_cache_dir = False
|
|
235
|
+
cache_dir = " --cache-dir /tmp/.trivycache"
|
|
@@ -194,7 +194,7 @@ def runImage(data=None,type=None):
|
|
|
194
194
|
logging.info('SAST Docker: Preparing %s scan for non jenkins env with %s user ', tool_name ,userid)
|
|
195
195
|
Config.build_dir = Config.sast_build_dir
|
|
196
196
|
container_output = docker.containers.run(docker_image, command_line, volumes={Config.sast_build_dir: {
|
|
197
|
-
'bind': data['bind']}},user=userid,detach=detach,environment=env_var)
|
|
197
|
+
'bind': data['bind']}},user=userid,detach=detach,environment=env_var,remove=True)
|
|
198
198
|
logging.info('SAST Docker: SUCCESS !!!. Message: %s Scan Completed',tool_name)
|
|
199
199
|
|
|
200
200
|
except errors.ContainerError as exc:
|
|
@@ -511,8 +511,12 @@ def runImage(data=None,type=None):
|
|
|
511
511
|
command_line = "% s" % command_line.format(target = os.path.join('/src',Utils.remove_leading_slash(Config.con_scan_target)))
|
|
512
512
|
else:
|
|
513
513
|
command_line = "% s" % command_line.format(target = Config.con_scan_target)
|
|
514
|
+
|
|
515
|
+
# if Config.set_cache_dir:
|
|
516
|
+
# command_line = command_line + Config.cache_dir
|
|
517
|
+
# logging.info('Container scan Docker: Cache directory is set for the scan, updated command is %s',command_line[-20:])
|
|
514
518
|
|
|
515
|
-
logging.info(f"CS Docker: command ==> {command_line}")
|
|
519
|
+
# logging.info(f"CS Docker: command ==> {command_line[-20:]}")
|
|
516
520
|
Config.build_dir = Config.con_scan_build_dir
|
|
517
521
|
container_output = docker.containers.run(docker_image, command_line, volumes={Config.con_scan_build_dir: {
|
|
518
522
|
'bind': data['bind']}}, user=uid, remove=True)
|
|
@@ -554,7 +558,6 @@ def runImage(data=None,type=None):
|
|
|
554
558
|
|
|
555
559
|
try:
|
|
556
560
|
Config.build_dir = Config.sbom_build_dir = os.getcwd()+'/'
|
|
557
|
-
command_line = "--format cyclonedx --output /src/boman_trivy_sbom_scan.json --scanners vuln fs /{target}"
|
|
558
561
|
command_line = "% s" % command_line.format(target = 'src/')
|
|
559
562
|
#added upon jenkins sbom issue - GM
|
|
560
563
|
if Config.set_cache_dir:
|
|
@@ -693,65 +696,66 @@ def runImage(data=None,type=None):
|
|
|
693
696
|
msg = 'Error recorded while uploading the report'
|
|
694
697
|
Utils.logError(msg,str(e))
|
|
695
698
|
|
|
696
|
-
if type == 'reachability' and Config.sbom_scan_status.lower() != "failed":
|
|
697
|
-
|
|
698
|
-
|
|
699
|
+
# if type == 'reachability' and Config.sbom_scan_status.lower() != "failed":
|
|
700
|
+
# Utils.checkImageAlreadyExsist(docker_image)
|
|
701
|
+
# logging.info('Running %s',tool_name)
|
|
699
702
|
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
703
|
+
# try:
|
|
704
|
+
# workspace = os.getcwd()
|
|
705
|
+
|
|
706
|
+
# tmp_dir = os.path.join(workspace, ".ci_tmp")
|
|
707
|
+
# home_dir = os.path.join(workspace, ".ci_home")
|
|
708
|
+
|
|
709
|
+
# os.makedirs(tmp_dir, exist_ok=True)
|
|
710
|
+
# os.makedirs(home_dir, exist_ok=True)
|
|
711
|
+
|
|
712
|
+
# command_line = "% s" % command_line.format(lang = Config.reachability_language)
|
|
713
|
+
# #command_line ="atom reachables -l python -o /app/app.atom -s /app/reachables.slices.json /app"
|
|
714
|
+
# Config.build_dir = Config.reachability_build_dir = Config.sca_build_dir
|
|
715
|
+
# container_output = docker.containers.run(docker_image, command_line, volumes={
|
|
716
|
+
# tmp_dir: {'bind': '/tmp', 'mode': 'rw'},
|
|
717
|
+
# home_dir: {'bind': '/home/container', 'mode': 'rw'},
|
|
718
|
+
# Config.reachability_build_dir: {'bind': data['bind'], 'mode': 'rw'}
|
|
719
|
+
# }, user=uid, remove=True)
|
|
720
|
+
# logging.info('Reachability Docker: SUCCESS!!! Message: %s Scan Completed',tool_name)
|
|
721
|
+
# reachables = Utils.reachability_analysis(f'{Config.sbom_build_dir}/{Config.sbom_output_file}',f'{Config.sca_build_dir}/{output_file}')
|
|
722
|
+
# Config.reachability_message ='Reachability Completed'
|
|
723
|
+
# Config.reachability_status ='Completed'
|
|
724
|
+
# except errors.ContainerError as exc:
|
|
725
|
+
# logging.error('Reachability Docker: Failed!!! Message: Some Error recorded while scanning %s',str(exc))
|
|
726
|
+
# msg='\n The following error has been recorded while scanning Reachability'
|
|
727
|
+
# Config.reachability_status ='Failed'
|
|
728
|
+
# Config.reachability_errors =f'{str(exc)}]'
|
|
729
|
+
# Utils.logError(msg,str(exc))
|
|
730
|
+
# reachables = None
|
|
727
731
|
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
elif type == "reachability":
|
|
753
|
-
|
|
754
|
-
|
|
732
|
+
# try:
|
|
733
|
+
# if will_generate_output == 1 and reachables is not None:
|
|
734
|
+
# logging.info('Reachability: Uploading %s to the server',output_file)
|
|
735
|
+
# output_reachability = {
|
|
736
|
+
# 'output_file': output_file,
|
|
737
|
+
# 'output': reachables
|
|
738
|
+
# }
|
|
739
|
+
# if uploadReport(output_reachability,tool_name,tool_id,scan_details_id,'reachability'):
|
|
740
|
+
# Config.reachability_status ='Completed'
|
|
741
|
+
# Config.reachability_upload_status = 'Completed'
|
|
742
|
+
# Config.reachability_message ='Scan Completed'
|
|
743
|
+
# else:
|
|
744
|
+
# Config.reachability_status ='Failed'
|
|
745
|
+
# Config.reachability_upload_status = 'Failed'
|
|
746
|
+
# Config.reachability_message ='Error occured while uploading the report, Please check the cli logs'
|
|
747
|
+
# else:
|
|
748
|
+
# logging.error('reachability: Failed!!! Message: Cant upload files to the server',tool_name)
|
|
749
|
+
# Config.reachability_message ='Cant upload files to the server for reachability, Please check your directory If output file is present.'
|
|
750
|
+
|
|
751
|
+
# except EnvironmentError as e:
|
|
752
|
+
# logging.error('reachability: Failed!!! Message: Error recorded while uploading the report %s',str(e))
|
|
753
|
+
# Config.reachability_message ='Error recorded while uploading the report of reachability, Please check your directory If output file is present.' ## need to change logic here -- MM
|
|
754
|
+
# msg = 'Error recorded while uploading the report'
|
|
755
|
+
# Utils.logError(msg,str(e))
|
|
756
|
+
# elif type == "reachability":
|
|
757
|
+
# Config.reachability_status ='Failed'
|
|
758
|
+
# Config.reachability_message ='Reachability: SBOM scan failed. Reachability analysis requires sbom file'
|
|
755
759
|
|
|
756
760
|
|
|
757
761
|
#### function to upload the test report to the server with other data -- MM ------------------------------------
|
|
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
|
|
File without changes
|
|
File without changes
|