DataSoft/Nova — Issue #64: Implement DHCP/Honeyd IP sharing
Author: PherricOxide
Created: 2012-02-23 01:59:42+00:00
State: open

Nova needs to figure out what DHCP leases are active for the Honeyd nodes. I looked into doing a plugin, but it's not really worth it unless we want to turn the entire haystack process into a honeyd plugin. Otherwise we'd need a plugin that hooks into a DHCP update function, and then uses IPC to talk back to the haystack (new build project for the plugin, new thread in haystack, the plugin itself, the dhcp hooks in honeyd).

The log files currently don't have anything DHCP related. The output seen on the terminal does have information such as,
honeyd[18987]: [eth0] trying DHCP
honeyd[18987]: [eth0] got DHCP offer: 192.168.10.93
honeyd[18987]: Updating ARP binding: 80:80:80:80:80:80 -> 192.168.10.93

However, these are debug print messages not logged to a file and only shown if honeyd is in non-daemon mode. We could extract them form stdout for the noTerminal processes easy, but running honeyd inside of gnome-terminal makes that too much of a pain to bother with.

For now I think the best implementation is to modify honeyd to write out node IP and MAC addresses to a file everytime they change. This file could be parsed by a haystack thread every now and then for changes. This could cause some race conditions with multiple processes trying to access the same file, so we'd have to be careful with that (write to a temp file then mv that to the real file to make sure the haystack gets all or nothing when reading and not a partially written file).