Custom logger plugin is written using osquery-go. When the osquery daemon is auto-loaded with this extension, then the logs are received by the custom logger plugin.
But if the osqueryd is running as a daemon and custom logger plugin is run independently, then it is not receiving the logs from osqueryd.
If the osquery daemon is run using auto load extension, then the extension receives the FILE_EVENTS log.
When osqueryd and extension are running as separate process, then why isn't the osqueryd not redirecting the logs to extension?
Environment: MacOS Monterey. Have added both osquery and the custom logger extension in Security Preferences -> Full Disk Access
Generally, I would expect this pattern to work... However, I see a couple of things you did not discuss.
Running the extension registers it with osquery. As you point out, it's in the logs. You should be able to confirm this inside osquery, with select * from osquery_registry where registry = 'logger';
. (Note that you need to use osqueryi --connect
to connect to the socket of the osqueryd to see what's registered with it)
However, just being registered with osquery does not configure osquery to send logs there. You will also need to configure the logger appropriately. Take a look at the CLI flags --logger_plugin
and --extensions_require
. The former sets the logger to use, and the latter tells osquery to wait for an extension. Otherwise, osquery will try to configure the logger before your extension is in place.