# cymmetria/ciscoasa_honeypot architecture

> Architecture diagram of the GitHub repository cymmetria/ciscoasa_honeypot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cymmetria/ciscoasa_honeypot
- Repository: https://github.com/cymmetria/ciscoasa_honeypot

## Overview

##### Project type and purpose
- This is a low-interaction honeypot emulating a Cisco ASA management interface and IKE endpoint.
- Written in Python, it listens on configurable HTTP(S) and IKE ports to detect CVE-2018-0101 exploitation attempts and logs interactions locally or to an hpfeeds broker.

##### File structure
Top-level:
- Dockerfile, docker-compose.yml → containerized deployment
- asa_server.py → HTTP(S) honeypot server
- ike_server.py → IKE/UDP honeypot server
- gencert.py → self-signed cert generation
- requirements.txt → Python dependencies
- asa/ (static assets) → HTML pages, CSS, JS used to mimic the ASA web UI
- .python-version, .gitignore, LICENSE, README.md

##### README for additional insights
- Configurable host, ports, SSL enablement, certificate path or auto-gen.
- Optional hpfeeds logging parameters (can be set via CLI flags or environment).
- No external database—logging is either to console/files or forwarded to an hpfeeds server.

a. Main components
1. External Network (Attacker)
2. Docker Container / Host Machine
- Web Honeypot Service (asa_server.py)
- IKE Honeypot Service (ike_server.py)
- Certificate Generator (gencert.py)
- Static Asset Store (/asa directory)
- Logging Module
3. Optional External hpfeeds Broker
b. Relationships & data flows
- Attacker → TCP/UDP network → Docker container
– → HTTP(S) port → asa_server.py
– → IKE port → ike_server.py
- asa_server.py and ike_server.py call the Logging Module to record events
- Logging Module → (optional) hpfeeds Broker → downstream logging/analysis
c. Architectural patterns & principles
– Single-host, multi-process (or multi-thread) honeypot
– Clear separation: HTTP service vs. IKE service vs. logging
– Containerized deployment for isolation and reproducibility
d. Key technologies & frameworks
– Python 3 (asyncio or built-in HTTP server)
– Docker & docker-compose
– hpfeeds (network logging protocol)
– OpenSSL (via gencert.py)
– Static web assets (HTML/CSS/JS) to mimic ASA UI

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Network Entry
    Attacker["Attacker (Internet)"]:::endpoint

    %% Docker Container Boundary
    subgraph "Docker Container"
        direction TB
        WebService["asa_server.py (HTTP/HTTPS)\nTCP 80/443"]:::process
        IkeService["ike_server.py (IKE/UDP)\nUDP 500/4500"]:::process
        gencert["gencert.py\nSelf-signed cert gen"]:::process
        StaticAssets["Static Asset Store (/asa)"]:::storage
        LoggingModule["Logging Module"]:::process
        DockerfileNode["Dockerfile"]:::process
        Compose["docker-compose.yml"]:::process
        Requirements["requirements.txt"]:::process
        README["README.md"]:::process
    end

    %% External Logging
    hpfeeds["hpfeeds Broker (optional)"]:::external

    %% Data Flows
    Attacker --> WebService
    Attacker --> IkeService
    WebService --> LoggingModule
    IkeService --> LoggingModule
    LoggingModule --> hpfeeds
    WebService --> StaticAssets
    WebService -->|Use SSL| gencert
    gencert -->|Generate cert| WebService

    %% Click Events
    click WebService "https://github.com/cymmetria/ciscoasa_honeypot/blob/master/asa_server.py"
    click IkeService "https://github.com/cymmetria/ciscoasa_honeypot/blob/master/ike_server.py"
    click gencert "https://github.com/cymmetria/ciscoasa_honeypot/blob/master/gencert.py"
    click StaticAssets "https://github.com/cymmetria/ciscoasa_honeypot/tree/master/asa/"
    click DockerfileNode "https://github.com/cymmetria/ciscoasa_honeypot/tree/master/Dockerfile"
    click Compose "https://github.com/cymmetria/ciscoasa_honeypot/blob/master/docker-compose.yml"
    click Requirements "https://github.com/cymmetria/ciscoasa_honeypot/blob/master/requirements.txt"
    click README "https://github.com/cymmetria/ciscoasa_honeypot/blob/master/README.md"

    %% Styles
    classDef endpoint fill:#ADD8E6,stroke:#000
    classDef process fill:#D3D3D3,stroke:#000
    classDef storage fill:#FFFACD,stroke:#000
    classDef external fill:#90EE90,stroke:#000
```
