> For the complete documentation index, see [llms.txt](https://kchuene.gitbook.io/data-communication-project/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kchuene.gitbook.io/data-communication-project/setup/ubuntu-honeypot-server/wazuh-agent.md).

# Wazuh Agent

A containerized Wazuh Agent to collect logs from cowrie honeypot and forward them to Wazuh Manager.

## Clone Repository

{% code overflow="wrap" lineNumbers="true" %}

```
git clone https://github.com/wazuh/wazuh-docker.git -b v4.14.4
```

{% endcode %}

{% code overflow="wrap" lineNumbers="true" %}

```
cd wazuh-docker/wazuh-agent
```

{% endcode %}

## Setup and Configuration

**Create Honeypot group in Wazuh (Optional)**

Navigate to **Agent Management > Groups > Add new group** and provide `honeypot` for our group name.

**Compose configuration**

Edit `docker-compose.yml` file, replacing `<YOUR_WAZUR_MANAGER_IP>` placeholder, and mounting the `cowrie-logs` named volume

{% code overflow="wrap" lineNumbers="true" %}

```yaml
services:
  wazuh.agent:
    container_name: wazuh.agent
    image: wazuh/wazuh-agent:4.14.4
    restart: always
    environment:
      - WAZUH_MANAGER_SERVER=192.168.56.1
    volumes:
      - ./config/wazuh-agent-conf:/wazuh-config-mount/etc/ossec.conf
      - cowrie-logs:/var/log/:ro

volumes:
   cowrie-logs:
     name: cowrie-logs
     external: true
```

{% endcode %}

{% hint style="info" %}
Make sure to declare the `cowrie-logs` volume ass `external` so that docker looks for the existing volume instead of creating a new one.
{% endhint %}

{% hint style="warning" %}
**Don't** specify the Manager server in quotes. It will fail to connect.
{% endhint %}

**Cowrie log collection configuration**

Navigate to configuration for honeypot agent in the Wazuh Dashboard at **Agent Management > Groups > Action > Edit group configuration** and add for the appropriate group, i.e. `honeypot`.

{% code overflow="wrap" lineNumbers="true" %}

```xml
<agent_config>
    <!-- Shared agent configuration here -->
    
    <!-- Cowrie log collection -->
    <localfile>
      <log_format>json</log_format>
      <location>/var/log/cowrie.json</location>
    </localfile>
</agent_config>
```

{% endcode %}

{% hint style="info" %}
The host detections are disabled to reduce noise.
{% endhint %}

## Deploy

**Pull and Create + Run**

{% code overflow="wrap" lineNumbers="true" %}

```
sudo docker compose pull
sudo docker compose up -d
```

{% endcode %}

Navigate to **Agent Management > Summary** from the **Wazuh Dashboard** to confirm the agent connected.&#x20;

{% hint style="info" %}
Deploying the **Wazuh Agent** in a container prevents it from monitoring the host directly which is exactly what we want on the honeypot to avoid some noise.
{% endhint %}

**Add agent to group (Optional)**

Navigate to **Agent Management > Groups > honeypot > Manage Agents**

{% code overflow="wrap" lineNumbers="true" %}

```
https://localhost/app/endpoint-groups#/manager/?tab=groups&group=honeypot
```

{% endcode %}

and add the **Wazuh Agent** to the `honeypot`  group.&#x20;

{% embed url="<https://documentation.wazuh.com/current/deployment-options/docker/wazuh-container.html#wazuh-agent>" %}

{% embed url="<https://www.youtube.com/watch?v=S1t_c6KXwEY>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://kchuene.gitbook.io/data-communication-project/setup/ubuntu-honeypot-server/wazuh-agent.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
