Configuring HoneyDB Agent¶
There are two configuration files for HoneyDB Agent, The default location for both files is /etc/honeydb. The main configuration file is agent.conf, and the services configuration file is services.conf.
Agent Configuration¶
In the agent.conf file, the main configuration section is the [agent] section and actually only has one option to configure.
| Name | Description |
|---|---|
| nodename | Name for this agent node. |
| logging | Yes or no, to enable agent logging. Default is No. |
| ip_address | remote or local, method agent uses to determine its IP address. When agent is behind a NAT gateway, using remote will apply the gatway's public facing IP instead of the agent host's internal private IP. |
| state_dir | Optional. Writable directory for data the agent generates once and keeps: the per-agent crypto lure store (crypto-lures.json, mode 0600) and the default TLS certificate and key (default-tls.cert, default-tls.key). The directory also holds the LND_tcp and Electrum_tcp certificates (lnd-tls.cert, lnd-tls.key, electrum-tls.cert, electrum-tls.key), and from 2.11.0 the SupermarketFridgeController_tcp certificate (danfoss-sm800a-tls.cert, danfoss-sm800a-tls.key). Defaults to the directory holding agent.conf. If the directory is not writable, the lures are regenerated on each start and the certificate falls back to the system temp directory. Requires HoneyDB Agent 2.10.0 or later. |
Note
The logging option above relates to the honeydb-agent's operational activity, not events collected from honeypot interaction.
Limiting expensive handshakes¶
Requires HoneyDB Agent 2.11.3 or later. All services of an agent share one thread, so a client that makes one service do a lot of computing slows every service. The one handshake that costs enough to matter is the finite-field Diffie-Hellman key exchange of SSH_tcp: about 0.1 seconds of CPU for an 8192-bit group on a typical x86_64 host, and 0.5 to 1 second on a low-end ARM board. The optional [handshake-limit] section bounds the time spent on it. The limit is off by default. To turn it on, add the section; only enabled = Yes is required.
[handshake-limit]
enabled = Yes
source_cpu_percent = 10
source_burst_seconds = 1.0
global_cpu_percent = 50
global_burst_seconds = 2.0
| Name | Default | Description |
|---|---|---|
| enabled | No | Yes turns the limit on. |
| source_cpu_percent | 10 | Sustained share of the agent's service thread that one source address may spend on these handshakes. On a typical x86_64 host, 10 allows about 0.8 handshakes per second with an 8192-bit group, 3 with a 4096-bit group or 10 with a 2048-bit group. |
| source_burst_seconds | 1.0 | Time one source may spend at once before the sustained rate applies: about 8 handshakes with an 8192-bit group. |
| global_cpu_percent | 50 | Sustained share for all sources together. |
| global_burst_seconds | 2.0 | Burst for all sources together. |
How it behaves:
- The time each handshake really took is measured and charged, so the limit follows the hardware and the group size the client asked for.
- When a source's budget, or the agent-wide one, is spent, the next such handshake is dropped: the connection is closed, and an
ssh_kex_throttledINFO event reports it (at most one per source per minute). - Elliptic-curve key exchanges, which most SSH scanners and brute-force tools use, are never counted or dropped. TLS handshakes are not counted either; they cost under a millisecond.
- Clients behind one address (NAT, proxy) share one budget. IPv6 clients are grouped by /64.
- While the agent-wide budget is spent, these handshakes are dropped for every source.
- A tool that supports only finite-field methods and connects faster than the sustained rate loses the excess connections. Raise
source_cpu_percentif capturing such tools matters more to you than the responsiveness of other services. - A missing or invalid value uses its default and is logged at startup. The agent log states the effective setting in a line starting
Handshake limit:.
Configuring HoneyDB Agent Keys¶
To capture and view events you must configure your agent keys with the agent. Once configured, you'll be able to view events in the honeydb dashboard.
You will need a HoneyDB API ID and HoneyDB Agent Sensor API key. These keys can be generated by creating an account on the HoneyDB website. Once you have keys, edit the [honeydb] section in the agent.conf file, see example below:
[honeydb]
enabled = Yes
api_id = abcd1234
api_key = 4321dcba
Service Configuration¶
The service.conf file tells HoneyDB Agent which services to launch. The service configuration file is used to define service names, ports, and plugins to run on your honeypot. Each service defined in the file has an enabled option. This option can be set to Yes or No to determine which services run when the honeydb-agent is started.
Example service definition:
[FTP]
plugin = FTP_tcp
low_port = tcp:21
port = tcp:21
description = FTP service.
enabled = Yes
Explination of service definition:
[FTP] - The service name. You can set your own service name, however service names must not contain spaces.
plugin = FTP_tcp - The service plugin. The plugin specified determines what protocol emulation to implement.
low_port = tcp:21 - This value is used as a reference in scenarios where port forwarding with iptables is required. The protocol (TCP or UDP) and port the host will listen on for this service.
port = tcp:21 - The protocol (TCP or UDP) and port number to use when starting the service.
Note
If you are not implementing port forwarding with iptables, low_port and port should have the same values.
description = FTP service. - The description of the service.
enabled = Yes - Yes or No, tells honeydb-agent if the service should run or not.
tls = Yes - Optional. Wraps the TCP port of this service in TLS. By default the agent presents its own self-signed certificate: RSA-2048 with SHA-256, CN=localhost (the subject carries no host name or address) and a ten-year validity. The certificate is generated once and kept as default-tls.cert and default-tls.key in the agent's state_dir. It is regenerated automatically when it is missing, expired, mismatched or weak, when either file is a symlink or is not owned by the agent user, when the key is accessible to group or other, when the certificate is writable by group or other, or when only one of the two files is present; delete the two files to force a new one. LND_tcp and Electrum_tcp present their own certificates instead, as does SupermarketFridgeController_tcp with the danfoss persona (HoneyDB Agent 2.11.0 or later). RDP_tcp StartTLS also uses the default certificate, whatever tls says. From HoneyDB Agent 2.11.2, listeners that present the default certificate (tls = Yes services and RDP_tcp StartTLS) accept TLS 1.0 and TLS 1.1 clients as well as TLS 1.2 and 1.3, so that old bots, scanners and RDP clients are captured; earlier versions refused them. There is no option for this. Modern clients negotiate the same version and cipher suite as before, and a vulnerability scanner pointed at your agent will now report legacy TLS on these ports. The plugins that present their own certificate (LND_tcp, Electrum_tcp, and SupermarketFridgeController_tcp with the danfoss persona) still require TLS 1.2 or later. SSLv3, 3DES and RC4 are not available. The option applies to TCP services only. The tls option itself predates 2.10.0, which presented an RSA-1024, SHA-1 certificate with CN=<hostname> kept in the system temp directory; the persisted RSA-2048 default certificate and state_dir require HoneyDB Agent 2.10.0 or later.
Plugin-specific service options, such as persona, are set in the same service section and are documented with each plugin in Plugins.
Note
The default services.conf file comes with all services pre-configured. Review this file to see what plugins are available.