From 643a24c57970a40cdb76df716d3c77621e413f95 Mon Sep 17 00:00:00 2001 From: Antonio Date: Fri, 12 Apr 2024 14:12:23 +0200 Subject: [PATCH] fix(#5197): Fixing provision logs --- deployability/modules/__init__.py | 1 + .../modules/allocation/generic/__init__.py | 1 + .../modules/allocation/generic/utils.py | 4 ++-- deployability/modules/generic/__init__.py | 1 + deployability/modules/generic/ansible.py | 1 + .../modules/generic/logger/__init__.py | 1 + .../modules/generic/logger/config.yaml | 3 ++- .../modules/generic/logger/filters.py | 1 + deployability/modules/generic/logger/logger.py | 1 + deployability/modules/generic/logger/utils.py | 1 + deployability/modules/generic/models.py | 1 + deployability/modules/generic/parser.py | 1 + deployability/modules/generic/utils.py | 1 + deployability/modules/provision/__init__.py | 4 ++++ deployability/modules/provision/actions.py | 9 +++++---- deployability/modules/provision/handler.py | 1 + deployability/modules/provision/main.py | 8 ++++++-- deployability/modules/provision/models.py | 1 + deployability/modules/provision/provision.py | 14 +++++++------- .../modules/provision/tests/conftest.py | 5 +++-- .../modules/provision/tests/test_actions.py | 9 +++++---- .../modules/provision/tests/test_handler.py | 5 +++-- .../modules/provision/tests/test_models.py | 3 ++- .../modules/provision/tests/test_provision.py | 5 +++-- deployability/modules/provision/utils.py | 3 ++- deployability/modules/setup.py | 1 + deployability/modules/testing/models.py | 1 + deployability/modules/testing/testing.py | 1 - .../modules/testing/tests/helpers/agent.py | 1 + .../testing/tests/helpers/logger/config.yaml | 2 +- .../testing/tests/helpers/logger/logger.py | 3 +-- .../modules/testing/tests/helpers/manager.py | 1 - deployability/modules/testing/utils.py | 2 +- .../modules/workflow_engine/__init__.py | 1 + .../modules/workflow_engine/__main__.py | 1 + .../modules/workflow_engine/examples/test.yaml | 18 +++++++++--------- .../modules/workflow_engine/logger/config.yaml | 3 ++- .../modules/workflow_engine/logger/filter.py | 1 + .../modules/workflow_engine/logger/logger.py | 1 + .../modules/workflow_engine/models.py | 1 + .../workflow_engine/schema_validator.py | 1 + deployability/modules/workflow_engine/task.py | 1 + .../workflow_engine/workflow_processor.py | 1 + 43 files changed, 82 insertions(+), 44 deletions(-) create mode 100644 deployability/modules/generic/logger/utils.py diff --git a/deployability/modules/__init__.py b/deployability/modules/__init__.py index a9b660ce80..421b2d2695 100755 --- a/deployability/modules/__init__.py +++ b/deployability/modules/__init__.py @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + from .provision import Provision from .generic import Ansible from .allocation import Allocator diff --git a/deployability/modules/allocation/generic/__init__.py b/deployability/modules/allocation/generic/__init__.py index c4235dc043..f349a87320 100644 --- a/deployability/modules/allocation/generic/__init__.py +++ b/deployability/modules/allocation/generic/__init__.py @@ -5,3 +5,4 @@ from .credentials import Credentials from .instance import Instance from .provider import Provider +from ...generic.logger import Logger \ No newline at end of file diff --git a/deployability/modules/allocation/generic/utils.py b/deployability/modules/allocation/generic/utils.py index 846adf4292..307c8cff8c 100644 --- a/deployability/modules/allocation/generic/utils.py +++ b/deployability/modules/allocation/generic/utils.py @@ -2,6 +2,6 @@ # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 -from modules.generic.logger import Logger +from modules.generic.logger.logger import Logger -logger = Logger("allocator").get_logger() +logger = Logger("allocation-module").get_logger() diff --git a/deployability/modules/generic/__init__.py b/deployability/modules/generic/__init__.py index 4270eb1f8f..60a72a4a6a 100755 --- a/deployability/modules/generic/__init__.py +++ b/deployability/modules/generic/__init__.py @@ -1,4 +1,5 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + from .ansible import Ansible, Inventory diff --git a/deployability/modules/generic/ansible.py b/deployability/modules/generic/ansible.py index 6eaf083418..6aa9d2e2c5 100755 --- a/deployability/modules/generic/ansible.py +++ b/deployability/modules/generic/ansible.py @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + import ansible_runner import jinja2 import yaml diff --git a/deployability/modules/generic/logger/__init__.py b/deployability/modules/generic/logger/__init__.py index 842ae40bc7..0c527ac85d 100644 --- a/deployability/modules/generic/logger/__init__.py +++ b/deployability/modules/generic/logger/__init__.py @@ -1,4 +1,5 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + from .logger import Logger diff --git a/deployability/modules/generic/logger/config.yaml b/deployability/modules/generic/logger/config.yaml index 1f86bf764a..7eb01360d9 100644 --- a/deployability/modules/generic/logger/config.yaml +++ b/deployability/modules/generic/logger/config.yaml @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + version: 1 formatters: simple: @@ -23,7 +24,7 @@ handlers: class: logging.FileHandler level: DEBUG formatter: simple - filename: /tmp/workflow.log + filename: /tmp/workflow2.log filters: [uppercase] root: level: DEBUG diff --git a/deployability/modules/generic/logger/filters.py b/deployability/modules/generic/logger/filters.py index bcaa06dfb3..ff445e0394 100644 --- a/deployability/modules/generic/logger/filters.py +++ b/deployability/modules/generic/logger/filters.py @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + import logging diff --git a/deployability/modules/generic/logger/logger.py b/deployability/modules/generic/logger/logger.py index 373df019b5..80744b929b 100644 --- a/deployability/modules/generic/logger/logger.py +++ b/deployability/modules/generic/logger/logger.py @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + import logging import logging.config import yaml diff --git a/deployability/modules/generic/logger/utils.py b/deployability/modules/generic/logger/utils.py new file mode 100644 index 0000000000..92a2f16c39 --- /dev/null +++ b/deployability/modules/generic/logger/utils.py @@ -0,0 +1 @@ +from .logger import Logger diff --git a/deployability/modules/generic/models.py b/deployability/modules/generic/models.py index 754087e11a..4f8b45b19d 100644 --- a/deployability/modules/generic/models.py +++ b/deployability/modules/generic/models.py @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + from pydantic import BaseModel, IPvAnyAddress diff --git a/deployability/modules/generic/parser.py b/deployability/modules/generic/parser.py index 1fa779df73..86ed016c58 100755 --- a/deployability/modules/generic/parser.py +++ b/deployability/modules/generic/parser.py @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + from argparse import ArgumentParser from pydantic import BaseModel diff --git a/deployability/modules/generic/utils.py b/deployability/modules/generic/utils.py index 80d5c04a82..75a4ecbad4 100644 --- a/deployability/modules/generic/utils.py +++ b/deployability/modules/generic/utils.py @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + import os import yaml diff --git a/deployability/modules/provision/__init__.py b/deployability/modules/provision/__init__.py index 586e4257bf..d5792d46c0 100755 --- a/deployability/modules/provision/__init__.py +++ b/deployability/modules/provision/__init__.py @@ -1,4 +1,8 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + +from .actions import Action +from .handler import ProvisionHandler +from .models import InputPayload, InputPayload from .provision import Provision diff --git a/deployability/modules/provision/actions.py b/deployability/modules/provision/actions.py index f6032c5c56..36a8f3368a 100644 --- a/deployability/modules/provision/actions.py +++ b/deployability/modules/provision/actions.py @@ -1,11 +1,12 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 -from modules.generic import Ansible -from modules.provision.handler import ProvisionHandler -from modules.provision.models import ComponentInfo -from modules.provision.utils import logger +from ..generic import Ansible + +from .handler import ProvisionHandler +from .models import ComponentInfo +from .utils import logger class Action: diff --git a/deployability/modules/provision/handler.py b/deployability/modules/provision/handler.py index 1f39e13b0c..6df4e2c835 100644 --- a/deployability/modules/provision/handler.py +++ b/deployability/modules/provision/handler.py @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + from pathlib import Path from modules.provision.models import ComponentInfo diff --git a/deployability/modules/provision/main.py b/deployability/modules/provision/main.py index 9d9e43419a..1503e5641d 100755 --- a/deployability/modules/provision/main.py +++ b/deployability/modules/provision/main.py @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + import argparse import os import sys @@ -9,9 +10,11 @@ sys.path.append(project_root) from modules.provision import Provision, models +from modules.generic.logger.logger import Logger -# ---------------- Methods --------------------- +logger = Logger('provision-module').get_logger() +# ---------------- Methods --------------------- def parse_arguments(): parser = argparse.ArgumentParser( @@ -24,8 +27,9 @@ def parse_arguments(): if __name__ == "__main__": + logger.info(f'Initiating provisionment.') try: provision = Provision(models.InputPayload(**vars(parse_arguments()))) provision.run() except Exception as e: - sys.exit(f"Error while provisioning: {e}") + logger.error(f"Error while provisioning: {e}") diff --git a/deployability/modules/provision/models.py b/deployability/modules/provision/models.py index e80e9b4271..6931e525bc 100755 --- a/deployability/modules/provision/models.py +++ b/deployability/modules/provision/models.py @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + from pathlib import Path from typing import List, Union from pydantic import BaseModel, validator, model_validator diff --git a/deployability/modules/provision/provision.py b/deployability/modules/provision/provision.py index 8019a3c454..2556b8f482 100755 --- a/deployability/modules/provision/provision.py +++ b/deployability/modules/provision/provision.py @@ -1,17 +1,18 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 -from pathlib import Path -from modules.generic.utils import Utils -from modules.provision.actions import Action -from modules.provision.utils import logger -from modules.provision.models import InputPayload, ComponentInfo +from pathlib import Path +from ..generic.utils import Utils +from .actions import Action +from .models import InputPayload, ComponentInfo +from .utils import logger PATH_BASE_DIR = Path(__file__).parents[2] + class Provision: """ Provision class to install and uninstall components. @@ -35,12 +36,11 @@ def __init__(self, payload: InputPayload): self.components = self.get_components(payload) self.ansible_data = self.__load_ansible_data(payload.inventory) + def run(self) -> None: """ Run the provision. """ - logger.info(f'Initiating provisionment.') - logger.debug(f'Running action {self.action} for components: {self.components}') for component in self.components: try: diff --git a/deployability/modules/provision/tests/conftest.py b/deployability/modules/provision/tests/conftest.py index c4077be190..ba0fda2822 100644 --- a/deployability/modules/provision/tests/conftest.py +++ b/deployability/modules/provision/tests/conftest.py @@ -1,12 +1,13 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + """Common unit test fixtures.""" from unittest.mock import patch import pytest -from modules.provision.models import InputPayload -from modules.provision.provision import Provision +from ..models import InputPayload +from ..provision import Provision @pytest.fixture diff --git a/deployability/modules/provision/tests/test_actions.py b/deployability/modules/provision/tests/test_actions.py index 266a003db9..66afb19526 100644 --- a/deployability/modules/provision/tests/test_actions.py +++ b/deployability/modules/provision/tests/test_actions.py @@ -1,15 +1,16 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + """Unit Tests for the Action class""" from unittest.mock import patch, MagicMock, call import pytest -from modules.generic import Ansible -from modules.provision.actions import Action -from modules.provision.models import ComponentInfo -from modules.provision.handler import ProvisionHandler +from ...generic import Ansible +from ..actions import Action +from ..models import ComponentInfo +from ..handler import ProvisionHandler @pytest.mark.parametrize('action, component_type', diff --git a/deployability/modules/provision/tests/test_handler.py b/deployability/modules/provision/tests/test_handler.py index dd9d63d093..ced38d7cf5 100644 --- a/deployability/modules/provision/tests/test_handler.py +++ b/deployability/modules/provision/tests/test_handler.py @@ -1,12 +1,13 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + """Unit Tests for the ProvisionHandler class.""" from unittest.mock import patch, MagicMock import pytest -from modules.provision.handler import ProvisionHandler -from modules.provision.models import ComponentInfo +from ..handler import ProvisionHandler +from ..models import ComponentInfo @pytest.mark.parametrize('component, action, method', [('wazuh-manager', 'install', 'package'), diff --git a/deployability/modules/provision/tests/test_models.py b/deployability/modules/provision/tests/test_models.py index 7d1afec555..a0a19cf57e 100644 --- a/deployability/modules/provision/tests/test_models.py +++ b/deployability/modules/provision/tests/test_models.py @@ -1,11 +1,12 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + """modules.provision.models Unit tests.""" from pathlib import Path import pytest -from modules.provision.models import InputPayload, ComponentInfo +from ..models import InputPayload, ComponentInfo @pytest.mark.parametrize('install', [(True), (False)]) diff --git a/deployability/modules/provision/tests/test_provision.py b/deployability/modules/provision/tests/test_provision.py index d08d9ef981..54a0b6ee90 100644 --- a/deployability/modules/provision/tests/test_provision.py +++ b/deployability/modules/provision/tests/test_provision.py @@ -1,14 +1,15 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + """Unit Tests for the Provision class""" from typing import List from unittest.mock import patch, MagicMock, call import pytest -from modules.provision.models import InputPayload, ComponentInfo -from modules.provision.provision import Provision +from ..models import InputPayload, ComponentInfo +from ..provision import Provision def test_provision_constructor(): diff --git a/deployability/modules/provision/utils.py b/deployability/modules/provision/utils.py index 29102ca98e..4fc9dec070 100644 --- a/deployability/modules/provision/utils.py +++ b/deployability/modules/provision/utils.py @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 -from modules.generic.logger import Logger + +from modules.generic.logger.logger import Logger logger = Logger("provisioner").get_logger() diff --git a/deployability/modules/setup.py b/deployability/modules/setup.py index ea439929af..f72afd105e 100644 --- a/deployability/modules/setup.py +++ b/deployability/modules/setup.py @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + import json import os diff --git a/deployability/modules/testing/models.py b/deployability/modules/testing/models.py index f4e168efa8..95016e28da 100644 --- a/deployability/modules/testing/models.py +++ b/deployability/modules/testing/models.py @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + from typing import Literal from pydantic import BaseModel, field_validator diff --git a/deployability/modules/testing/testing.py b/deployability/modules/testing/testing.py index 4a7cfbe648..40905cbfee 100644 --- a/deployability/modules/testing/testing.py +++ b/deployability/modules/testing/testing.py @@ -11,7 +11,6 @@ from .models import InputPayload, ExtraVars from .utils import logger - class Tester: _playbooks_dir = Path(__file__).parent / 'playbooks' _setup_playbook = _playbooks_dir / 'setup.yml' diff --git a/deployability/modules/testing/tests/helpers/agent.py b/deployability/modules/testing/tests/helpers/agent.py index 7e60c5fbca..77a650ab90 100644 --- a/deployability/modules/testing/tests/helpers/agent.py +++ b/deployability/modules/testing/tests/helpers/agent.py @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + import requests import yaml diff --git a/deployability/modules/testing/tests/helpers/logger/config.yaml b/deployability/modules/testing/tests/helpers/logger/config.yaml index b1f9d1efd2..d065edf127 100644 --- a/deployability/modules/testing/tests/helpers/logger/config.yaml +++ b/deployability/modules/testing/tests/helpers/logger/config.yaml @@ -16,7 +16,7 @@ handlers: class: logging.FileHandler level: DEBUG formatter: simple - filename: /tmp/workflow.log + filename: /tmp/workflow2.log root: level: DEBUG handlers: [console, file] diff --git a/deployability/modules/testing/tests/helpers/logger/logger.py b/deployability/modules/testing/tests/helpers/logger/logger.py index 2e02766f06..39b5c9d526 100644 --- a/deployability/modules/testing/tests/helpers/logger/logger.py +++ b/deployability/modules/testing/tests/helpers/logger/logger.py @@ -5,7 +5,6 @@ import logging import logging.config from pathlib import Path -import threading import yaml @@ -21,4 +20,4 @@ def _load_config() -> None: _load_config() -logger = logging.getLogger("Testing") +logger = logging.getLogger("TEST-MODULE") diff --git a/deployability/modules/testing/tests/helpers/manager.py b/deployability/modules/testing/tests/helpers/manager.py index 30aefd8442..0e4c22f6cf 100644 --- a/deployability/modules/testing/tests/helpers/manager.py +++ b/deployability/modules/testing/tests/helpers/manager.py @@ -3,7 +3,6 @@ # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 import requests -import socket from .constants import CLUSTER_CONTROL, AGENT_CONTROL, WAZUH_CONF, WAZUH_ROOT from .executor import Executor, WazuhAPI diff --git a/deployability/modules/testing/utils.py b/deployability/modules/testing/utils.py index ba5e1e41ba..5937310ed9 100644 --- a/deployability/modules/testing/utils.py +++ b/deployability/modules/testing/utils.py @@ -4,4 +4,4 @@ from modules.generic.logger import Logger -logger = Logger("tester").get_logger() +logger = Logger("test-module").get_logger() diff --git a/deployability/modules/workflow_engine/__init__.py b/deployability/modules/workflow_engine/__init__.py index 39cf4553b9..a7a9cec0c7 100755 --- a/deployability/modules/workflow_engine/__init__.py +++ b/deployability/modules/workflow_engine/__init__.py @@ -1,4 +1,5 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + from .workflow_processor import WorkflowProcessor diff --git a/deployability/modules/workflow_engine/__main__.py b/deployability/modules/workflow_engine/__main__.py index 6a0a78fdc8..ad5bc67f92 100755 --- a/deployability/modules/workflow_engine/__main__.py +++ b/deployability/modules/workflow_engine/__main__.py @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + import os import sys import argparse diff --git a/deployability/modules/workflow_engine/examples/test.yaml b/deployability/modules/workflow_engine/examples/test.yaml index 9003f9d297..1488d42bde 100644 --- a/deployability/modules/workflow_engine/examples/test.yaml +++ b/deployability/modules/workflow_engine/examples/test.yaml @@ -7,15 +7,9 @@ variables: - linux-ubuntu-22.04-amd64 - linux-debian-10-amd64 - linux-debian-11-amd64 - - linux-debian-12-amd64 - linux-oracle-9-amd64 - - linux-centos-7-amd64 - - linux-centos-8-amd64 - - linux-redhat-7-amd64 - - linux-redhat-8-amd64 - - linux-redhat-9-amd64 - - linux-amazon-2-amd64 - manager-os: linux-ubuntu-22.04-amd64 + + manager-os: linux-debian-12-amd64 infra-provider: vagrant working-dir: /tmp/dtt1-poc @@ -35,6 +29,9 @@ tasks: - composite-name: "{manager-os}" - inventory-output: "{working-dir}/manager-{manager-os}/inventory.yaml" - track-output: "{working-dir}/manager-{manager-os}/track.yaml" + - label-termination-date: "1d" + - label-team: "qa" + on-error: "abort-all" cleanup: this: process with: @@ -59,6 +56,8 @@ tasks: - composite-name: "{agent}" - inventory-output: "{working-dir}/agent-{agent}/inventory.yaml" - track-output: "{working-dir}/agent-{agent}/track.yaml" + - label-termination-date: "1d" + - label-team: "qa" foreach: - variable: agent-os as: agent @@ -88,6 +87,7 @@ tasks: live: True depends-on: - "allocate-manager-{manager-os}" + on-error: "abort-all" # Generic agent provision task - task: "provision-install-{agent}" @@ -134,4 +134,4 @@ tasks: - variable: agent-os as: agent depends-on: - - "provision-install-{agent}" + - "provision-install-{agent}" \ No newline at end of file diff --git a/deployability/modules/workflow_engine/logger/config.yaml b/deployability/modules/workflow_engine/logger/config.yaml index e4c858047a..134b67dfdc 100644 --- a/deployability/modules/workflow_engine/logger/config.yaml +++ b/deployability/modules/workflow_engine/logger/config.yaml @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + version: 1 formatters: simple: @@ -25,7 +26,7 @@ handlers: class: logging.FileHandler level: DEBUG formatter: simple - filename: /tmp/workflow.log + filename: /tmp/workflow2.log root: level: DEBUG handlers: [console, file] diff --git a/deployability/modules/workflow_engine/logger/filter.py b/deployability/modules/workflow_engine/logger/filter.py index d92114f52e..f75009e364 100644 --- a/deployability/modules/workflow_engine/logger/filter.py +++ b/deployability/modules/workflow_engine/logger/filter.py @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + import logging import threading diff --git a/deployability/modules/workflow_engine/logger/logger.py b/deployability/modules/workflow_engine/logger/logger.py index 0a1b0b4809..3f8e73587d 100644 --- a/deployability/modules/workflow_engine/logger/logger.py +++ b/deployability/modules/workflow_engine/logger/logger.py @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + import logging import logging.config diff --git a/deployability/modules/workflow_engine/models.py b/deployability/modules/workflow_engine/models.py index 5892028b67..c92d2a868f 100644 --- a/deployability/modules/workflow_engine/models.py +++ b/deployability/modules/workflow_engine/models.py @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + from pathlib import Path from typing import Literal from pydantic import BaseModel diff --git a/deployability/modules/workflow_engine/schema_validator.py b/deployability/modules/workflow_engine/schema_validator.py index 7ac2639fc9..d04a9bb39d 100755 --- a/deployability/modules/workflow_engine/schema_validator.py +++ b/deployability/modules/workflow_engine/schema_validator.py @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + import jsonschema import json import os diff --git a/deployability/modules/workflow_engine/task.py b/deployability/modules/workflow_engine/task.py index d076b90b53..b9e349a74b 100755 --- a/deployability/modules/workflow_engine/task.py +++ b/deployability/modules/workflow_engine/task.py @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + import subprocess import random import time diff --git a/deployability/modules/workflow_engine/workflow_processor.py b/deployability/modules/workflow_engine/workflow_processor.py index 85635aa6c9..b8177b2129 100755 --- a/deployability/modules/workflow_engine/workflow_processor.py +++ b/deployability/modules/workflow_engine/workflow_processor.py @@ -1,6 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Created by Wazuh, Inc. . # This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + import concurrent.futures import graphlib import json