Deployment Overview of Wazuh on Server¶
Prerequisites and Basic Requirements¶
The server must meet the following criteria to successfully host the Wazuh application:
-
Operating System: Ubuntu (supported for APT package management).
-
Privileges: Root access is required to install Docker, execute installation scripts, and configure system services.
-
Domain: The deployment is configured for the
hostkey.indomain. -
Ports:
-
Internal application port:
8080. -
External HTTPS port:
443. -
Network: Docker service must be installed and running.
FQDN of the Final Panel¶
The application is accessible via the following Fully Qualified Domain Name (FQDN): wazuh<Server ID>.hostkey.in
The service listens on port 443 for external connections, routed through the Nginx proxy.
File and Directory Structure¶
The following directories and files constitute the core structure of the installation:
-
Main Data Directory:
/opt/wazuh -
Contains the installation script
wazuh-install.sh. -
Contains the configuration file
config.yml. -
Contains the generated configuration archive
wazuh-install-files.tar. -
Contains the credentials file
password(stores the admin username and password). -
Nginx Configuration:
-
Proxy container configuration:
/root/nginx/compose.yml. -
SSL certificates and secrets:
/etc/letsencrypt(mounted volume). -
User-specific Nginx configuration:
/data/nginx/user_conf.d/wazuh<Server ID>.hostkey.in.conf. -
System Package Lists:
-
Wazuh repository list:
/etc/apt/sources.list.d/wazuh.list.
Application Installation Process¶
The application is deployed using the official Wazuh installation script provided by the developer. The process follows these sequential steps:
-
Environment Preparation:
-
APT packages are updated and upgraded.
-
The directory
/opt/wazuhis created. -
Script and Configuration Setup:
-
The installation script
wazuh-install.shis downloaded fromhttps://packages.wazuh.com/4.11/wazuh-install.shto/opt/wazuh. -
A
config.ymlfile is placed in/opt/wazuhto define the deployment parameters. -
Configuration files are generated by executing:
-
Component Installation:
-
Wazuh Indexer: Installed using the command:
-
Indexer Cluster: Started using the command:
-
Wazuh Server: Installed using the command:
-
Wazuh Dashboard: Installed and configured to listen on port
8080using the command: -
Post-Installation:
-
The Wazuh updating repository is disabled in
/etc/apt/sources.list.d/wazuh.listto prevent automatic updates from the official source. -
The admin password is extracted from the generated archive and stored in
/opt/wazuh/password.
Access Rights and Security¶
-
User Permissions: The installation and management of Wazuh components require root privileges.
-
File Permissions:
-
The
config.ymlandpasswordfiles are set to mode0600to restrict access to the root user only. -
The main directory
/opt/wazuhis set to mode0755. -
The Nginx directory
/root/nginxis owned byrootwith mode0755. -
Firewall: The Nginx proxy handles external traffic on port
443. Internal services communicate over port8080.
Databases¶
Wazuh utilizes a Wazuh Indexer for data storage and management.
-
Connection Method: Internal communication occurs within the host environment.
-
Health Check Endpoint:
https://127.0.0.1:9200/_cluster/health. -
Authentication:
-
Username:
admin. -
Password: Stored in the file
/opt/wazuh/password. -
Storage Location: Data is managed by the Wazuh Indexer service installed via the
wazuh-install.shscript.
Docker Containers and Their Deployment¶
The proxy layer for SSL termination and domain routing is implemented using Docker.
-
Container Image:
jonasal/nginx-certbot:latest. -
Deployment Method: Docker Compose.
-
Compose File Location:
/root/nginx/compose.yml. -
Volumes:
-
nginx_secrets: Mounted to/etc/letsencryptfor SSL certificates. -
/data/nginx/user_conf.d: Mounted to/etc/nginx/user_conf.dfor custom configuration. -
Network Mode:
host. -
Startup Command:
This command is executed from the directory/root/nginx.
Proxy Servers¶
Access to the Wazuh Dashboard is proxied through an Nginx container with automatic SSL certificate management via Certbot.
-
Proxy Server: Nginx.
-
SSL Management: Certbot (included in the
jonasal/nginx-certbotimage). -
Configuration Details:
-
The proxy forwards requests to the internal Wazuh Dashboard service.
-
Target URL:
https://wazuh<Server ID>.hostkey.in:8080. -
The configuration is stored in
/data/nginx/user_conf.d/wazuh<Server ID>.hostkey.in.conf. -
Email for Certbot:
[email protected].
Permission Settings¶
The following permission settings are applied to critical files and directories: | Path | Owner | Group | Mode | Description | | :--- | :--- | :--- | :--- | :--- | | /opt/wazuh | root | root | 0755 | Main application data directory | | /opt/wazuh/config.yml | root | root | 0600 | Application configuration file | | /opt/wazuh/password | root | root | 0600 | Admin credentials file | | /root/nginx | root | root | 0755 | Nginx compose directory | | /root/nginx/compose.yml | root | root | 0644 | Docker Compose definition | | /data/nginx/user_conf.d/ | root | root | 0755 | Nginx user configuration directory |
Location of Configuration Files and Data¶
-
Wazuh Configuration:
/opt/wazuh/config.yml. -
Wazuh Installation Script:
/opt/wazuh/wazuh-install.sh. -
Admin Credentials:
/opt/wazuh/password(format:admin:<password>). -
Docker Compose (Proxy):
/root/nginx/compose.yml. -
Nginx Custom Config:
/data/nginx/user_conf.d/wazuh<Server ID>.hostkey.in.conf. -
Wazuh Repository List:
/etc/apt/sources.list.d/wazuh.list.
Available Ports for Connection¶
| Port | Protocol | Service | Description |
|---|---|---|---|
| 443 | HTTPS | Nginx Proxy | External access to Wazuh Dashboard |
| 8080 | HTTPS | Wazuh Dashboard | Internal access to the dashboard |
| 9200 | HTTPS | Wazuh Indexer | Internal API for indexer health and data |
Starting, Stopping, and Updating¶
-
Starting the Proxy: To start the Nginx proxy container with SSL:
This command must be run from the directory/root/nginx. -
Managing Wazuh Services: The Wazuh components (Indexer, Server, Dashboard) are managed via the
wazuh-install.shscript located in/opt/wazuh. -
Start Cluster:
./wazuh-install.sh --start-cluster -
Note: The Wazuh repository for automatic updates has been disabled in
/etc/apt/sources.list.d/wazuh.list. Manual updates require re-enabling the repository or using the installation script with specific flags, though the current configuration restricts automatic updates.