Deployment Overview of Wazuh on Server¶
Prerequisites and Basic Requirements¶
To ensure a successful deployment, the following requirements must be met:
-
Operating System: Ubuntu (APT package manager required).
-
Privileges: Root or sudo access is required for installing packages and managing Docker.
-
Network/Ports:
-
443(External HTTPS access via Nginx) -
8080(Internal Dashboard access) -
9200(Indexer API)
FQDN of the final panel on the hostkey.in domain¶
The application is accessible via a specific subdomain template:
| Parameter | Value |
|---|---|
| Prefix | wazuh |
| Domain | hostkey.in |
| Full template | wazuh{Server_ID_from_Invapi}.hostkey.in |
File and Directory Structure¶
The deployment utilizes the following directory structure for configuration and data management:
-
/opt/wazuh: Main application data directory containing installation scripts, configurations, and credentials. -
/root/nginx: Contains the Docker Compose file for the Nginx proxy. -
/data/nginx/user_conf.d: Stores Nginx virtual host configuration files. -
/data/nginx/nginx-certbot.env: Environment variables for Certbot.
Application installation process¶
The installation of Wazuh is performed using a dedicated installation script and several automated steps:
-
System Preparation: The system packages are updated and upgraded via
apt. -
Script Acquisition: The official Wazuh installation script (
wazuh-install.sh) is downloaded to/opt/wazuh. -
Configuration Generation: A
config.ymlfile is used to define the cluster nodes (Indexer, Server, and Dashboard). The command./wazuh-install.sh --generate-config-filesis executed to prepare the necessary deployment files. -
Component Installation:
-
Wazuh Indexer: Installed using the
--wazuh-indexer node-1flag. -
Cluster Initialization: The cluster is started using the
--start-clustercommand. -
Wazuh Server: The core server component is installed using the
--wazuh-server wazuh-1flag. -
Wazuh Dashboard: The dashboard is installed and configured to listen on port
8080using the--wazuh-dashboard dashboard -p 8080command.
Access Rights and Security¶
-
Firewall: Access is restricted via Nginx, which serves as a reverse proxy for the internal services.
-
Credentials: The administrator password for the indexer is automatically generated during installation and stored in
/opt/wazuh/password. -
Repository Security: After installation, the Wazuh APT repository is disabled in
/etc/apt/sources.list.d/wazuh.listto prevent accidental version conflicts during system updates.
Databases¶
Wazuh uses an integrated Indexer component for data storage:
-
Connection Method: Localhost communication within the server environment.
-
Storage Location: Managed by the Wazuh Indexer service.
Docker Containers and Their Deployment¶
The deployment utilizes a Nginx container to handle SSL termination via Certbot:
| Container Name | Image | Ports | Volumes | Environment Variables | Restart Policy |
|---|---|---|---|---|---|
nginx | jonasal/nginx-certbot:latest | Host Mode | - nginx_secrets:/etc/letsencrypt- /data/nginx/user_conf.d:/etc/nginx/user_conf.d | [email protected] | unless-stopped |
Custom Scripts and Additional Setup¶
The following actions are performed to finalize the environment:
-
Password Extraction: A script extracts the
adminuser password from the generatedwazuh-install-files.tararchive and saves it to/opt/wazuh/password. -
Nginx Proxy Configuration: The Nginx configuration is modified to include a
proxy_passdirective, routing traffic from the external domain tohttps://wazuh{Server_ID_from_Invapi}.hostkey.in:8080.
Application Update Instructions¶
To update the main application components, follow these steps:
-
Nginx Proxy: Navigate to
/root/nginxand rundocker compose pull && docker compose up -d. -
Wazuh Components: Since Wazuh is installed via a custom script on the host system, updates must be performed by following the official Wazuh upgrade procedures for your specific version.
Location of configuration files and data¶
-
Main Configuration:
/opt/wazuh/config.yml -
Installation Files:
/opt/wazuh/wazuh-install-files.tar -
Credentials:
/opt/wazuh/password -
Nginx Configurations:
/data/nginx/user_conf.d/
Available ports for connection¶
-
443: HTTPS (External access via Nginx proxy) -
8080: Wazuh Dashboard (Internal access) -
9200: Indexer API (Internal communication)
Starting and Stopping the application¶
The management of the proxy service is handled via Docker:
-
Start Proxy:
docker compose up -d(run from/root/nginx) -
Stop Proxy:
docker compose down(run from/root/nginx)
For the core Wazuh services, standard system service management commands are used depending on the specific component status.
Proxy Servers¶
The deployment uses an Nginx container with Certbot integration to provide SSL termination. The proxy is configured to route incoming HTTPS requests from wazuh{Server_ID_from_Invapi}.hostkey.in to the internal Wazuh Dashboard running on port 8080.