Skip to content

Commit 83120da

Browse files
authored
Merge pull request #8798 from wazuh/enhancement/idr286-add-deployment-on-docker-rework-4.13.0
Add deployment on docker rework – Wazuh agent
2 parents af28e15 + 4daa1d2 commit 83120da

File tree

5 files changed

+85
-64
lines changed

5 files changed

+85
-64
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
1414
- Added information about filters in the Windows agent to block UNC and mapped drive paths to mitigate *NetNTLMv2* vulnerabilities. ([#8665](https://github.com/wazuh/wazuh-documentation/pull/8665))
1515
- Added the Wazuh global queries documentation. ([#8722](https://github.com/wazuh/wazuh-documentation/pull/8722))
1616
- Added `remoted.ctrl_msg_queue_size` internal option and new remoted statistics fields. ([#8769](https://github.com/wazuh/wazuh-documentation/pull/8769))
17+
- Added Wazuh agent deployment on Docker documentation. ([#8798](https://github.com/wazuh/wazuh-documentation/pull/8798))
1718

1819
### Changed
1920

source/deployment-options/docker/build-docker-images-locally.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
.. Copyright (C) 2015, Wazuh, Inc.
22
33
.. meta::
4-
:description: You can modify and build Docker images for the Wazuh central components. Learn more in this section of the documentation.
4+
:description: You can modify and build Docker images for the Wazuh central components and the Wazuh agent. Learn more in this section of the documentation.
55

66
Build Docker images locally
77
===========================
88

9-
You can modify and build Docker images for the Wazuh central components (manager, indexer, and dashboard).
9+
You can modify and build Docker images for the Wazuh central components (manager, indexer, and dashboard) and the Wazuh agent.
1010

1111
#. Clone the `Wazuh Docker repository <https://github.com/wazuh/wazuh-docker>`_ to your system:
1212

source/deployment-options/docker/container-usage.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Access to services and containers
1414
This section explains how to interact with your Wazuh deployment by accessing service logs and shell instances of running containers.
1515

1616
#. Access the Wazuh dashboard using the Docker host IP address.
17-
#. Enroll agents through the standard :doc:`Wazuh agent enrollment </user-manual/agent/agent-enrollment/index>` process. Use the Docker host address as the Wazuh manager address.
17+
#. Enroll agents through the :ref:`Wazuh agent Docker deployment <agent_deployment_docker>` or the standard :doc:`Wazuh agent enrollment </user-manual/agent/agent-enrollment/index>` process. Use the Docker host address as the Wazuh manager address.
1818
#. List the containers in the directory where the Wazuh ``docker-compose.yml`` file is located:
1919

2020
.. code-block:: console
@@ -183,6 +183,10 @@ To customize the Wazuh configuration file ``/var/ossec/etc/ossec.conf``, modify
183183
- **Manager**: ``wazuh-docker/multi-node/config/wazuh_cluster/wazuh_manager.conf``
184184
- **Worker**: ``wazuh-docker/multi-node/config/wazuh_cluster/wazuh_worker.conf``
185185

186+
.. group-tab:: Wazuh agent container
187+
188+
``wazuh-docker/wazuh-agent/config/wazuh-agent-conf``
189+
186190
Save the changes in the configuration files.
187191

188192
#. Restart the stack:

source/deployment-options/docker/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Wazuh provides official Docker images that you can install to streamline deploym
1414
- ``wazuh-manager``
1515
- ``wazuh-indexer``
1616
- ``wazuh-dashboard``
17+
- ``wazuh-agent``
1718

1819
You can find all available Wazuh Docker images on `Docker Hub <https://hub.docker.com/u/wazuh>`__.
1920

source/deployment-options/docker/wazuh-container.rst

Lines changed: 76 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ Wazuh consists of a multi-platform Wazuh agent and three central components: the
1010

1111
**Deployment options**
1212

13-
Wazuh supports the deployment of the central components on Docker.
13+
Wazuh supports the deployment of the central components and agent on Docker.
1414

1515
- You can deploy `Wazuh central components`_ as a single-node or multi-node stack.
1616

1717
- **Single-node stack**: Runs one Wazuh manager, indexer, and dashboard node on the Docker host. Supports persistent storage and configurable certificates for secure communications.
1818
- **Multi-node stack**: Runs two Wazuh manager nodes (one master, one worker), three indexer nodes, one dashboard, and one nginx node. Includes persistence, secure communication configuration, and high availability.
1919

20+
- You can deploy a `Wazuh agent`_ container on a Docker host.
21+
2022
Wazuh central components
2123
------------------------
2224

@@ -94,23 +96,23 @@ You must provide certificates for each node to secure communication between them
9496

9597
.. code-block:: none
9698
97-
.. code-block:: none
99+
config/wazuh_indexer_ssl_certs/root-ca.pem
100+
config/wazuh_indexer_ssl_certs/wazuh.indexer-key.pem
101+
config/wazuh_indexer_ssl_certs/wazuh.indexer.pem
102+
config/wazuh_indexer_ssl_certs/admin.pem
103+
config/wazuh_indexer_ssl_certs/admin-key.pem
98104
99-
config/wazuh_indexer_ssl_certs/root-ca.pem
100-
config/wazuh_indexer_ssl_certs/wazuh.indexer-key.pem
101-
config/wazuh_indexer_ssl_certs/wazuh.indexer.pem
102-
config/wazuh_indexer_ssl_certs/admin.pem
103-
config/wazuh_indexer_ssl_certs/admin-key.pem
105+
**Wazuh manager**:
104106

105-
**Wazuh manager**:
107+
.. code-block:: none
106108
107-
.. code-block:: none
109+
config/wazuh_indexer_ssl_certs/root-ca-manager.pem
110+
config/wazuh_indexer_ssl_certs/wazuh.manager.pem
111+
config/wazuh_indexer_ssl_certs/wazuh.manager-key.pem
108112
109-
config/wazuh_indexer_ssl_certs/root-ca-manager.pem
110-
config/wazuh_indexer_ssl_certs/wazuh.manager.pem
111-
config/wazuh_indexer_ssl_certs/wazuh.manager-key.pem
113+
**Wazuh dashboard**:
112114

113-
**Wazuh dashboard**:
115+
.. code-block:: none
114116
115117
config/wazuh_indexer_ssl_certs/wazuh.dashboard.pem
116118
config/wazuh_indexer_ssl_certs/wazuh.dashboard-key.pem
@@ -245,7 +247,7 @@ Setting a new hash
245247

246248
#. Replace ``<NEW_HASH>`` with your hash values.
247249

248-
.. tabs::
250+
- ``admin`` user
249251

250252
.. code-block:: yaml
251253
:emphasize-lines: 4
@@ -259,15 +261,9 @@ Setting a new hash
259261
- "admin"
260262
description: "Demo admin user"
261263
262-
...
263-
admin:
264-
hash: "$2y$12$K/SpwjtB.wOHJ/Nc6GVRDuc1h0rM1DfvziFRNPtk27P.c4yDr9njO"
265-
reserved: true
266-
backend_roles:
267-
- "admin"
268-
description: "Demo admin user"
264+
...
269265
270-
...
266+
- ``kibanaserver`` user
271267

272268
.. code-block:: yaml
273269
:emphasize-lines: 4
@@ -279,20 +275,14 @@ Setting a new hash
279275
reserved: true
280276
description: "Demo kibanaserver user"
281277
282-
...
283-
kibanaserver:
284-
hash: "$2a$12$4AcgAt3xwOWadA5s5blL6ev39OXDNhmOesEoo33eZtrq2N0YrU3H."
285-
reserved: true
286-
description: "Demo kibanaserver user"
287-
288-
...
278+
...
289279
290280
Setting the new password
291281
........................
292282

293283
#. Open the ``docker-compose.yml`` file. Change all occurrences of the old password with the new one. For example, for a single-node stack:
294284

295-
.. tabs::
285+
- ``admin`` user
296286

297287
.. code-block:: yaml
298288
:emphasize-lines: 8, 25
@@ -329,37 +319,7 @@ Setting the new password
329319
- API_PASSWORD=MyS3cr37P450r.*-
330320
...
331321
332-
...
333-
services:
334-
wazuh.manager:
335-
...
336-
environment:
337-
- INDEXER_URL=https://wazuh.indexer:9200
338-
- INDEXER_USERNAME=admin
339-
- INDEXER_PASSWORD=SecretPassword
340-
- FILEBEAT_SSL_VERIFICATION_MODE=full
341-
- SSL_CERTIFICATE_AUTHORITIES=/etc/ssl/root-ca.pem
342-
- SSL_CERTIFICATE=/etc/ssl/filebeat.pem
343-
- SSL_KEY=/etc/ssl/filebeat.key
344-
- API_USERNAME=wazuh-wui
345-
- API_PASSWORD=MyS3cr37P450r.*-
346-
...
347-
wazuh.indexer:
348-
...
349-
environment:
350-
- "OPENSEARCH_JAVA_OPTS=-Xms1024m -Xmx1024m"
351-
...
352-
wazuh.dashboard:
353-
...
354-
environment:
355-
- INDEXER_USERNAME=admin
356-
- INDEXER_PASSWORD=SecretPassword
357-
- WAZUH_API_URL=https://wazuh.manager
358-
- DASHBOARD_USERNAME=kibanaserver
359-
- DASHBOARD_PASSWORD=kibanaserver
360-
- API_USERNAME=wazuh-wui
361-
- API_PASSWORD=MyS3cr37P450r.*-
362-
...
322+
- ``kibanaserver`` user
363323

364324
.. code-block:: yaml
365325
:emphasize-lines: 12
@@ -501,3 +461,58 @@ The ``wazuh-wui`` user is the default user for connecting to the Wazuh server AP
501461
# docker-compose up -d
502462
503463
Refer to :ref:`log in to the Wazuh server API via the command line <api_log_in>` to learn more.
464+
465+
Wazuh agent
466+
-----------
467+
468+
Running the Wazuh agent in a Docker container provides a lightweight option for integrations and for collecting logs via syslog, without installing the agent directly on a host. However, when deployed this way, the containerized agent cannot directly access or monitor the host system.
469+
470+
.. _agent_deployment_docker:
471+
472+
Deployment
473+
^^^^^^^^^^
474+
475+
Follow these steps to deploy the Wazuh agent using Docker.
476+
477+
#. Clone the `Wazuh Docker repository <https://github.com/wazuh/wazuh-docker>`_ to your system:
478+
479+
.. code-block:: console
480+
481+
# git clone https://github.com/wazuh/wazuh-docker.git -b v|WAZUH_CURRENT_DOCKER|
482+
483+
#. Navigate to the ``wazuh-docker/wazuh-agent/`` directory within your repository:
484+
485+
.. code-block:: console
486+
487+
# cd wazuh-docker/wazuh-agent
488+
489+
#. Edit the ``docker-compose.yml`` file. Replace ``<YOUR_WAZUH_MANAGER_IP>`` with the IP address of your Wazuh manager. Locate the environment section for the agent service and update it:
490+
491+
.. code-block:: yaml
492+
:emphasize-lines: 7
493+
494+
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
495+
services:
496+
wazuh.agent:
497+
image: wazuh/wazuh-agent:|WAZUH_CURRENT_DOCKER|
498+
restart: always
499+
environment:
500+
- WAZUH_MANAGER_SERVER=<WAZUH_MANAGER_IP>
501+
volumes:
502+
- ./config/wazuh-agent-conf:/wazuh-config-mount/etc/ossec.conf
503+
504+
#. Start the Wazuh agent deployment using ``docker-compose``:
505+
506+
- **Background**:
507+
508+
.. code-block:: console
509+
510+
# docker-compose up -d
511+
512+
- **Foreground**:
513+
514+
.. code-block:: console
515+
516+
# docker-compose up
517+
518+
#. Verify from your Wazuh dashboard that the Wazuh agent deployment was successful and visible. Navigate to the **Agent management** > **Summary**, and you should see the Wazuh agent container active on your dashboard.

0 commit comments

Comments
 (0)