Skip to main content

Python Wazuh runtime server to handle agent registration and log receive

Project description

Wazoo

This project is a wazuh server 4.X that can handle wazuh agent connection.

What is Wazoo

Wazoo is a wazuh server that can handle wazuh agent connection and logging.

wazoo does not replace wazuh but you can use to send logs to other platforms or make new integrations with wazuh.

I made wazoo to study the wazuh agent enrolment and I ended up getting excited and doing this project.

With this project you can receive logs from wazuh agent and logging into a TCP, UDP, Unix, TCP+SSL or File

Installation & Configuration

You can run this project using: docker, uv or pre-compiled binaries

Run with uv

Install uv:

curl -LsSf https://astral.sh/uv/install.sh | sh

Sync the dependencies and run the server. uv installs the project into an isolated environment automatically, so no manual pip install is needed:

uv sync
uv run wazoo -v

uv run wazoo calls the CLI entry point. You can also run it as a module:

uv run python -m wazoo -v

List every available option with:

uv run wazoo --help

If you want to use TCP+SSL, create the certificates first — see Setup development environment.

Pre-compiled binaries

I recommend to use pre-compiled binaries, binaries generated by nuitka will have more performance than running python

Standalone binaries (built with Nuitka, no Python required) are attached to every GitHub Release. Each release ships version-pinned assets plus a rolling latest alias:

Platform latest asset
Linux x86_64 wazoo-latest-linux-x86_64
Linux arm64 wazoo-latest-linux-arm64
macOS arm64 (Apple Silicon) wazoo-latest-macos-arm64

Download it, make it executable and run:

curl -L -o wazoo https://github.com/souzomain/wazoo/releases/latest/download/wazoo-latest-linux-x86_64
chmod +x wazoo
./wazoo -v

The releases/latest/download/... URL always resolves to the newest release, so it is safe to script. For a reproducible install, pick a specific version from the releases page instead (e.g. wazoo-<version>-linux-x86_64).

Performance

This python wazuh server, is not performant than wazuh server but can

  • asyncio ( for async connection );
  • uvloop ( for better asyncio performance );
  • MultiProcessing ( multiples processes using same port );
  • Thread poll workers ( use thread to decode large events >4kb );
  • pre-compiled binaries ( to compile the project, nuitka do some performance optimizations ).

Python is not good for performance but with this architecture We managed to turn it into something with high performance.

  • uvloop: uses libuv (C library used in nodejs) under the hood, this increases the speed of all async tasks;
  • asyncio: The project has used asyncio from the start;
  • caching: I made many caching options on the project, this increases the speed for AES computation, database, etc;
  • workers: workers for log decoding are default. by default it uses all cpus core;
  • multiprocessing: by default I added 1 process to handle the connections, but you can increase with the option --processes;
  • nuitka: Compile the project and generate a performant binarie.

Setup development environment

Install uv

curl -LsSf https://astral.sh/uv/install.sh | sh

Sync the project

uv sync

Create the SSL pem

./scripts/generate_ssl.sh

Now you can run the server

uv run wazoo -v

Test

You can test server using docker to run a wazuh agent.

uv run wazoo -v &
docker compose -f docker/agent.yml up 

Conclusion

I dedicated a lot of my time to making this project and tutorial.

I want to do many different things in this project, one thing is implementing a HTTP Api to manage the server, but will do this only if the project get more visibility.

If you want me to continue developing this project, please consider to give a Star :star:

Contact

If you want to contact me, you can use this options.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wazoo-0.1.1.tar.gz (192.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wazoo-0.1.1-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file wazoo-0.1.1.tar.gz.

File metadata

  • Download URL: wazoo-0.1.1.tar.gz
  • Upload date:
  • Size: 192.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for wazoo-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e8682fa08b2205ca811b2252c2a33e2452d0b9352dc8237e817edb508c6a6de0
MD5 e40c9a5921262e8e2e615435130e92f7
BLAKE2b-256 ca9bd35d56537a4ad05e9e0743a050b69dadbdfd7e068693f4525cbb5e02d342

See more details on using hashes here.

File details

Details for the file wazoo-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: wazoo-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for wazoo-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 565aaeae06102c1f5541e7d3b784b705916639667788b14518d853b97b9a7ba0
MD5 4a4ea39833e5efd1b902bc21099f8b5f
BLAKE2b-256 c510f4b68196de61f26a4f8f38c03b5f89351f595eca6027303e4ac90676090a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page