diff --git a/packages/integration_testing/pyproject.toml b/packages/integration_testing/pyproject.toml index 19be97204..407034418 100644 --- a/packages/integration_testing/pyproject.toml +++ b/packages/integration_testing/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "integration-testing" -version = "2.3.5" +version = "2.3.7" description = "Blackbox testing infrastructure to test and run marketplace integration scripts locally using mocks." readme = "README.md" authors = [ @@ -48,7 +48,7 @@ testpaths = [ ] [tool.uv.sources] -tipcommon = { path = "../tipcommon/whls/TIPCommon-2.3.5-py3-none-any.whl" } +tipcommon = { path = "../tipcommon/whls/TIPCommon-2.3.7-py3-none-any.whl" } environmentcommon = { path = "../envcommon/whls/EnvironmentCommon-1.0.2-py2.py3-none-any.whl" } soar-sdk = { git = "https://github.com/chronicle/soar-sdk.git" } diff --git a/packages/integration_testing/uv.lock b/packages/integration_testing/uv.lock index 4489834f7..386bcada4 100644 --- a/packages/integration_testing/uv.lock +++ b/packages/integration_testing/uv.lock @@ -395,7 +395,7 @@ wheels = [ [[package]] name = "integration-testing" -version = "2.3.5" +version = "2.3.7" source = { editable = "." } dependencies = [ { name = "aiohttp" }, @@ -424,7 +424,7 @@ requires-dist = [ { name = "pyyaml", specifier = ">=6.0.2" }, { name = "requests", specifier = ">=2.32.3" }, { name = "soar-sdk", git = "https://github.com/chronicle/soar-sdk.git" }, - { name = "tipcommon", path = "../tipcommon/whls/TIPCommon-2.3.5-py3-none-any.whl" }, + { name = "tipcommon", path = "../tipcommon/whls/TIPCommon-2.3.7-py3-none-any.whl" }, { name = "yarl", specifier = ">=1.20.1" }, ] @@ -773,8 +773,8 @@ dependencies = [ [[package]] name = "tipcommon" -version = "2.3.5" -source = { path = "../tipcommon/whls/TIPCommon-2.3.5-py3-none-any.whl" } +version = "2.3.7" +source = { path = "../tipcommon/whls/TIPCommon-2.3.7-py3-none-any.whl" } dependencies = [ { name = "google-api-python-client" }, { name = "google-auth" }, @@ -786,7 +786,7 @@ dependencies = [ { name = "requests-toolbelt" }, ] wheels = [ - { filename = "tipcommon-2.3.5-py3-none-any.whl", hash = "sha256:c30c13dcec152d271d198e54801bf42e76e87ecfc4b3ba57544bec021f143e9f" }, + { filename = "tipcommon-2.3.7-py3-none-any.whl", hash = "sha256:33da2646cf28bf01c05fef9cdff4deaeeb34326b5ab08cb74124888acb96117b" }, ] [package.metadata] diff --git a/packages/integration_testing_whls/integration_testing-2.3.7-py3-none-any.whl b/packages/integration_testing_whls/integration_testing-2.3.7-py3-none-any.whl new file mode 100644 index 000000000..773969b92 Binary files /dev/null and b/packages/integration_testing_whls/integration_testing-2.3.7-py3-none-any.whl differ diff --git a/packages/tipcommon/TIPCommon/pyproject.toml b/packages/tipcommon/TIPCommon/pyproject.toml index 043e8baeb..4a1246a36 100644 --- a/packages/tipcommon/TIPCommon/pyproject.toml +++ b/packages/tipcommon/TIPCommon/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "TIPCommon" -version = "2.3.5" +version = "2.3.7" description = "General Purpose CLI tool for Google SecOps Marketplace" readme = "README.md" authors = [ diff --git a/packages/tipcommon/TIPCommon/src/TIPCommon/rest/soar_api.py b/packages/tipcommon/TIPCommon/src/TIPCommon/rest/soar_api.py index d55e4af4e..782831d1b 100644 --- a/packages/tipcommon/TIPCommon/src/TIPCommon/rest/soar_api.py +++ b/packages/tipcommon/TIPCommon/src/TIPCommon/rest/soar_api.py @@ -958,6 +958,64 @@ def resume_alert_sla( validate_response(response, validate_json=False) +def resume_case_alerts_sla( + chronicle_soar: ChronicleSOAR, + case_id: int, + alert_identifiers: list[str], + message: str, +) -> tuple[list[str], list[str]]: + """Resume alert SLA for multiple alerts in a case. + + Args: + chronicle_soar: A chronicle soar SDK object. + case_id: Chronicle SOAR case ID. + alert_identifiers: List of Chronicle SOAR Alert Identifiers. + message: Chronicle SOAR message. + Returns: + Success and failed alert identifiers. + """ + success_alerts = [] + failed_alerts = [] + for alert_identifier in alert_identifiers: + try: + resume_alert_sla(chronicle_soar, case_id, alert_identifier, message) + success_alerts.append(alert_identifier) + except Exception as e: + chronicle_soar.LOGGER.error(f"Failed to resume SLA for alert {alert_identifier}: {e}") + failed_alerts.append(alert_identifier) + + return success_alerts, failed_alerts + + +def pause_case_alerts_sla( + chronicle_soar: ChronicleSOAR, + case_id: int, + alert_identifiers: list[str], + message: str, +) -> tuple[list[str], list[str]]: + """Pause alert SLA for multiple alerts in a case. + + Args: + chronicle_soar: A chronicle soar SDK object. + case_id: Chronicle SOAR case ID. + alert_identifiers: List of Chronicle SOAR Alert Identifiers. + message: Chronicle SOAR message. + Returns: + Success and failed alert identifiers. + """ + success_alerts = [] + failed_alerts = [] + for alert_identifier in alert_identifiers: + try: + pause_alert_sla(chronicle_soar, case_id, alert_identifier, message) + success_alerts.append(alert_identifier) + except Exception as e: + chronicle_soar.LOGGER.error(f"Failed to pause SLA for alert {alert_identifier}: {e}") + failed_alerts.append(alert_identifier) + + return success_alerts, failed_alerts + + def change_case_description( chronicle_soar: ChronicleSOAR, case_id: int, diff --git a/packages/tipcommon/TIPCommon/uv.lock b/packages/tipcommon/TIPCommon/uv.lock index e3cfce573..f665ff9c6 100644 --- a/packages/tipcommon/TIPCommon/uv.lock +++ b/packages/tipcommon/TIPCommon/uv.lock @@ -413,7 +413,7 @@ wheels = [ [[package]] name = "tipcommon" -version = "2.3.5" +version = "2.3.7" source = { editable = "." } dependencies = [ { name = "google-api-python-client" }, diff --git a/packages/tipcommon/whls/TIPCommon-2.3.7-py3-none-any.whl b/packages/tipcommon/whls/TIPCommon-2.3.7-py3-none-any.whl new file mode 100644 index 000000000..6c7eaffb9 Binary files /dev/null and b/packages/tipcommon/whls/TIPCommon-2.3.7-py3-none-any.whl differ