From b68b8e3ac5c080fcdec0476821d2d2bc7d8d7570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20T=C3=A9tard?= Date: Fri, 21 Jul 2023 15:52:43 +0200 Subject: [PATCH] chore: s/SEKOIA.IO/Sekoia.io/ --- CHANGELOG.md | 6 +++--- LICENSE | 2 +- README.md | 4 ++-- pyproject.toml | 7 +++---- sekoia_automation/cli.py | 4 ++-- sekoia_automation/module.py | 4 ++-- sekoia_automation/scripts/documentation/generate.py | 4 ++-- sekoia_automation/trigger.py | 4 ++-- tests/data/documentation/mkdocs.yml | 8 ++++---- .../sample_module/trigger_sekoiaio_alert_created.json | 2 +- tests/test_cli.py | 10 +++++----- 11 files changed, 27 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c20a38d..6e67127 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,7 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - In `synchronize-lib` script: - Specify the registry in the image name - - Improve checking the existence of the image in the registry + - Improve checking the existence of the image in the registry ## [1.3.1] - 2023-06-08 @@ -75,7 +75,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Fix secret handling for `BaseModel` module configurations +- Fix secret handling for `BaseModel` module configurations ## [1.2.0] - 2023-05-10 @@ -117,7 +117,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Don't retry requests to SEKOIA.IO with a status code of 4xx and ignore 409 errors +- Don't retry requests to Sekoia.io with a status code of 4xx and ignore 409 errors ### Fixed diff --git a/LICENSE b/LICENSE index 1c94b7c..7470214 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 SEKOIA.IO +Copyright (c) 2023 Sekoia.io Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 386027b..be8da1e 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# SEKOIA.IO Automation Python SDK +# Sekoia.io Automation Python SDK [![CI](https://github.com/SEKOIA-IO/sekoia-automation-sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/SEKOIA-IO/sekoia-automation-sdk/actions/workflows/ci.yml) [![codecov](https://codecov.io/github/SEKOIA-IO/sekoia-automation-sdk/branch/main/badge.svg?token=13S5Q0WFRQ)](https://codecov.io/github/SEKOIA-IO/sekoia-automation-sdk) [![pypi](https://img.shields.io/pypi/v/sekoia-automation-sdk?color=%2334D058&label=pypi%20package)](https://pypi.org/project/sekoia-automation-sdk/) [![pypi](https://img.shields.io/pypi/pyversions/sekoia-automation-sdk?color=%2334D058&label=Python)](https://pypi.org/project/sekoia-automation-sdk/) -SDK to create SEKOIA.IO playbook modules. +SDK to create Sekoia.io playbook modules. Modules can define: diff --git a/pyproject.toml b/pyproject.toml index 2f5552a..222a4de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,17 +6,17 @@ build-backend = "poetry.core.masonry.api" name = "sekoia-automation-sdk" version = "1.3.8" -description = "SDK to create SEKOIA.IO playbook modules" +description = "SDK to create Sekoia.io playbook modules" license = "MIT" readme = "README.md" -authors = ["SEKOIA.IO"] +authors = ["Sekoia.io"] packages = [ { include = "sekoia_automation" }, ] homepage = "https://sekoia.io/" repository = "https://github.com/SEKOIA-IO/sekoia-automation-sdk" documentation = "https://docs.sekoia.io/" -keywords = ["SDK", "SEKOIA.IO", "automation", "playbook"] +keywords = ["SDK", "Sekoia.io", "automation", "playbook"] classifiers = [ "License :: OSI Approved :: MIT License", "Natural Language :: English", @@ -84,4 +84,3 @@ ignore_missing_imports = true show_column_numbers = true exclude = "sekoia_automation/scripts/new_module/template/" disable_error_code = "annotation-unchecked" - diff --git a/sekoia_automation/cli.py b/sekoia_automation/cli.py index 683f86a..74fe824 100644 --- a/sekoia_automation/cli.py +++ b/sekoia_automation/cli.py @@ -14,7 +14,7 @@ from sekoia_automation.scripts.update_sdk_version import SDKUpdater app = typer.Typer( - help="SEKOIA.IO's automation helper to generate playbook modules", + help="Sekoia.io's automation helper to generate playbook modules", rich_markup_mode="markdown", ) OptionalPath = Optional[Path] # noqa: UP007 @@ -111,7 +111,7 @@ def generate_documentation( Generate modules documentation. This script generates modules documentation and add it to - SEKOIA.IO's documentation repository. + Sekoia.io's documentation repository. If a module is provided only the documentation for this module will be generated """ diff --git a/sekoia_automation/module.py b/sekoia_automation/module.py index cce8c3d..ff21837 100644 --- a/sekoia_automation/module.py +++ b/sekoia_automation/module.py @@ -398,14 +398,14 @@ def _send_request(self, data: dict, verb: str = "POST", attempt=1) -> Response: else 500 ) raise SendEventError( - "Impossible to send event to SEKOIA.IO API", status_code=status_code + "Impossible to send event to Sekoia.io API", status_code=status_code ) if ( isinstance(exception.response, Response) and 400 <= exception.response.status_code < 500 ): raise SendEventError( - "Impossible to send event to SEKOIA.IO API", + "Impossible to send event to Sekoia.io API", status_code=exception.response.status_code, ) return self._send_request(data, verb, attempt + 1) diff --git a/sekoia_automation/scripts/documentation/generate.py b/sekoia_automation/scripts/documentation/generate.py index bf732fe..4ebd17f 100644 --- a/sekoia_automation/scripts/documentation/generate.py +++ b/sekoia_automation/scripts/documentation/generate.py @@ -164,8 +164,8 @@ def _update_documentation_menu(self, modules: list[DocumentationModule]): mkdocs_conf = yaml.safe_load(fd) root_menu_items = { - f"SEKOIA.IO XDR/{self.MKDOCS_SUB_NAV}": "xdr/features/automate/library", - f"SEKOIA.IO TIP/{self.MKDOCS_SUB_NAV}": "tip/features/automate/library", + f"Sekoia.io XDR/{self.MKDOCS_SUB_NAV}": "xdr/features/automate/library", + f"Sekoia.io TIP/{self.MKDOCS_SUB_NAV}": "tip/features/automate/library", } append_only = True if self.module else False for root, directory in root_menu_items.items(): diff --git a/sekoia_automation/trigger.py b/sekoia_automation/trigger.py index 8fcccd2..bc42a64 100644 --- a/sekoia_automation/trigger.py +++ b/sekoia_automation/trigger.py @@ -197,7 +197,7 @@ def send_normalized_event( directory: str | None = None, remove_directory: bool = False, ): - """Send a normalized event to SEKOIA.IO so that it triggers a playbook run.""" + """Send a normalized event to Sekoia.io so that it triggers a playbook run.""" # Reset the consecutive error count self._error_count = 0 self._last_events_time = datetime.utcnow() @@ -216,7 +216,7 @@ def send_event( directory: str | None = None, remove_directory: bool = False, ): - """Send an event to SEKOIA.IO so that it triggers playbook runs. + """Send an event to Sekoia.io so that it triggers playbook runs. Makes sure `results_model` is used to validate/coerce the event if present """ diff --git a/tests/data/documentation/mkdocs.yml b/tests/data/documentation/mkdocs.yml index 35d2ff8..08a60bb 100644 --- a/tests/data/documentation/mkdocs.yml +++ b/tests/data/documentation/mkdocs.yml @@ -1,12 +1,12 @@ nav: -- SEKOIA.IO XDR: +- Sekoia.io XDR: - Features: - Automate: - Actions Library: - - SEKOIA.IO: xdr/features/automate/library/sekoia-io.md -- SEKOIA.IO TIP: + - Sekoia.io: xdr/features/automate/library/sekoia-io.md +- Sekoia.io TIP: - Features: - Automate: - Actions Library: - - SEKOIA.IO: tip/features/automate/library/sekoia-io.md + - Sekoia.io: tip/features/automate/library/sekoia-io.md site_name: Test diff --git a/tests/data/sample_module/trigger_sekoiaio_alert_created.json b/tests/data/sample_module/trigger_sekoiaio_alert_created.json index 01afa11..5fe5939 100644 --- a/tests/data/sample_module/trigger_sekoiaio_alert_created.json +++ b/tests/data/sample_module/trigger_sekoiaio_alert_created.json @@ -21,7 +21,7 @@ "type": "string" }, "event_type": { - "description": "Action that triggered this SEKOIA.IO Alert notification (could be for example “alert-created”, “alert-status-changed”, etc.)", + "description": "Action that triggered this Sekoia.io Alert notification (could be for example “alert-created”, “alert-status-changed”, etc.)", "type": "string" }, "alert_uuid": { diff --git a/tests/test_cli.py b/tests/test_cli.py index 2e25ec3..1783981 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -94,13 +94,13 @@ def test_generate_documentation(tmp_path): manifest = yaml.load(fp, Loader=Loader) assert ( - manifest["nav"][0]["SEKOIA.IO XDR"][0]["Features"][0]["Automate"][0][ + manifest["nav"][0]["Sekoia.io XDR"][0]["Features"][0]["Automate"][0][ "Actions Library" ][0]["Test Module"] == "xdr/features/automate/library/test-module.md" ) assert ( - manifest["nav"][1]["SEKOIA.IO TIP"][0]["Features"][0]["Automate"][0][ + manifest["nav"][1]["Sekoia.io TIP"][0]["Features"][0]["Automate"][0][ "Actions Library" ][0]["Test Module"] == "tip/features/automate/library/test-module.md" @@ -136,14 +136,14 @@ def test_generate_documentation_specific_module(tmp_path): # Make sure we didn't remove other modules assert ( - manifest["nav"][0]["SEKOIA.IO XDR"][0]["Features"][0]["Automate"][0][ + manifest["nav"][0]["Sekoia.io XDR"][0]["Features"][0]["Automate"][0][ "Actions Library" - ][0]["SEKOIA.IO"] + ][0]["Sekoia.io"] == "xdr/features/automate/library/sekoia-io.md" ) # And our module has been added assert ( - manifest["nav"][0]["SEKOIA.IO XDR"][0]["Features"][0]["Automate"][0][ + manifest["nav"][0]["Sekoia.io XDR"][0]["Features"][0]["Automate"][0][ "Actions Library" ][1]["Test Module"] == "xdr/features/automate/library/test-module.md"