boman-cli 2.5.12__tar.gz → 2.5.13__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.12 → boman_cli-2.5.13}/PKG-INFO +1 -1
- {boman_cli-2.5.12 → boman_cli-2.5.13}/boman_cli.egg-info/PKG-INFO +1 -1
- {boman_cli-2.5.12 → boman_cli-2.5.13}/bomancli/Config.py +5 -2
- {boman_cli-2.5.12 → boman_cli-2.5.13}/bomancli/main.py +21 -15
- {boman_cli-2.5.12 → boman_cli-2.5.13}/setup.cfg +1 -1
- {boman_cli-2.5.12 → boman_cli-2.5.13}/README.md +0 -0
- {boman_cli-2.5.12 → boman_cli-2.5.13}/boman_cli.egg-info/SOURCES.txt +0 -0
- {boman_cli-2.5.12 → boman_cli-2.5.13}/boman_cli.egg-info/dependency_links.txt +0 -0
- {boman_cli-2.5.12 → boman_cli-2.5.13}/boman_cli.egg-info/entry_points.txt +0 -0
- {boman_cli-2.5.12 → boman_cli-2.5.13}/boman_cli.egg-info/requires.txt +0 -0
- {boman_cli-2.5.12 → boman_cli-2.5.13}/boman_cli.egg-info/top_level.txt +0 -0
- {boman_cli-2.5.12 → boman_cli-2.5.13}/bomancli/_init_.py +0 -0
- {boman_cli-2.5.12 → boman_cli-2.5.13}/bomancli/auth.py +0 -0
- {boman_cli-2.5.12 → boman_cli-2.5.13}/bomancli/base_logger.py +0 -0
- {boman_cli-2.5.12 → boman_cli-2.5.13}/bomancli/dev_attribution.py +0 -0
- {boman_cli-2.5.12 → boman_cli-2.5.13}/bomancli/loc_finder.py +0 -0
- {boman_cli-2.5.12 → boman_cli-2.5.13}/bomancli/sbom_enricher.py +0 -0
- {boman_cli-2.5.12 → boman_cli-2.5.13}/bomancli/templates/template_plan.yaml +0 -0
- {boman_cli-2.5.12 → boman_cli-2.5.13}/bomancli/utils.py +0 -0
- {boman_cli-2.5.12 → boman_cli-2.5.13}/bomancli/validation.py +0 -0
- {boman_cli-2.5.12 → boman_cli-2.5.13}/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.13'
|
|
125
125
|
|
|
126
126
|
boman_config_file = 'boman.yaml'
|
|
127
127
|
|
|
@@ -232,4 +232,7 @@ class Config:
|
|
|
232
232
|
|
|
233
233
|
# common for trivy container and sbom scan
|
|
234
234
|
set_cache_dir = False
|
|
235
|
-
cache_dir = " --cache-dir /tmp/.trivycache"
|
|
235
|
+
cache_dir = " --cache-dir /tmp/.trivycache"
|
|
236
|
+
|
|
237
|
+
#common settings for all scans
|
|
238
|
+
docker_timeout = 600
|
|
@@ -186,7 +186,7 @@ def runImage(data=None,type=None):
|
|
|
186
186
|
|
|
187
187
|
Config.build_dir = Config.sast_build_dir
|
|
188
188
|
container_output = docker.containers.run(docker_image, command_line, volumes={Config.sast_build_dir: {
|
|
189
|
-
'bind': data['bind']}}, user=userid,detach=detach,environment=env_var, remove=True)
|
|
189
|
+
'bind': data['bind']}}, user=userid,detach=detach,environment=env_var, remove=True,timeout=Config.docker_timeout)
|
|
190
190
|
logging.info('SAST Docker: SUCCESS !!!. Message: %s Scan Completed',tool_name)
|
|
191
191
|
|
|
192
192
|
else:
|
|
@@ -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,remove=True)
|
|
197
|
+
'bind': data['bind']}},user=userid,detach=detach,environment=env_var,remove=True,timeout=Config.docker_timeout)
|
|
198
198
|
logging.info('SAST Docker: SUCCESS !!!. Message: %s Scan Completed',tool_name)
|
|
199
199
|
|
|
200
200
|
except errors.ContainerError as exc:
|
|
@@ -368,7 +368,7 @@ def runImage(data=None,type=None):
|
|
|
368
368
|
try:
|
|
369
369
|
Config.build_dir = Config.sast_build_dir
|
|
370
370
|
container= docker.containers.run(docker_image, command_line, volumes={Config.sast_build_dir: {
|
|
371
|
-
'bind': data['bind'], 'mode': 'rw'}},user=userid,detach=detach, remove=True)
|
|
371
|
+
'bind': data['bind'], 'mode': 'rw'}},user=userid,detach=detach, remove=True,timeout=Config.docker_timeout)
|
|
372
372
|
|
|
373
373
|
#print(output_file,toolname,tool_id,scan_details_id)
|
|
374
374
|
logging.info('[SUCCESS]: %s Scan Completed',tool_name)
|
|
@@ -396,7 +396,7 @@ def runImage(data=None,type=None):
|
|
|
396
396
|
Config.build_dir = Config.sast_build_dir
|
|
397
397
|
logging.info('DAST Docker: Command for running the scan %s',command_line)
|
|
398
398
|
container= docker.containers.run(docker_image, command_line, volumes={Config.sast_build_dir: {
|
|
399
|
-
'bind': data['bind'], 'mode': 'rw'}},user=userid,detach=detach, remove=True)
|
|
399
|
+
'bind': data['bind'], 'mode': 'rw'}},user=userid,detach=detach, remove=True,timeout=Config.docker_timeout)
|
|
400
400
|
|
|
401
401
|
#print(output_file,toolname,tool_id,scan_details_id)
|
|
402
402
|
logging.info('DAST Docker: SUCCESS!!! Message: %s Scan Completed',tool_name)
|
|
@@ -445,14 +445,14 @@ def runImage(data=None,type=None):
|
|
|
445
445
|
Config.build_dir = Config.sca_build_dir
|
|
446
446
|
command_line = "% s" % command_line.format(target = './'+target)
|
|
447
447
|
container_output = docker.containers.run(docker_image, command_line, volumes={Config.sca_build_dir: {
|
|
448
|
-
'bind': data['bind']}}, user=uid, remove=True)
|
|
448
|
+
'bind': data['bind']}}, user=uid, remove=True,timeout=Config.docker_timeout)
|
|
449
449
|
logging.info('SCA Docker: SUCCESS!!! Message: %s Scan Completed',tool_name)
|
|
450
450
|
else:
|
|
451
451
|
target = Utils.remove_leading_slash(Config.sca_target)
|
|
452
452
|
Config.build_dir = Config.sca_build_dir
|
|
453
453
|
command_line = "% s" % command_line.format(target ='/src/'+target)
|
|
454
454
|
container_output = docker.containers.run(docker_image, command_line, volumes={Config.sca_build_dir: {
|
|
455
|
-
'bind': data['bind']}}, user=uid, remove=True)
|
|
455
|
+
'bind': data['bind']}}, user=uid, remove=True,timeout=Config.docker_timeout)
|
|
456
456
|
logging.info('SCA Docker: SUCCESS!!! Message: %s Scan Completed',tool_name)
|
|
457
457
|
else:
|
|
458
458
|
if Config.sca_ignore:
|
|
@@ -463,7 +463,7 @@ def runImage(data=None,type=None):
|
|
|
463
463
|
logging.info('SCA Docker: Command ==> %s',command_line)
|
|
464
464
|
Config.build_dir = Config.sca_build_dir
|
|
465
465
|
container_output = docker.containers.run(docker_image, command_line, volumes={Config.sca_build_dir: {
|
|
466
|
-
'bind': data['bind']}}, user=uid, remove=True)
|
|
466
|
+
'bind': data['bind']}}, user=uid, remove=True,timeout=Config.docker_timeout)
|
|
467
467
|
logging.info('SCA Docker: SUCCESS!!! Message: %s Scan Completed',tool_name)
|
|
468
468
|
Config.sca_message ='SCA scan completed'
|
|
469
469
|
Config.sca_scan_status ='Completed'
|
|
@@ -512,14 +512,14 @@ def runImage(data=None,type=None):
|
|
|
512
512
|
else:
|
|
513
513
|
command_line = "% s" % command_line.format(target = Config.con_scan_target)
|
|
514
514
|
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
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:])
|
|
518
518
|
|
|
519
|
-
|
|
519
|
+
logging.info(f"CS Docker: command ==> {command_line[-20:]}")
|
|
520
520
|
Config.build_dir = Config.con_scan_build_dir
|
|
521
521
|
container_output = docker.containers.run(docker_image, command_line, volumes={Config.con_scan_build_dir: {
|
|
522
|
-
'bind': data['bind']}}, user=uid, remove=True)
|
|
522
|
+
'bind': data['bind']}}, user=uid, remove=True,timeout=Config.docker_timeout)
|
|
523
523
|
logging.info('CS Docker: SUCCESS!!! Message: %s Scan Completed',tool_name)
|
|
524
524
|
Config.con_scan_message ='Container Scan completed'
|
|
525
525
|
Config.con_scan_status ='Completed'
|
|
@@ -565,7 +565,7 @@ def runImage(data=None,type=None):
|
|
|
565
565
|
logging.info('SBOM Docker: Cache directory is set for the scan, updated command is %s',command_line[-20:])
|
|
566
566
|
logging.info(f"SBOM Docker: command ==> {command_line[-20:]}")
|
|
567
567
|
container_output = docker.containers.run(docker_image, command_line, volumes={Config.sbom_build_dir: {
|
|
568
|
-
'bind': data['bind']}}, user=uid, remove=True)
|
|
568
|
+
'bind': data['bind']}}, user=uid, remove=True,timeout=Config.docker_timeout)
|
|
569
569
|
logging.info('SBOM Docker: SUCCESS!!! Message: %s Scan Completed',tool_name)
|
|
570
570
|
Config.sbom_message ='SBOM scan completed'
|
|
571
571
|
Config.sbom_scan_status ='Completed'
|
|
@@ -658,7 +658,7 @@ def runImage(data=None,type=None):
|
|
|
658
658
|
command_line = "% s" % command_line.format(target = os.path.join('/src',Utils.remove_leading_slash(Config.iac_scan_target)))
|
|
659
659
|
Config.build_dir = Config.iac_scan_build_dir
|
|
660
660
|
container_output = docker.containers.run(docker_image, command_line, volumes={Config.iac_scan_build_dir: {
|
|
661
|
-
'bind': data['bind']}}, user=uid, remove=True)
|
|
661
|
+
'bind': data['bind']}}, user=uid, remove=True,timeout=Config.docker_timeout)
|
|
662
662
|
logging.info('IaC Docker: SUCCESS!!! Message: %s Scan Completed',tool_name)
|
|
663
663
|
Config.iac_scan_message ='IaC Scan completed'
|
|
664
664
|
Config.iac_scan_status ='Completed'
|
|
@@ -1264,6 +1264,7 @@ def default():
|
|
|
1264
1264
|
parser.add_argument('-pot','--pollTime',default=60,help="Polling Time. Min : 30s, Max: 5min, Default : 1min. Format: input the time in seconds eg: 1min => 60 ")
|
|
1265
1265
|
parser.add_argument('-pof','--pollFrequency',default=10,help="Polling Frequency. Min : 5s, Max: 1min, Default : 10s. Format: input the time in seconds eg: 1min => 60 ")
|
|
1266
1266
|
parser.add_argument('-std','--setCacheDir',default=False,help="Set the cache directory for the scan. Set true if you use jenkins cicd")
|
|
1267
|
+
parser.add_argument('-dto','--dockerTimeout',default=600,min=300,max=1800,help="Set the timeout for the docker scan in seconds. Default is 600s (10min). Min is 300s (5min) and Max is 1800s (30min). Format: input the time in seconds eg: 10min => 600 ")
|
|
1267
1268
|
args = parser.parse_args()
|
|
1268
1269
|
|
|
1269
1270
|
# if len(sys.args) == 1:
|
|
@@ -1390,7 +1391,12 @@ def default():
|
|
|
1390
1391
|
logging.info(f"Configuring polling frequency to {Config.polling_frequency}s")
|
|
1391
1392
|
else:
|
|
1392
1393
|
logging.info(f"Resorting to default polling frequency {Config.polling_frequency}s")
|
|
1393
|
-
|
|
1394
|
+
|
|
1395
|
+
if (args.dockerTimeout >=300) and (args.dockerTimeout <=1800):
|
|
1396
|
+
Config.docker_timeout = args.dockerTimeout
|
|
1397
|
+
logging.info(f"docker timeout configured: {Config.docker_timeout}s")
|
|
1398
|
+
else
|
|
1399
|
+
logging.info(f"Resoting to default docker timeout: {Config.docker_timeout}s")
|
|
1394
1400
|
|
|
1395
1401
|
if args.failBuild != "pass":
|
|
1396
1402
|
Config.fail_build = True
|
|
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
|