knightsc / system_policy

osquery table extension that allows querying of information from the macOS private SystemPolicy.framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extension fails to load on any macOS version other than 10.14

knightsc opened this issue · comments

It would be nice to be able to uniformly deploy this extension to all macs and for the table to simply return empty results. Currently if you try to run this extension on 10.13 or any other version you get errors while loading.

osqueryi --extension=./legacy_exec_history.ext 
dyld: Symbol not found: _OBJC_CLASS_$_SPExecutionPolicy
  Referenced from:./legacy_exec_history.ext (which was built for Mac OS X 10.14)
  Expected in: /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy
 in ./legacy_exec_history.ext

This could be accomplished by using dl_open rather than statically linking the private SystemPolicy framework

Fixed by #2