Stefano Bonicatti
02/15/2020, 12:40 PMPrateek Kumar Nischal
02/15/2020, 12:58 PM$ git br
* extension_porting_4.0.1 6c0f9b3 [origin/extension_porting_4.0.1] Other cleanups
master 9a6be96 [origin/master] Improve build instructions (#49)
PS: I have removed all extensions for now.. I am just using the darwin_unified_log
. Also, modified the submodule config to only include json11.$ make externals
Built target externals
Exits at thisStefano Bonicatti
02/15/2020, 1:02 PMPrateek Kumar Nischal
02/15/2020, 1:04 PMStefano Bonicatti
02/15/2020, 1:06 PMcmake -DOSQUERY_TOOLCHAIN_SYSROOT=...
from the build folder, what was the whole outputPrateek Kumar Nischal
02/15/2020, 1:07 PM# Download source
git clone <https://github.com/osquery/osquery>
cd osquery
# Configure
mkdir build; cd build
cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 ..
# Build
cmake --build .
and this runs fine..$ cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 ..
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.16)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/p0n002h/git/osquery
Stefano Bonicatti
02/15/2020, 1:11 PMexternals
target indeed doesn't trigger the build, I'll try to understand why, though those messages you see during configuration are not a good sign.
How exactly did you remove the other extensions etc?Prateek Kumar Nischal
02/15/2020, 1:13 PMcmake --build .
is throwing missing openssl cmake file errors..
make[2]: *** No rule to make target `installed_formulas/openssl/lib/libssl.a', needed by `osquery/osqueryd'. Stop.
make[1]: *** [osquery/CMakeFiles/osqueryd.dir/all] Error 2
make: *** [all] Error 2
Stefano Bonicatti
02/15/2020, 1:31 PMTRAILOFBITS_EXTENSIONS_TO_BUILD
; this is mentioned in the README too.externals
target right now only triggers the build of extensions that do not have their own CMakeLists.txttrailofbits_osquery_extensions.ext
target.
You can find that by running make help | grep trailofbits
Prateek Kumar Nischal
02/15/2020, 1:39 PMTRAILOFBITS_EXTENSIONS_TO_BUILD
, the reason of deleting the other extensions was to ignore the submodule clone, it was taking wayyy to long to clone the Pcap++.Stefano Bonicatti
02/15/2020, 1:46 PMgit clone --recurse-submodules <url>
which is cloning all submodules, it's not necessary to delete anything, you can just drop the option from the clone and then git submodule update --init <submodule path>
on what you need.Prateek Kumar Nischal
02/15/2020, 1:48 PMStefano Bonicatti
02/15/2020, 2:07 PMPrateek Kumar Nischal
02/15/2020, 2:08 PMStefano Bonicatti
02/15/2020, 2:11 PMmake help | grep trailofbits
and it was empty?Prateek Kumar Nischal
02/15/2020, 2:14 PMcmake --build .
for now and the trailofbits project is linked in the externals
directoryStefano Bonicatti
02/15/2020, 2:17 PM<build folder>/external/<link name>/trailofbits_osquery_extensions.ext
It mean the extensions are built.
I was wondering though why you said that you weren't able to find trailofbits
. You mean the target or the extension binary?Prateek Kumar Nischal
02/15/2020, 2:17 PM$ pwd
/Users/p0n002h/git/osquery/build/external
$ ls
CMakeFiles Makefile cmake_install.cmake
trailofbits
example
extension file too.. 😕
$ pwd
/Users/p0n002h/git/osquery
$ find . -name "example_extension.ext"
$
Stefano Bonicatti
02/15/2020, 3:45 PMCMakeCache.txt
file in the osquery build folder, then run the cmake configure again and copy here the log?Prateek Kumar Nischal
02/15/2020, 4:33 PM-- ================================
-- Trail of Bits osquery extensions
-- Version: 1.2
-- ================================
Importing libraries from '/Users/p0n002h/git/osquery/external/extension_trailofbits/libraries/'
> extutils
> firewall
> hostsfile
Importing extensions from '/Users/p0n002h/git/osquery/external/extension_trailofbits'
! Missing '.platforms` file: CMakeFiles. Skipping...
> darwin_unified_log
> efigy
-- Found CURL: /usr/lib/libcurl.dylib (found version "7.54.0")
> fwctl
> santa
-- ================================
/Users/p0n002h/git/osquery/build/external/extension_trailofbits/osquery_extension_group_main.cpp:42:10: error: no member named 'waitThenShutdown' in 'osquery::Initializer'; did you mean 'waitForShutdown'?
runner.waitThenShutdown();
^~~~~~~~~~~~~~~~
waitForShutdown
Stefano Bonicatti
02/15/2020, 4:43 PMtools/codegen/templates/osquery_extension_group_main.cpp.in
filePrateek Kumar Nischal
02/15/2020, 4:51 PMStefano Bonicatti
02/15/2020, 4:53 PMPrateek Kumar Nischal
02/15/2020, 4:55 PM