Skip to content

Commit eafbcd5

Browse files
authored
Merge pull request #1636 from void-spark/main
First attempt at kea dhcp support
2 parents 2fac875 + 6d661dd commit eafbcd5

4 files changed

Lines changed: 630 additions & 0 deletions

File tree

docs/PLUGINS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Device-detecting plugins insert values into the `CurrentScan` database table. T
6262
| `INTRNT` | [internet_ip](https://github.com/netalertx/NetAlertX/tree/main/front/plugins/internet_ip/) | 🔍 | Internet IP scanner | | |
6363
| `INTRSPD` | [internet_speedtest](https://github.com/netalertx/NetAlertX/tree/main/front/plugins/internet_speedtest/) || Internet speed test | | |
6464
| `IPNEIGH` | [ipneigh](https://github.com/netalertx/NetAlertX/tree/main/front/plugins/ipneigh/) | 🔍 | Scan ARP (IPv4) and NDP (IPv6) tables | | |
65+
| `KEALSS` | [kea_api](https://github.com/netalertx/NetAlertX/tree/main/front/plugins/kea_api/) | 🔍/🆎 | Pull lease data from the Kea DHCP API | | |
6566
| `LUCIRPC` | [luci_import](https://github.com/netalertx/NetAlertX/tree/main/front/plugins/luci_import/) | 🔍 | Import connected devices from OpenWRT | | |
6667
| `MAINT` | [maintenance](https://github.com/netalertx/NetAlertX/tree/main/front/plugins/maintenance/) || Maintenance of logs, etc. | | |
6768
| `MQTT` | [_publisher_mqtt](https://github.com/netalertx/NetAlertX/tree/main/front/plugins/_publisher_mqtt/) | ▶️ | MQTT for synching to Home Assistant | | |

front/plugins/kea_api/README.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
## Overview
2+
3+
A plugin allowing for importing devices from the Kea DHCP API.
4+
https://www.isc.org/kea/
5+
6+
And specifically:
7+
https://kea.readthedocs.io/en/kea-2.6.3/api.html#lease4-get-all
8+
9+
10+
### Usage
11+
12+
To enable the API, first you want to add something like this to your main kea configuration (this is for debian 13):
13+
14+
```json
15+
"control-socket": {
16+
"socket-type": "unix",
17+
"socket-name": "/run/kea/kea4-ctrl-socket"
18+
},
19+
20+
"hooks-libraries": [
21+
{
22+
"library": "/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_lease_cmds.so"
23+
}
24+
],
25+
```
26+
27+
28+
And you need to install kea-ctrl-agent, with a config that looks something like this:
29+
30+
```json
31+
{
32+
"Control-agent": {
33+
"http-host": "127.0.0.1",
34+
"http-port": 8000,
35+
36+
"authentication": {
37+
"type": "basic",
38+
"realm": "Kea Control Agent",
39+
"directory": "/etc/kea",
40+
"clients": [
41+
{
42+
"user": "kea-api",
43+
"password-file": "kea-api-password"
44+
}
45+
]
46+
},
47+
"control-sockets": {
48+
"dhcp4": {
49+
"socket-type": "unix",
50+
"socket-name": "/run/kea/kea4-ctrl-socket"
51+
}
52+
},
53+
"loggers": [
54+
{
55+
"name": "kea-ctrl-agent",
56+
"output-options": [
57+
{
58+
"output": "stdout",
59+
"pattern": "%-5p %m\n"
60+
}
61+
],
62+
"severity": "INFO",
63+
"debuglevel": 0
64+
}
65+
]
66+
}
67+
}
68+
```
69+
70+
You will need to configure the plugin with the URL to the API, and the username and password configured above (from kea-api-password file in the example)
71+
72+
73+
#### Required Settings
74+
75+
These settings are required, besides the common device scanner settings:
76+
77+
- **Kea Control Agent URL** (`KEALSS_URL`): The full URL, including port number, to the Kea API.
78+
- Default: `http://127.0.0.1:8000`
79+
- This mirrors what you set up in the kea-ctrl-agent configuration.
80+
81+
- **Basic Auth Username** (`KEALSS_USER`): The user to use for authenticating with the Kea API.
82+
- Default: `kea-api`
83+
- This mirrors what you set up in the kea-ctrl-agent configuration.
84+
85+
- **Basic Auth Password** (`KEALSS_PASS`): The password to use for authenticating with the Kea API.
86+
- This mirrors what you set up in the kea-ctrl-agent configuration.
87+
- When using a password file, it should be the content of the password file.
88+
89+
90+
### Notes
91+
92+
- This was tested on a basic Debian 13 install.
93+
- When you install kea-ctrl-agent, it should ask you about creating a password.
94+
- It's possible to run kea-ctrl-agent without password, but it's not recommended and at the moment we don't support that.
95+
- I may provide some minimal support, if you ask nicely :)
96+
97+
- Version: 1.0.0
98+
- Author: `void-spark`
99+
- Release Date: `11/05/2026`

0 commit comments

Comments
 (0)