> 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/detection-and-response/cowrie.md).

# Cowrie

Configuring Cowrie detection rules.

Navigate to **System Management > Rules > Manage Rules > Custom Rules** and edit the `local_rules.xml` file to add custom rules.

## Log Testing

The following sample log from **Cowrie SSH** can help create custom rules to trigger alert in **Wazuh Dashboard**.

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

```
{"eventid":"cowrie.login.failed","username":"root","fingerprint":"47:d2:9a:1b:98:f1:9d:f3:23:e7:05:c8:40:7b:f7:87","key":"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILfY9Ddo8dsKSAHkaI3N6WGhU+4mHF/Qu1/m1VpuNYOb","type":"ssh-ed25519","message":"public key login attempt for [root] failed","sensor":"3a4c9b95ef71","uuid":"bafc61de-32ec-11f1-a37e-46de337b5ff9","timestamp":"2026-05-02T17:41:51.080946Z","src_ip":"192.168.56.1","session":"b4cccabed562","protocol":"ssh"}

{"eventid":"cowrie.login.success","username":"root","password":"","message":"login attempt [root/] succeeded","sensor":"3a4c9b95ef71","uuid":"bafc61de-32ec-11f1-a37e-46de337b5ff9","timestamp":"2026-05-02T17:41:56.771416Z","src_ip":"192.168.56.1","session":"b4cccabed562","protocol":"ssh"}

{"eventid":"cowrie.client.version","version":"SSH-2.0-OpenSSH_9.6p1 Ubuntu-3ubuntu13.16","message":"Remote SSH version: SSH-2.0-OpenSSH_9.6p1 Ubuntu-3ubuntu13.16","sensor":"3a4c9b95ef71","uuid":"bafc61de-32ec-11f1-a37e-46de337b5ff9","timestamp":"2026-05-02T17:41:51.055987Z","src_ip":"192.168.56.1","session":"b4cccabed562","protocol":"ssh"}

{"eventid":"cowrie.command.input","input":"uname -a ","message":"CMD: uname -a ","sensor":"3a4c9b95ef71","uuid":"bafc61de-32ec-11f1-a37e-46de337b5ff9","timestamp":"2026-05-02T17:42:14.904269Z","src_ip":"192.168.56.1","session":"b4cccabed562","protocol":"ssh"}

{"eventid":"cowrie.session.closed","duration":"202.8","message":"Connection lost after 202.8 seconds","sensor":"3a4c9b95ef71","uuid":"bafc61de-32ec-11f1-a37e-46de337b5ff9","timestamp":"2026-05-02T17:45:13.826427Z","src_ip":"192.168.56.1","session":"b4cccabed562","protocol":"ssh"}
```

{% endcode %}

{% hint style="info" %}
Failed login attempts might not be very useful especially with bots around, but can be good for detecting patterns of commonly use passwords to update the cowrie **UserDB.**
{% endhint %}

**Successful Login Attempts Rule**

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

```xml
<group name="honeypot">
    <!-- Successful Login -->
    <rule id="100003" level="3">
        <decoded_as>json</decoded_as>
        <field name="eventId">cowrie.login.success</field>
        <description>Successful login on cowrie.</description>
    </rule>
</group>
```

{% endcode %}

**Command Execution (Log Attacker Behaviour) Rule**

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

```xml
<group name="honeypot">
    <!-- Command Execution -->
    <rule id="100004" level="14">
        <decoded_as>json</decoded_as>
        <field name="eventId">cowrie.command.input</field>
        <description>Command execution on cowrie.</description>
    </rule>
</group>
```

{% endcode %}

{% hint style="info" %}
Note that the `eventId` field is parsed from the (sample) **Cowrie** log output.&#x20;
{% endhint %}

{% embed url="<https://documentation.wazuh.com/current/user-manual/capabilities/active-response/how-to-configure.html>" %}

{% embed url="<https://documentation.wazuh.com/current/user-manual/capabilities/active-response/default-active-response-scripts.html>" %}

{% embed url="<https://documentation.wazuh.com/current/user-manual/ruleset/rules/rules-classification.html>" %}


---

# 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/detection-and-response/cowrie.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.
