This is impressive. Lots of code here. My personal preference is to put functionality into it's own library (could be header-only), with dedicated unit tests. Then the osquery changes are mainly glue that maps virtual tables to external library functionality (event publishers and subscribers). The plus being that it's easier to test standalone, and easier to port as osquery build structures change. Either way, nice work on this. I'll try to take a preliminary look .