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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: boman-cli
3
- Version: 2.5.10
3
+ Version: 2.5.12
4
4
  Summary: CLI tool of boman.ai
5
5
  Home-page: https://boman.ai
6
6
  Author: Sumeru Software Solutions Pvt. Ltd.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: boman-cli
3
- Version: 2.5.10
3
+ Version: 2.5.12
4
4
  Summary: CLI tool of boman.ai
5
5
  Home-page: https://boman.ai
6
6
  Author: Sumeru Software Solutions Pvt. Ltd.
@@ -121,7 +121,7 @@ class Config:
121
121
 
122
122
  log_level = "INFO"
123
123
 
124
- version = 'v2.5.10'
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
- set_cache_dir = False
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
- Utils.checkImageAlreadyExsist(docker_image)
698
- logging.info('Running %s',tool_name)
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
- try:
701
- workspace = os.getcwd()
702
-
703
- tmp_dir = os.path.join(workspace, ".ci_tmp")
704
- home_dir = os.path.join(workspace, ".ci_home")
705
-
706
- os.makedirs(tmp_dir, exist_ok=True)
707
- os.makedirs(home_dir, exist_ok=True)
708
-
709
- command_line = "% s" % command_line.format(lang = Config.reachability_language)
710
- #command_line ="atom reachables -l python -o /app/app.atom -s /app/reachables.slices.json /app"
711
- Config.build_dir = Config.reachability_build_dir = Config.sca_build_dir
712
- container_output = docker.containers.run(docker_image, command_line, volumes={
713
- tmp_dir: {'bind': '/tmp', 'mode': 'rw'},
714
- home_dir: {'bind': '/home/container', 'mode': 'rw'},
715
- Config.reachability_build_dir: {'bind': data['bind'], 'mode': 'rw'}
716
- }, user=uid, remove=True)
717
- logging.info('Reachability Docker: SUCCESS!!! Message: %s Scan Completed',tool_name)
718
- reachables = Utils.reachability_analysis(f'{Config.sbom_build_dir}/{Config.sbom_output_file}',f'{Config.sca_build_dir}/{output_file}')
719
- Config.reachability_message ='Reachability Completed'
720
- Config.reachability_status ='Completed'
721
- except errors.ContainerError as exc:
722
- logging.error('Reachability Docker: Failed!!! Message: Some Error recorded while scanning %s',str(exc))
723
- msg='\n The following error has been recorded while scanning IaC'
724
- Config.reachability_status ='Failed'
725
- Config.reachability_errors =f'{str(exc)}]'
726
- Utils.logError(msg,str(exc))
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
- try:
729
- if will_generate_output == 1:
730
- logging.info('Reachability: Uploading %s to the server',output_file)
731
- output_reachability = {
732
- 'output_file': output_file,
733
- 'output': reachables
734
- }
735
- if uploadReport(output_reachability,tool_name,tool_id,scan_details_id,'reachability'):
736
- Config.reachability_status ='Completed'
737
- Config.reachability_upload_status = 'Completed'
738
- Config.reachability_message ='Scan Completed'
739
- else:
740
- Config.reachability_status ='Failed'
741
- Config.reachability_upload_status = 'Failed'
742
- Config.reachability_message ='Error occured while uploading the report, Please check the cli logs'
743
- else:
744
- logging.error('reachability: Failed!!! Message: Cant upload files to the server',tool_name)
745
- Config.reachability_message ='Cant upload files to the server for reachability, Please check your directory If output file is present.'
746
-
747
- except EnvironmentError as e:
748
- logging.error('reachability: Failed!!! Message: Error recorded while uploading the report %s',str(e))
749
- 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
750
- msg = 'Error recorded while uploading the report'
751
- Utils.logError(msg,str(e))
752
- elif type == "reachability":
753
- Config.reachability_status ='Failed'
754
- Config.reachability_message ='Reachability: SBOM scan failed. Reachability analysis requires sbom file'
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 ------------------------------------
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  environment = prod
3
- version = 2.5.10
3
+ version = 2.5.12
4
4
  name = boman-cli
5
5
  saas_base_url = https://dashboard.boman.ai/
6
6
 
File without changes
File without changes
File without changes
File without changes