Open rauldpm opened 2 weeks ago
Errors were also found in the Windows agents since they did not support creating certificates for 4.8.0 with the cert_tool.sh, which required updates.
Test with green status:
Linux Agent :green_circle: :
Input yaml:
version: 0.1
description: This workflow is used to test agents deployment for DDT1 PoC
variables:
agent-os:
- linux-ubuntu-20.04-amd64
manager-os: linux-ubuntu-22.04-amd64
infra-provider: vagrant
macos-infra-provider: vagrant
working-dir: /tmp/dtt1-poc
tasks:
# Unique manager allocate task
- task: "allocate-manager-{manager-os}"
description: "Allocate resources for the manager."
do:
this: process
with:
path: python3
args:
- modules/allocation/main.py
- action: create
- provider: "{infra-provider}"
- size: large
- 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"
- label-issue: "https://github.com/wazuh/wazuh-qa/issues/5191"
on-error: "abort-all"
cleanup:
this: process
with:
path: python3
args:
- modules/allocation/main.py
- action: delete
- track-output: "{working-dir}/manager-{manager-os}/track.yaml"
# Unique agent allocate task
- task: "allocate-agent-{agent}"
description: "Allocate resources for the agent."
do:
this: process
with:
path: python3
args:
- modules/allocation/main.py
- action: create
- provider: "{infra-provider}"
- size: small
- 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"
- label-issue: "https://github.com/wazuh/wazuh-qa/issues/5191"
on-error: "abort-all"
foreach:
- variable: agent-os
as: agent
cleanup:
this: process
with:
path: python3
args:
- modules/allocation/main.py
- action: delete
- track-output: "{working-dir}/agent-{agent}/track.yaml"
# Unique manager provision task
- task: "provision-manager-{manager-os}"
description: "Provision the manager."
do:
this: process
with:
path: python3
args:
- modules/provision/main.py
- inventory: "{working-dir}/manager-{manager-os}/inventory.yaml"
- install:
- component: wazuh-manager
type: assistant
version: 4.8.0
live: False
depends-on:
- "allocate-manager-{manager-os}"
on-error: "abort-all"
# Generic agent test task
- task: "run-agent-{agent}-tests"
description: "Run tests install for the agent {agent}."
do:
this: process
with:
path: python3
args:
- modules/testing/main.py
- targets:
- wazuh-1: "{working-dir}/manager-{manager-os}/inventory.yaml"
- agent: "{working-dir}/agent-{agent}/inventory.yaml"
- tests: "install,registration,basic_info"
- component: "agent"
- wazuh-version: "4.8.0"
- wazuh-revision: "40811"
- live: False
foreach:
- variable: agent-os
as: agent
depends-on:
- "allocate-agent-{agent}"
- "provision-manager-{manager-os}"
Result:
Agent linux :green_circle: installing Wazuh manager:
Input yaml:
version: 0.1
description: This workflow is used to test agents deployment for DDT1 PoC
variables:
agent-os:
- linux-ubuntu-20.04-amd64
manager-os: linux-ubuntu-22.04-amd64
infra-provider: aws
working-dir: /tmp/dtt1-poc
tasks:
# Unique manager allocate task
- task: "allocate-manager-{manager-os}"
description: "Allocate resources for the manager."
do:
this: process
with:
path: python3
args:
- modules/allocation/main.py
- action: create
- provider: "{infra-provider}"
- size: large
- 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"
- label-issue: "https://github.com/wazuh/wazuh-qa/issues/5191"
on-error: "abort-all"
#cleanup:
# this: process
# with:
# path: python3
# args:
# - modules/allocation/main.py
# - action: delete
# - track-output: "{working-dir}/manager-{manager-os}/track.yaml"
# Unique agent allocate task
- task: "allocate-agent-{agent}"
description: "Allocate resources for the agent."
do:
this: process
with:
path: python3
args:
- modules/allocation/main.py
- action: create
- provider: "{infra-provider}"
- size: small
- 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"
- label-issue: "https://github.com/wazuh/wazuh-qa/issues/5191"
on-error: "abort-all"
foreach:
- variable: agent-os
as: agent
#cleanup:
# this: process
# with:
# path: python3
# args:
# - modules/allocation/main.py
# - action: delete
# - track-output: "{working-dir}/agent-{agent}/track.yaml"
# Generic agent test task
- task: "run-agent-{agent}-tests"
description: "Run tests install for the agent {agent}."
do:
this: process
with:
path: python3
args:
- modules/testing/main.py
- targets:
- wazuh-1: "{working-dir}/manager-{manager-os}/inventory.yaml"
- agent: "{working-dir}/agent-{agent}/inventory.yaml"
- tests: "install,registration,basic_info"
- component: "agent"
- wazuh-version: "4.8.0"
- wazuh-revision: "40811"
- live: False
foreach:
- variable: agent-os
as: agent
depends-on:
- "allocate-agent-{agent}"
- "allocate-manager-{manager-os}"
Result:
Windows Agent :green_circle: :
Input yaml:
version: 0.1
description: This workflow is used to test agents deployment for DDT1 PoC
variables:
agent-os:
- linux-ubuntu-20.04-amd64
windows-agent-os:
- windows-server-2022-amd64
manager-os: linux-ubuntu-22.04-amd64
infra-provider: aws
macos-infra-provider: vagrant
working-dir: /tmp/dtt1-poc
tasks:
# Unique manager allocate task
- task: "allocate-manager-{manager-os}"
description: "Allocate resources for the manager."
do:
this: process
with:
path: python3
args:
- modules/allocation/main.py
- action: create
- provider: "{infra-provider}"
- size: large
- 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"
- label-issue: "https://github.com/wazuh/wazuh-qa/issues/5191"
on-error: "abort-all"
cleanup:
this: process
with:
path: python3
args:
- modules/allocation/main.py
- action: delete
- track-output: "{working-dir}/manager-{manager-os}/track.yaml"
# Unique agent allocate task
- task: "allocate-agent-{agent}"
description: "Allocate resources for the agent."
do:
this: process
with:
path: python3
args:
- modules/allocation/main.py
- action: create
- provider: "{infra-provider}"
- size: small
- 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"
- label-issue: "https://github.com/wazuh/wazuh-qa/issues/5191"
on-error: "abort-all"
foreach:
- variable: agent-os
as: agent
cleanup:
this: process
with:
path: python3
args:
- modules/allocation/main.py
- action: delete
- track-output: "{working-dir}/agent-{agent}/track.yaml"
# Unique Windows agent allocate task
- task: "allocate-windows-agent-{agent}"
description: "Allocate resources for the agent."
do:
this: process
with:
path: python3
args:
- modules/allocation/main.py
- action: create
- provider: "{infra-provider}"
- size: large
- 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"
- label-issue: "https://github.com/wazuh/wazuh-qa/issues/5191"
on-error: "abort-all"
foreach:
- variable: windows-agent-os
as: agent
cleanup:
this: process
with:
path: python3
args:
- modules/allocation/main.py
- action: delete
- track-output: "{working-dir}/agent-{agent}/track.yaml"
# Unique manager provision task
- task: "provision-manager-{manager-os}"
description: "Provision the manager."
do:
this: process
with:
path: python3
args:
- modules/provision/main.py
- inventory: "{working-dir}/manager-{manager-os}/inventory.yaml"
- install:
- component: wazuh-manager
type: assistant
version: 4.8.0
live: False
depends-on:
- "allocate-manager-{manager-os}"
on-error: "abort-all"
# Generic agent test task
- task: "run-agent-{agent}-tests"
description: "Run tests install for the agent {agent}."
do:
this: process
with:
path: python3
args:
- modules/testing/main.py
- targets:
- wazuh-1: "{working-dir}/manager-{manager-os}/inventory.yaml"
- agent: "{working-dir}/agent-{agent}/inventory.yaml"
- tests: "install,registration,basic_info"
- component: "agent"
- wazuh-version: "4.8.0"
- wazuh-revision: "40811"
- live: False
foreach:
- variable: agent-os
as: agent
depends-on:
- "allocate-agent-{agent}"
- "provision-manager-{manager-os}"
# Generic windows agent test task
- task: "run-windows-agent-{agent}-tests"
description: "Run tests install for the agent {agent}."
do:
this: process
with:
path: python3
args:
- modules/testing/main.py
- targets:
- wazuh-1: "{working-dir}/manager-{manager-os}/inventory.yaml"
- agent: "{working-dir}/agent-{agent}/inventory.yaml"
- tests: "install,registration,basic_info"
- component: "agent"
- wazuh-version: "4.8.0"
- wazuh-revision: "40811"
- live: False
foreach:
- variable: windows-agent-os
as: agent
depends-on:
- "allocate-windows-agent-{agent}"
- "provision-manager-{manager-os}"
Result:
macOS Agent :red_circle: :
[0;31m launchctl list | grep com.wazuh.agent[0m
[0;31m command ##########[0m
[0;31m result ####################[0;31m result ####################[0;
[0;31m {'success': False, 'output': None}[0m
[0;31m [31m[2024-05-31 13:01:35] [ERROR] TESTER: agent-macos-sonoma-14-amd64 is not active by command[0m[0m
[0;31m FAILED[0m
Further analysis and testing is required to detect the actual failure.
This issue has been on hold since 27/05/2024 as Federico is OOO
Retaking the issue with some blocks because the pre-release repository is not 100% available due to release 4.7.5 https://wazuh-team.slack.com/archives/C02A737S5MJ/p1717073543900979?thread_ts=1717053492.730899&cid=C02A737S5MJ
MacOS error research.
After registering the agent (up to this point the installation, registration and connection with the manager was carried out satisfactorily), a test fails to determine whether the component, in this case the agent, is active by process (validation of whether it is active by Wazuh control has already passed). )
Mistake:
[0;31m launchctl list | grep com.wazuh.agent[0m
[0;31m command ##########[0m
[0;31m result ####################[0;31m result ####################[0;
[0;31m {'success': False, 'output': None}[0m
[0;31m [31m[2024-05-31 13:01:35] [ERROR] TESTER: agent-macos-sonoma-14-amd64 is not active by command[0m[0m
[0;31m FAILED[0m
To detect if the agent process is running, use this command launchctl list | grep com.wazuh.agent
Validating in the raised VM it is detected that the agent was installed and registered correctly and that it is active:
sh-3.2# /Library/Ossec/bin/wazuh-control status
wazuh-modulesd is running...
wazuh-logcollector is running...
wazuh-syscheckd is running...
wazuh-agentd is running...
wazuh-execd is running...
sh-3.2#
sh-3.2# ps aux | grep wazuh
wazuh 2142 0.1 0.1 34172172 3508 ?? S 9:01AM 0:01.49 /Library/Ossec/bin/wazuh-agentd
But when executing the command used in the test it gives:
And the agent successfully registered in the manager:
ubuntu@ip-172-31-83-167:~$ sudo su
root@ip-172-31-83-167:/home/ubuntu# /var/ossec/bin/agent_control -l
Wazuh agent_control. List of available agents:
ID: 000, Name: ip-172-31-83-167 (server), IP: 127.0.0.1, Active/Local
ID: 001, Name: agent-macos-sonoma-14-amd64, IP: any, Active
List of agentless devices:
root@ip-172-31-83-167:/home/ubuntu#
Then the way to detect whether the process is running was modified and the tests were relaunched.
Test summary:
Test | status |
---|---|
Test agent Linux, macOS and Windows with provision manager | :green_circle: |
Test agent Linux, macOS and Windows installing manager with test | :green_circle: |
Test manager | :green_circle: |
Test Central components | :black_circle: |
In all tests, the install, registration, basic_info, connection, restart, stop, and uninstall tests were executed
Description
DTT1 started its development at an early stage of 4.8.0, because it was not stable enough and there are no 4.9.0 packages, development has been done with 4.7.x packages
It is necessary to adapt the DTT1 packages to 4.8.0 to incorporate the latest functionalities and improvements, such as the connection between the Wazuh manager and the Wazuh indexer.
As 4.9.0 does not present hard changes since 4.8.0 (speaking about configuration changes), the 4.8.0 adaptation should work with 4.9.0 packages too, but, to be sure, consider the following to test 4.9.0 packages, as they are not present in pre-release and they are on an early development stage
packages-dev.wazuh.com/staging
repositoryRelated
4495-dtt1-release
Tasks