# sakkarose/wazuh-docker architecture

> Architecture diagram of the GitHub repository sakkarose/wazuh-docker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sakkarose/wazuh-docker
- Repository: https://github.com/sakkarose/wazuh-docker

## Overview

##### Main Components
- Docker Orchestration: At the heart of the design is Docker Compose (see single-node/docker-compose.yml) that bundles multiple containerized services.
- Wazuh Manager: The central security engine that processes logs and alerts.
- Wazuh Indexer: Responsible for indexing and searching through the logs (with its own configuration files found under single-node/config/wazuh_indexer and managed via separate certificate creation using the indexer-certs-creator).
- Wazuh Dashboard: Configurations under single-node/config/wazuh_dashboard point toward visualization (using OpenSearch Dashboards or Grafana as mentioned in the README).
- Wazuh Endpoint/Agent Provisioning: Configurations for Windows agents include setups for Sysmon, YARA, and active response scripts (located in single-node/config/wazuh_endpoint/windows).
- CI/CD Pipeline: The repository contains a well-populated .github directory with multiple workflows for building, scanning (using Trivy), and pushing Docker images as well as checks (filebeat and log-check scripts). This is an important part of the overall process, ensuring that deployments remain checked and secure.

##### Detail the Relationships/Interactions Between Components
- The Docker Compose environment will provide communication amongst the Wazuh Manager, Indexer, and Dashboard.
- The Manager collects and processes logs (including those forwarded from Windows agents) and interacts with the Indexer for storing/retrieving log data.
- The Dashboard accesses data from the Indexer to present insights and visualizations.
- The Windows agents (provisioned via provided scripts and configurations) securely communicate with the Manager for log collection and response actions.
- The indexer-certs-creator component ensures secure inter-service communication by generating necessary certificates before the Indexer comes online.
- The CI/CD pipeline (via GitHub Actions) automates the building, testing, and deployment processes, ensuring that changes in decoders, rules, and endpoint configurations propagate to the deployed containers.

##### Architectural Patterns and Design Principles
- Containerization & Microservices: The project adopts a containerized architecture (Docker), isolating responsibilities (manager, indexer, dashboard, cert creator) in separate containers.
- Modular Configuration: With directories separating decoders, rules, and agent provisioning scripts, the design supports easy updates and extensibility.
- Continuous Integration/Delivery: The GitHub workflows and scripts emphasize automation, continuous testing, and secure deployments.

##### Relevant Technologies, Frameworks, or Libraries
- Docker & Docker Compose for container orchestration.
- GitHub Actions for CI/CD (with specific workflows for pushing Docker images and running security scans with Trivy).
- Wazuh (as the core technology) for security monitoring.
- Supporting configurations for Windows agent tools (Sysmon, YARA) and custom scripts for active responses.
- OpenSearch Dashboards (or potential replacement with Grafana as discussed in the README) for visualization.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Docker Compose Environment"
        dockerCompose["Docker Compose Orchestration"]:::container
        wazuhManager["Wazuh Manager Container"]:::container
        wazuhIndexer["Wazuh Indexer Container"]:::container
        wazuhDashboard["Wazuh Dashboard Container"]:::container
        indexerCerts["Indexer Certs Creator"]:::container
    end

    windowsAgents["Windows Agent Provisioning (External Agents)"]:::external
    cicdPipeline["CI/CD Pipeline"]:::cicd

    windowsAgents -->|"forwards_logs"| wazuhManager
    wazuhManager -->|"stores_logs"| wazuhIndexer
    wazuhIndexer -->|"visualizes_data"| wazuhDashboard
    indexerCerts -->|"provisions_certs"| wazuhIndexer
    cicdPipeline -->|"deploys_updates"| dockerCompose

    click dockerCompose "https://github.com/sakkarose/wazuh-docker/blob/main/single-node/docker-compose.yml"
    click wazuhManager "https://github.com/sakkarose/wazuh-docker/tree/main/single-node/config/wazuh_cluster"
    click wazuhIndexer "https://github.com/sakkarose/wazuh-docker/tree/main/single-node/config/wazuh_indexer"
    click wazuhDashboard "https://github.com/sakkarose/wazuh-docker/tree/main/single-node/config/wazuh_dashboard"
    click indexerCerts "https://github.com/sakkarose/wazuh-docker/tree/main/indexer-certs-creator"
    click windowsAgents "https://github.com/sakkarose/wazuh-docker/tree/main/single-node/config/wazuh_endpoint/windows"
    click cicdPipeline "https://github.com/sakkarose/wazuh-docker/blob/main/.github"

    classDef container fill:#AEDFF7,stroke:#000,stroke-width:2px;
    classDef external fill:#F7D6AE,stroke:#000,stroke-width:2px;
    classDef cicd fill:#D3F7A6,stroke:#000,stroke-width:2px;
```
