> 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/archive/honeypots.md).

# Honeypots

Installation of the honeypot services, Cowrie, Elasticpot and Dionaea with the aid of docker compose.

## Pre-Configurations

**Docker compose configuration**

`compose.yaml`:

```yaml
name: Honeynet

services:
   cowrie:
      image: cowrie/cowrie:latest
      restart: always
      ports:
         - "22:2222"
      volumes:
         - cowrie-configs:/cowrie/cowrie-git/etc/
         - cowrie-logs:/cowrie/cowrie-git/var/log/cowrie/

   dionaea:
      image: dtagdevsec/dionaea:24.04.1 # T-Pot dionaea
      restart: always
      ports:
         - "21:21"
         - "80:80"
         - "443:443"
         - "3306:3306"
      volumes:
         - dionaea-configs:/etc/dionaea/
         - dionaea-logs:/var/log/dionaea/

   elasticpot:
      image: dtagdevsec/elasticpot:24.04.1 # T-Pot elasticpot
      restart: always
      volumes:
         - elasticpot-configs:/etc/elasticpot
      ports:
         - "9200:9200"
      env_file:
         - elasticpot.env  

   fluentbit:
      image: fluent/fluent-bit:5.0.0-amd64
      restart: always
      volumes:
         - ./fluent-bit-config/fluent-bit.yaml:/fluent-bit/etc/fluent-bit.yaml  
         - cowrie-logs:/fluent-bit/log/                
      depends_on:
         - cowrie
         - dionaea
         - elasticpot

volumes:
   ## Named volumes
   cowrie-configs:
   cowrie-logs:
   dionaea-configs:
   dionaea-logs:
   elasticpot-configs:
   elasticpot-logs:
```

{% hint style="warning" %}
Use trusted, i.e. <mark style="color:purple;">**Sponsored OSS**</mark> images, otherwise - aside from security - you will have a hard time getting them to work before you eventually give up (learnt the hard way).
{% endhint %}

**Elasticpot environment configuration**

`elasticpot.env`:

```
# This can be modified to change the default setup of the unattended installation

DEBUG=false

# IP Address of the honeypot
# Leaving this blank will default to the docker container IP
IP_ADDRESS=

# CHN Server api to register to
CHN_SERVER=

# Server to stream data to
FEEDS_SERVER=
FEEDS_SERVER_PORT=

# Deploy key from the FEEDS_SERVER administrator
# This is a REQUIRED value
DEPLOY_KEY=elesticpot-lab-service

# Registration information file
# If running in a container, this needs to persist
ELASTICPOT_JSON=/etc/elasticpot/elasticpot.json

# Comma separated tags for honeypot
TAGS=
```

## Installation

**Docker compose**

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

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

{% endcode %}

## Communications

**Fluent Bit Configuration**

`fluent-bit.conf`: For forwarding collected logs to remote `fluentd` instance.

```
[SERVICE]
   Flush 5
   Daemon off
   Log_Level info

[INPUT]
   Name tail
   Tag cowrie
   Path /fluent-bit/log/cowrie.json # A bind mount to local ~/logs/cowrie.json
   
[OUTPUT]
   Name forward
   Match *
   Host 192.168.56.1
   Port 9880
```

{% hint style="info" %}
Unless you know your way around `yaml` well, I suggest sticking to the classic `.conf` configurations for **Fluent Bit**.
{% endhint %}

**Save configuration for Host Bind volume to docker container**

{% code overflow="wrap" %}

```
mkdir fluentbit-config
```

{% endcode %}

{% code overflow="wrap" %}

```
cp fluent-bit.yaml fluentbit-config/
```

{% endcode %}

{% embed url="<https://docs.fluentbit.io/manual/administration/configuring-fluent-bit/classic-mode/configuration-file>" %}

{% embed url="<https://hub.docker.com/r/cowrie/cowrie>" %}

{% embed url="<https://hub.docker.com/r/dtagdevsec/dionaea>" %}

{% embed url="<https://hub.docker.com/r/dtagdevsec/elasticpot>" %}

{% embed url="<https://docs.cowrie.org/en/latest/docker/README.html#docker-quick-start>" %}

{% embed url="<https://dionaea.readthedocs.io/en/0.9.0/old/configuration.html>" %}

{% embed url="<https://communityhoneynetwork.readthedocs.io/en/latest/elasticpot/>" %}


---

# 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/archive/honeypots.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.
