Migrating from ISC-dhcpd to ISC-kea

I found myself needing to do an import of several /24 subnets into our new ISC-Kea servers and was unable to find an existing solution. So i wrote a quick and dirty importer that accepts isc-dhcp conf files, pulls all the required reservation info (does not include options and other non-essential data) and puts it directly into the kea postgres host database. There is an existing project that uses the isc-kea web / stork web api to convert memfile to db and one to convert the dhcpd.conf file into the kean.conf file json format, but nothing for importing from dhcpd.conf to a database. You can check it out on my GitHub page here: https://github.com/slapplebags/ipv4-dhcpd-to-kea

Additionally I wanted to get AD / LDAP auth working with isc-stork, the web front end for isc-kea and had some difficulty with the very spartan documentation. Rather than LDAP I am using Samba4 as an Active Directory domain so some settings are specific to that. Below is a working config, note that the lines starting with # are commented out as i am not using them or they don’t work as expected.First you’ll need to install the isc-stork-server-hook-ldap package or from sources, then add the following (modified for your environment) to /etc/stork/server.env

### LDAP / AD auth settings
STORK_SERVER_HOOK_LDAP_URL=ldap://127.0.0.1:389
STORK_SERVER_HOOK_LDAP_ROOT=dc=foo,dc=bar,dc=com
STORK_SERVER_HOOK_LDAP_BIND_USERNAME=stork(,ou=services (this is only needed if your bind account is in a different ou from your users)
STORK_SERVER_HOOK_LDAP_BIND_PASSWORD=password
STORK_SERVER_HOOK_LDAP_SKIP_SERVER_TLS_VERIFICATION=true
STORK_SERVER_HOOK_LDAP_GROUP_ALLOW=StorkAdmins
STORK_SERVER_HOOK_LDAP_MAP_GROUPS=true
#STORK_SERVER_HOOK_LDAP_DEBUG=true
#STORK_SERVER_HOOK_LDAP_GROUP_ADMIN=cn=StorkAdmins,ou=Users,dc=foo,dc=bar,dc=com (as of 1.16.0 this does not work, you have to create a group with the default name: stork-admin)
#STORK_SERVER_HOOK_LDAP_GROUP_SUPER_ADMIN=cn=StorkAdmins,ou=GRIT Users,dc=grit,dc=ucsb,dc=edu(as of 1.16.0 this does not work, you have to create a group with the default name: stork-super-admin)
STORK_SERVER_HOOK_LDAP_OBJECT_CLASS_GROUP=group #AD specific
STORK_SERVER_HOOK_LDAP_OBJECT_CLASS_GROUP_MEMBER=member #AD specific
#STORK_SERVER_HOOK_LDAP_OBJECT_CLASS_GROUP_COMMON_NAME=
#STORK_SERVER_HOOK_LDAP_OBJECT_CLASS_USER=
STORK_SERVER_HOOK_LDAP_OBJECT_CLASS_USER_ID=sAMAccountName #AD specific
#STORK_SERVER_HOOK_LDAP_OBJECT_CLASS_USER_FIRST_NAME=
#STORK_SERVER_HOOK_LDAP_OBJECT_CLASS_USER_LAST_NAME=
#STORK_SERVER_HOOK_LDAP_OBJECT_CLASS_USER_EMAIL=

With this config i am able to have members of the StorkAdmins group (and the stork-admin group) login and manage isc-kea dhcp via the stork web ui. There is a ticket in for the group mapping issues: https://gitlab.isc.org/isc-projects/stork/-/issues/1369.

Leave a Reply

Your email address will not be published. Required fields are marked *