devsecops-engine-tools 1.108.0__py3-none-any.whl → 1.109.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.

Potentially problematic release.


This version of devsecops-engine-tools might be problematic. Click here for more details.

@@ -232,13 +232,6 @@ def get_inputs_from_cli(args):
232
232
  default="false",
233
233
  help="Enable or disable context creation. Applies to engine_iac, engine_container and engine_dependencies. Default is false."
234
234
  )
235
- parser.add_argument(
236
- "-repo",
237
- "--repo_name",
238
- type=str,
239
- required=False,
240
- help="Repository name, used when the repository name should not be taken from environment variable. Apply to kiuwan"
241
- )
242
235
 
243
236
  TOOLS = {
244
237
  "engine_iac": ["checkov", "kics", "kubescape"],
@@ -282,7 +275,6 @@ def get_inputs_from_cli(args):
282
275
  "image_to_scan": args.image_to_scan,
283
276
  "dast_file_path": args.dast_file_path,
284
277
  "context": args.context,
285
- "repo_name": args.repo_name
286
278
  }
287
279
 
288
280
 
@@ -8,7 +8,7 @@ from devsecops_engine_tools.engine_utilities.azuredevops.models.AzurePredefinedV
8
8
  ReleaseVariables,
9
9
  AgentVariables,
10
10
  VMVariables,
11
- ApplicationVariables,
11
+ CustomVariables,
12
12
  )
13
13
  from devsecops_engine_tools.engine_utilities.azuredevops.infrastructure.azure_devops_api import (
14
14
  AzureDevopsApi,
@@ -59,17 +59,18 @@ class AzureDevops(DevopsPlatformGateway):
59
59
 
60
60
  def get_source_code_management_uri(self):
61
61
  try:
62
+ repository_variable = self.get_variable("repository")
62
63
  source_code_management_uri = {
63
64
  "tfsgit": (
64
65
  f"{SystemVariables.System_TeamFoundationCollectionUri.value()}"
65
- f"{SystemVariables.System_TeamProject.value()}/_git/{BuildVariables.Build_Repository_Name.value()}"
66
+ f"{SystemVariables.System_TeamProject.value()}/_git/{repository_variable}"
66
67
  ).replace(" ", "%20"),
67
68
  "github": (
68
- f"https://github.com/{BuildVariables.Build_Repository_Name.value()}"
69
+ f"https://github.com/{repository_variable}"
69
70
  ),
70
71
  "git": (
71
72
  f"{SystemVariables.System_TeamFoundationCollectionUri.value()}"
72
- f"{SystemVariables.System_TeamProject.value()}/_git/{BuildVariables.Build_Repository_Name.value()}"
73
+ f"{SystemVariables.System_TeamProject.value()}/_git/{repository_variable}"
73
74
  ).replace(" ", "%20")
74
75
  }
75
76
  return source_code_management_uri.get(BuildVariables.Build_Repository_Provider.value().lower())
@@ -101,11 +102,19 @@ class AzureDevops(DevopsPlatformGateway):
101
102
  "access_token": SystemVariables.System_AccessToken,
102
103
  "organization": SystemVariables.System_TeamFoundationCollectionUri,
103
104
  "project_name": SystemVariables.System_TeamProject,
104
- "repository": BuildVariables.Build_Repository_Name,
105
+ "repository": (
106
+ CustomVariables.Repository_Name
107
+ if CustomVariables.Repository_Name.value()
108
+ else BuildVariables.Build_Repository_Name
109
+ ),
105
110
  "pipeline_name": (
106
- BuildVariables.Build_DefinitionName
107
- if SystemVariables.System_HostType.value() == "build"
108
- else ReleaseVariables.Release_Definitionname
111
+ CustomVariables.Pipeline_Name
112
+ if CustomVariables.Pipeline_Name.value()
113
+ else (
114
+ BuildVariables.Build_DefinitionName
115
+ if SystemVariables.System_HostType.value() == "build"
116
+ else ReleaseVariables.Release_Definitionname
117
+ )
109
118
  ),
110
119
  "stage": SystemVariables.System_HostType,
111
120
  "path_directory": SystemVariables.System_DefaultWorkingDirectory,
@@ -118,7 +127,7 @@ class AzureDevops(DevopsPlatformGateway):
118
127
  "vm_product_type_name": VMVariables.Vm_Product_Type_Name,
119
128
  "vm_product_name": VMVariables.Vm_Product_Name,
120
129
  "vm_product_description": VMVariables.Vm_Product_Description,
121
- "build_task": ApplicationVariables.Application_Build_Task,
130
+ "build_task": CustomVariables.Build_Task,
122
131
  }
123
132
  try:
124
133
  return variable_map.get(variable).value()
@@ -8,7 +8,7 @@ from devsecops_engine_tools.engine_utilities.github.models.GithubPredefinedVaria
8
8
  ReleaseVariables,
9
9
  AgentVariables,
10
10
  VMVariables,
11
- ApplicationVariables
11
+ CustomVariables
12
12
  )
13
13
  from devsecops_engine_tools.engine_utilities.github.infrastructure.github_api import (
14
14
  GithubApi,
@@ -54,7 +54,7 @@ class GithubActions(DevopsPlatformGateway):
54
54
  return results.get(type)
55
55
 
56
56
  def get_source_code_management_uri(self):
57
- return f"{SystemVariables.github_server_url.value()}/{SystemVariables.github_repository.value()}"
57
+ return f"{SystemVariables.github_server_url.value()}/{self.get_variable('repository')}"
58
58
 
59
59
  def get_base_compact_remote_config_url(self, remote_config_repo):
60
60
  github_repository = SystemVariables.github_repository.value()
@@ -78,11 +78,19 @@ class GithubActions(DevopsPlatformGateway):
78
78
  "access_token": SystemVariables.github_access_token,
79
79
  "organization": f"{SystemVariables.github_server_url}/{SystemVariables.github_repository}",
80
80
  "project_name": SystemVariables.github_repository,
81
- "repository": BuildVariables.github_repository,
81
+ "repository": (
82
+ CustomVariables.Repository_Name
83
+ if CustomVariables.Repository_Name.value()
84
+ else BuildVariables.github_repository
85
+ ),
82
86
  "pipeline_name": (
83
- BuildVariables.github_workflow
84
- if SystemVariables.github_job.value() == "build"
85
- else ReleaseVariables.github_workflow
87
+ CustomVariables.Pipeline_Name
88
+ if CustomVariables.Pipeline_Name.value()
89
+ else (
90
+ BuildVariables.github_workflow
91
+ if SystemVariables.github_job.value() == "build"
92
+ else ReleaseVariables.github_workflow
93
+ )
86
94
  ),
87
95
  "stage": SystemVariables.github_job,
88
96
  "path_directory": SystemVariables.github_workspace,
@@ -95,7 +103,7 @@ class GithubActions(DevopsPlatformGateway):
95
103
  "vm_product_type_name": VMVariables.Vm_Product_Type_Name,
96
104
  "vm_product_name": VMVariables.Vm_Product_Name,
97
105
  "vm_product_description": VMVariables.Vm_Product_Description,
98
- "build_task": ApplicationVariables.Application_Build_Task,
106
+ "build_task": CustomVariables.Build_Task,
99
107
  }
100
108
  try:
101
109
  return variable_map.get(variable).value()
@@ -194,7 +194,7 @@ class CodeScan:
194
194
  dict_args["folder_path"],
195
195
  pull_request_files,
196
196
  self.devops_platform_gateway.get_variable("path_directory"),
197
- dict_args.get("repo_name", False) if dict_args.get("repo_name", False) else self.devops_platform_gateway.get_variable("repository"),
197
+ self.devops_platform_gateway.get_variable("repository"),
198
198
  config_tool,
199
199
  )
200
200
 
@@ -10,7 +10,11 @@ class EnvVariables:
10
10
  @staticmethod
11
11
  def get_value(env_name):
12
12
  env_var = os.environ.get(env_name)
13
- if env_var is None:
13
+ is_env_var_none = env_var is None
14
+ if env_name in ("CUSTOM_REPOSITORY_NAME", "CUSTOM_PIPELINE_NAME") and is_env_var_none:
15
+ return None
16
+
17
+ if is_env_var_none:
14
18
  raise ValueError(f"La variable de entorno {env_name} no está definida")
15
19
  return env_var
16
20
 
@@ -69,5 +73,7 @@ class VMVariables(BaseEnum):
69
73
  Vm_Product_Name = "Vm.Product.Name"
70
74
  Vm_Product_Description = "Vm.Product.Description"
71
75
 
72
- class ApplicationVariables(BaseEnum):
73
- Application_Build_Task = "BUILDTASK"
76
+ class CustomVariables(BaseEnum):
77
+ Build_Task = "BUILDTASK"
78
+ Pipeline_Name = "Custom.Pipeline.Name"
79
+ Repository_Name = "Custom.Repository.Name"
@@ -7,7 +7,11 @@ class EnvVariables:
7
7
  @staticmethod
8
8
  def get_value(env_name):
9
9
  env_var = os.environ.get(env_name)
10
- if env_var is None:
10
+ is_env_var_none = env_var is None
11
+ if env_name in ("CUSTOM_REPOSITORY_NAME", "CUSTOM_PIPELINE_NAME") and is_env_var_none:
12
+ return None
13
+
14
+ if is_env_var_none:
11
15
  raise ValueError(f"La variable de entorno {env_name} no está definida")
12
16
  return env_var
13
17
 
@@ -61,5 +65,7 @@ class VMVariables(BaseEnum):
61
65
  Vm_Product_Name = "Vm.Product.Name"
62
66
  Vm_Product_Description = "Vm.Product.Description"
63
67
 
64
- class ApplicationVariables(BaseEnum):
65
- Application_Build_Task = "BUILDTASK"
68
+ class CustomVariables(BaseEnum):
69
+ Build_Task = "BUILDTASK"
70
+ Pipeline_Name = "Custom.Pipeline.Name"
71
+ Repository_Name = "Custom.Repository.Name"
@@ -1 +1 @@
1
- version = '1.108.0'
1
+ version = '1.109.0'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: devsecops-engine-tools
3
- Version: 1.108.0
3
+ Version: 1.109.0
4
4
  Summary: Tool for DevSecOps strategy
5
5
  Home-page: https://github.com/bancolombia/devsecops-engine-tools
6
6
  Author: Bancolombia DevSecOps Team
@@ -1,9 +1,9 @@
1
1
  devsecops_engine_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- devsecops_engine_tools/version.py,sha256=2xLJEOyAFRaBObPOQ9ahgsePcZmOhV8PVIAkoya9oYA,20
2
+ devsecops_engine_tools/version.py,sha256=tAfSEwSRwyWossC1Y97v28hMSXPsjlB7NH86R7b9OvU,20
3
3
  devsecops_engine_tools/engine_core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  devsecops_engine_tools/engine_core/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  devsecops_engine_tools/engine_core/src/applications/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- devsecops_engine_tools/engine_core/src/applications/runner_engine_core.py,sha256=JO7DltDesmc4r5Q1272OHbIYVfC-gD6C043Qy-GkKac,11416
6
+ devsecops_engine_tools/engine_core/src/applications/runner_engine_core.py,sha256=fQ499sWSKQO1LItepJZxX0ChXlxbhaN-hCjj-8qqy64,11142
7
7
  devsecops_engine_tools/engine_core/src/deployment/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  devsecops_engine_tools/engine_core/src/deployment/infrastructure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  devsecops_engine_tools/engine_core/src/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -36,13 +36,13 @@ devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/aws/__init
36
36
  devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/aws/s3_manager.py,sha256=G5RFUFXMmDFJfqJnbeGQPkHO0u01KMFU0pfGRINlgLI,7313
37
37
  devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/aws/secrets_manager.py,sha256=ELihQBgSPH4f9QCyg2dgjudsFitaqgdsljnVOmaA_v4,1972
38
38
  devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/azure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
- devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/azure/azure_devops.py,sha256=-3KUPxlzBoxJarj8ZY8w84UffuedtBnj3z4r9UW7nFQ,6027
39
+ devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/azure/azure_devops.py,sha256=bbzonI501EUTM77uDZpvWeGqJoOaYq45Rw4dWpsTozY,6300
40
40
  devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/cdxgen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
41
  devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/cdxgen/cdxgen.py,sha256=e6LeBm1q5_Wq26-IZ9tG1eyoYOQ409BDr6XEsyKVL2E,5850
42
42
  devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/defect_dojo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
43
  devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/defect_dojo/defect_dojo.py,sha256=GXz-xBxptaZsQU8sR9OTcDAvdIygXmiLfmMIWhlC-hs,33105
44
44
  devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/github/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
45
- devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/github/github_actions.py,sha256=ed8ybPVNTAVS3UUlelnapMfpSoWJ-0X5aXQ54_wyiQo,4377
45
+ devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/github/github_actions.py,sha256=Mt3ejrNHhkk8HIhQunMDnSW8Sn-65-yyXHGrFpaN744,4649
46
46
  devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/printer_pretty_table/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
47
  devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/printer_pretty_table/printer_pretty_table.py,sha256=0p-7HTT6FtW5DpJyGAauYLM1Oso4hPgKLFnLqXNPjbo,5724
48
48
  devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/printer_rich_table/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -137,7 +137,7 @@ devsecops_engine_tools/engine_sast/engine_code/src/domain/model/config_tool.py,s
137
137
  devsecops_engine_tools/engine_sast/engine_code/src/domain/model/gateways/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
138
138
  devsecops_engine_tools/engine_sast/engine_code/src/domain/model/gateways/tool_gateway.py,sha256=JzHb2OQFisVkyB6j5N79_YSCWxg7S1O-vZ_BPh_f9cY,1043
139
139
  devsecops_engine_tools/engine_sast/engine_code/src/domain/usecases/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
140
- devsecops_engine_tools/engine_sast/engine_code/src/domain/usecases/code_scan.py,sha256=cd2Zd0BfJWBrsv9nnflwBtG2gig3bxF8VmIrdooOUUI,9242
140
+ devsecops_engine_tools/engine_sast/engine_code/src/domain/usecases/code_scan.py,sha256=9NawyCXOlPfvekiyrBmCQTE-5FkJymzo7E1cud6bMfw,9166
141
141
  devsecops_engine_tools/engine_sast/engine_code/src/infrastructure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
142
142
  devsecops_engine_tools/engine_sast/engine_code/src/infrastructure/driven_adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
143
143
  devsecops_engine_tools/engine_sast/engine_code/src/infrastructure/driven_adapters/bearer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -269,7 +269,7 @@ devsecops_engine_tools/engine_utilities/azuredevops/__init__.py,sha256=47DEQpj8H
269
269
  devsecops_engine_tools/engine_utilities/azuredevops/infrastructure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
270
270
  devsecops_engine_tools/engine_utilities/azuredevops/infrastructure/azure_devops_api.py,sha256=l_sRaktn51NEeJowtEJWfUnUmjaU9uRTqXo4jcNR24E,2968
271
271
  devsecops_engine_tools/engine_utilities/azuredevops/models/AzureMessageLoggingPipeline.py,sha256=pCwlPDDl-hgvZ9gvceuC8GsKbsMhRm3ykhFFVByVqcI,664
272
- devsecops_engine_tools/engine_utilities/azuredevops/models/AzurePredefinedVariables.py,sha256=NHBnUhdrqXKiFTWx6TpNeYwqBOno4lnYJAkMHpJcduw,2640
272
+ devsecops_engine_tools/engine_utilities/azuredevops/models/AzurePredefinedVariables.py,sha256=fFHnu0XtLZ-LY4-3Y3RCuMYat5DaqGQy7fqd2Bwh3Fc,2888
273
273
  devsecops_engine_tools/engine_utilities/azuredevops/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
274
274
  devsecops_engine_tools/engine_utilities/copacetic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
275
275
  devsecops_engine_tools/engine_utilities/copacetic/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -342,7 +342,7 @@ devsecops_engine_tools/engine_utilities/git_cli/model/gateway/git_gateway.py,sha
342
342
  devsecops_engine_tools/engine_utilities/github/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
343
343
  devsecops_engine_tools/engine_utilities/github/infrastructure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
344
344
  devsecops_engine_tools/engine_utilities/github/infrastructure/github_api.py,sha256=8MYp5Gs8SrZI5TAkDnM4tlvkUeq8yoDvuzW_UxdGKw4,3005
345
- devsecops_engine_tools/engine_utilities/github/models/GithubPredefinedVariables.py,sha256=T6MjC2a9sUJ_V0OrrVUiiePJBOS891yxWOaoT8GLxJg,1843
345
+ devsecops_engine_tools/engine_utilities/github/models/GithubPredefinedVariables.py,sha256=B2NEa0aELeQV2YLqUlv6CQmlIYHhKWBcqLcADmOtTik,2092
346
346
  devsecops_engine_tools/engine_utilities/github/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
347
347
  devsecops_engine_tools/engine_utilities/input_validations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
348
348
  devsecops_engine_tools/engine_utilities/input_validations/env_utils.py,sha256=nHp9YIuG1k-IvxssQslrE9ny62juJMovmBTzcM7PPk0,258
@@ -383,8 +383,8 @@ devsecops_engine_tools/engine_utilities/utils/name_conversion.py,sha256=ADJrRGax
383
383
  devsecops_engine_tools/engine_utilities/utils/printers.py,sha256=amYAr9YQfYgR6jK9a2l26z3oovFPQ3FAKmhq6BKhEBA,623
384
384
  devsecops_engine_tools/engine_utilities/utils/session_manager.py,sha256=Z0fdhB3r-dxU0nGSD9zW_B4r2Qol1rUnUCkhFR0U-HQ,487
385
385
  devsecops_engine_tools/engine_utilities/utils/utils.py,sha256=HCjS900TBoNcHrC4LaiP-Kf9frVdtagF130qOUgnO2M,6757
386
- devsecops_engine_tools-1.108.0.dist-info/METADATA,sha256=07uUw3S0icGRSL9W0WPfDvaEkIvPAQVMfCPS2mVripc,3233
387
- devsecops_engine_tools-1.108.0.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
388
- devsecops_engine_tools-1.108.0.dist-info/entry_points.txt,sha256=OWAww5aBsGeMv0kWhSgVNB0ySKKpYuJd4dly0ikFPkc,283
389
- devsecops_engine_tools-1.108.0.dist-info/top_level.txt,sha256=ge6y0X_xBAU1aG3EMWFtl9djbVyg5BxuSp2r2Lg6EQU,23
390
- devsecops_engine_tools-1.108.0.dist-info/RECORD,,
386
+ devsecops_engine_tools-1.109.0.dist-info/METADATA,sha256=EHTtxx_ukyT892LBlMFafWhRE02RbLkXJ8V6FZBYpCo,3233
387
+ devsecops_engine_tools-1.109.0.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
388
+ devsecops_engine_tools-1.109.0.dist-info/entry_points.txt,sha256=OWAww5aBsGeMv0kWhSgVNB0ySKKpYuJd4dly0ikFPkc,283
389
+ devsecops_engine_tools-1.109.0.dist-info/top_level.txt,sha256=ge6y0X_xBAU1aG3EMWFtl9djbVyg5BxuSp2r2Lg6EQU,23
390
+ devsecops_engine_tools-1.109.0.dist-info/RECORD,,