2014-08-30 10:17:52 +00:00
|
|
|
if(APPLE)
|
2015-04-09 04:28:24 +00:00
|
|
|
file(GLOB OSQUERY_OBJC_TABLES "*/darwin/*.mm")
|
2015-05-20 20:27:53 +00:00
|
|
|
ADD_OSQUERY_OBJCXX_LIBRARY_ADDITIONAL(osquery_tables_objc
|
2015-04-09 04:28:24 +00:00
|
|
|
${OSQUERY_OBJC_TABLES}
|
2014-08-30 10:17:52 +00:00
|
|
|
)
|
2014-08-30 10:24:35 +00:00
|
|
|
|
2015-04-09 04:28:24 +00:00
|
|
|
file(GLOB OSQUERY_DARWIN_TABLES "*/darwin/*.cpp")
|
2015-05-20 20:27:53 +00:00
|
|
|
ADD_OSQUERY_LIBRARY_ADDITIONAL(osquery_tables_darwin
|
2015-04-09 04:28:24 +00:00
|
|
|
${OSQUERY_DARWIN_TABLES}
|
2014-08-30 10:24:35 +00:00
|
|
|
)
|
2014-09-06 01:12:37 +00:00
|
|
|
|
2015-11-02 00:53:47 +00:00
|
|
|
file(GLOB OSQUERY_DARWIN_TABLES_TESTS "*/darwin/tests/*.cpp" "*/darwin/tests/*.mm")
|
2015-05-20 17:50:25 +00:00
|
|
|
ADD_OSQUERY_TABLE_TEST(${OSQUERY_DARWIN_TABLES_TESTS})
|
2015-05-20 20:27:53 +00:00
|
|
|
|
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("-framework CoreFoundation")
|
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("-framework Security")
|
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("-framework OpenDirectory")
|
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("-framework DiskArbitration")
|
2015-08-29 09:01:57 +00:00
|
|
|
|
2016-02-07 02:50:03 +00:00
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("libresolv.dylib")
|
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("libarchive.dylib")
|
2015-09-02 23:05:48 +00:00
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("magic")
|
2015-12-04 04:04:46 +00:00
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("tsk")
|
2014-11-13 20:00:41 +00:00
|
|
|
elseif(FREEBSD)
|
2015-04-09 04:28:24 +00:00
|
|
|
file(GLOB OSQUERY_FREEBSD_TABLES "*/freebsd/*.cpp")
|
2015-05-20 20:27:53 +00:00
|
|
|
ADD_OSQUERY_LIBRARY_ADDITIONAL(osquery_tables_freebsd
|
2015-04-09 04:28:24 +00:00
|
|
|
${OSQUERY_FREEBSD_TABLES}
|
2014-11-13 20:00:41 +00:00
|
|
|
)
|
2015-04-27 09:12:58 +00:00
|
|
|
|
|
|
|
file(GLOB OSQUERY_FREEBSD_TABLES_TESTS "*/freebsd/tests/*.cpp")
|
|
|
|
ADD_OSQUERY_TABLE_TEST(${OSQUERY_FREEBSD_TABLES_TESTS})
|
2015-05-29 04:27:10 +00:00
|
|
|
|
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("procstat")
|
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("util")
|
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("kvm")
|
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("elf")
|
2015-09-24 23:12:26 +00:00
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("magic")
|
2014-09-05 14:54:41 +00:00
|
|
|
else()
|
2015-04-09 04:28:24 +00:00
|
|
|
file(GLOB OSQUERY_LINUX_TABLES "*/linux/*.cpp")
|
2015-05-20 20:27:53 +00:00
|
|
|
ADD_OSQUERY_LIBRARY_ADDITIONAL(osquery_tables_linux
|
2015-04-09 04:28:24 +00:00
|
|
|
${OSQUERY_LINUX_TABLES}
|
2014-09-05 14:54:41 +00:00
|
|
|
)
|
2014-10-29 05:59:25 +00:00
|
|
|
|
2015-04-27 09:12:58 +00:00
|
|
|
file(GLOB OSQUERY_LINUX_TABLES_TESTS "*/linux/tests/*.cpp")
|
|
|
|
ADD_OSQUERY_TABLE_TEST(${OSQUERY_LINUX_TABLES_TESTS})
|
|
|
|
|
2016-03-18 22:11:05 +00:00
|
|
|
if(REDHAT_BASED)
|
2014-12-31 17:33:19 +00:00
|
|
|
# CentOS specific tables
|
2015-04-09 04:28:24 +00:00
|
|
|
file(GLOB OSQUERY_REDHAT_TABLES "*/centos/*.cpp")
|
2015-05-20 20:27:53 +00:00
|
|
|
ADD_OSQUERY_LIBRARY_ADDITIONAL(osquery_tables_redhat
|
2015-04-09 04:28:24 +00:00
|
|
|
${OSQUERY_REDHAT_TABLES}
|
2014-12-31 17:33:19 +00:00
|
|
|
)
|
2014-12-30 22:24:49 +00:00
|
|
|
|
2015-05-20 20:27:53 +00:00
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("rpm rpmio")
|
2016-03-04 20:06:42 +00:00
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("cryptsetup devmapper")
|
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("libselinux.so")
|
2016-03-18 22:11:05 +00:00
|
|
|
elseif(DEBIAN_BASED)
|
2014-12-31 18:06:54 +00:00
|
|
|
# Ubuntu specific tables
|
2015-04-09 04:28:24 +00:00
|
|
|
file(GLOB OSQUERY_UBUNTU_TABLES "*/ubuntu/*.cpp")
|
2015-05-20 20:27:53 +00:00
|
|
|
ADD_OSQUERY_LIBRARY_ADDITIONAL(osquery_tables_ubuntu
|
2015-04-09 04:28:24 +00:00
|
|
|
${OSQUERY_UBUNTU_TABLES}
|
2014-12-31 18:06:54 +00:00
|
|
|
)
|
|
|
|
|
2016-03-18 22:11:05 +00:00
|
|
|
# libdpkg API is volitile and suffers breaking changes.
|
|
|
|
# We need to find and pass in the libdpkg version via pkg-config
|
|
|
|
find_package(Libdpkg REQUIRED)
|
|
|
|
add_definitions(-DLIBDPKG_VERSION=${LIBDPKG_VERSION_NUMBER})
|
2015-10-15 07:02:49 +00:00
|
|
|
|
2016-03-11 03:36:52 +00:00
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("apt-pkg dpkg liblzma.so")
|
2016-03-04 20:06:42 +00:00
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("cryptsetup libdevmapper.so")
|
2014-12-23 19:39:03 +00:00
|
|
|
endif()
|
|
|
|
|
2016-03-04 20:06:42 +00:00
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("libgcrypt.so")
|
2016-02-07 02:50:03 +00:00
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("libresolv.so")
|
2015-05-20 20:27:53 +00:00
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("blkid")
|
2015-05-24 01:52:42 +00:00
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("libuuid.so")
|
2015-05-20 20:27:53 +00:00
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("ip4tc")
|
2015-09-02 23:05:48 +00:00
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("libmagic.so")
|
2015-12-04 04:04:46 +00:00
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("tsk")
|
2014-08-30 10:17:52 +00:00
|
|
|
endif()
|
|
|
|
|
2015-06-29 21:45:31 +00:00
|
|
|
file(GLOB OSQUERY_CROSS_APPLICATIONS_TABLES "applications/*.cpp")
|
|
|
|
file(GLOB OSQUERY_CROSS_SYSTEM_TABLES "system/*.cpp")
|
|
|
|
file(GLOB OSQUERY_CROSS_NETWORKING_TABLES "networking/*.cpp")
|
2015-12-04 04:04:46 +00:00
|
|
|
file(GLOB OSQUERY_CROSS_FORENSIC_TABLES "forensic/*.cpp")
|
2015-09-24 23:12:26 +00:00
|
|
|
if(APPLE OR LINUX)
|
|
|
|
file(GLOB OSQUERY_CROSS_EVENTS_TABLES "events/*.cpp")
|
|
|
|
else()
|
|
|
|
set(OSQUERY_CROSS_EVENTS_TABLES "")
|
|
|
|
endif()
|
2015-05-20 20:27:53 +00:00
|
|
|
ADD_OSQUERY_LIBRARY_ADDITIONAL(osquery_tables
|
2015-06-29 21:45:31 +00:00
|
|
|
${OSQUERY_CROSS_APPLICATIONS_TABLES}
|
|
|
|
${OSQUERY_CROSS_SYSTEM_TABLES}
|
|
|
|
${OSQUERY_CROSS_NETWORKING_TABLES}
|
|
|
|
${OSQUERY_CROSS_EVENTS_TABLES}
|
2015-12-04 04:04:46 +00:00
|
|
|
${OSQUERY_CROSS_FORENSIC_TABLES}
|
2015-05-07 04:58:23 +00:00
|
|
|
)
|
2014-08-17 08:44:22 +00:00
|
|
|
|
2015-09-23 18:03:24 +00:00
|
|
|
file(GLOB OSQUERY_CROSS_TABLES_TESTS "[!uo]*/tests/*/*.cpp")
|
|
|
|
file(GLOB OSQUERY_CATEGORY_TABLE_TESTS "[!uo]*/tests/*.cpp")
|
|
|
|
file(GLOB OSQUERY_TABLE_TESTS "tests/*.cpp")
|
|
|
|
ADD_OSQUERY_TABLE_TEST(
|
|
|
|
${OSQUERY_CROSS_TABLES_TESTS}
|
|
|
|
${OSQUERY_CATEGORY_TABLE_TESTS}
|
|
|
|
${OSQUERY_TABLE_TESTS}
|
|
|
|
)
|
2015-04-27 09:12:58 +00:00
|
|
|
|
2015-04-09 04:28:24 +00:00
|
|
|
file(GLOB OSQUERY_UTILITY_TABLES "utility/*.cpp")
|
2015-05-20 20:27:53 +00:00
|
|
|
ADD_OSQUERY_LIBRARY_CORE(osquery_tables_utility
|
2015-04-09 04:28:24 +00:00
|
|
|
${OSQUERY_UTILITY_TABLES}
|
2014-12-24 04:07:12 +00:00
|
|
|
)
|
|
|
|
|
2015-05-07 04:58:23 +00:00
|
|
|
if(NOT FREEBSD)
|
2015-06-01 22:53:52 +00:00
|
|
|
file(GLOB OSQUERY_UTILS "other/*.cpp")
|
2015-05-20 20:27:53 +00:00
|
|
|
ADD_OSQUERY_LIBRARY_ADDITIONAL(osquery_utils
|
2015-05-07 04:58:23 +00:00
|
|
|
${OSQUERY_UTILS}
|
|
|
|
)
|
2015-04-17 20:03:43 +00:00
|
|
|
|
2015-06-01 22:53:52 +00:00
|
|
|
file(GLOB OSQUERY_UTILS_TESTS "other/tests/*.cpp")
|
2015-05-20 20:27:53 +00:00
|
|
|
ADD_OSQUERY_TEST_ADDITIONAL(${OSQUERY_UTILS_TESTS})
|
2015-05-07 04:58:23 +00:00
|
|
|
endif()
|