Title
#general
r

RD

11/19/2021, 8:51 AM
Hi all, I am new to this amazing tool... I would like to see/review the code and may be imagine an extension... Is there any help/documentation for beginners about how to create a development environment to work easily? I normally use ubuntu and vscode. Any help will be really appreciated!
a

alessandrogario

11/19/2021, 8:52 AM
8:55 AM
If you are on a recent Ubuntu version, you can install the following packages to get started:
flex bison elfutils rpm ccache ninja-build
Then download and extract the osquery-toolchain somewhere: https://github.com/osquery/osquery-toolchain/releases/download/1.1.0/osquery-toolchain-1.1.0-x86_64.tar.xz Then configure & build:
cmake -S <src_folder> -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -G Ninja -DOSQUERY_TOOLCHAIN_SYSROOT=/path/to/osquery-toolchain
cmake --build build
8:57 AM
It is best to match the correct version of CMake (https://cmake.org/files/v3.17/cmake-3.17.5-Linux-x86_64.tar.gz) if possible, but that's mostly due to a quirk in how packaging works, so if you are not going to generate & redistribute them, you can use any version >= 3.17 (
snap install --classic cmake
usually has the latest version available)
8:57 AM
Running the tests requires some Python dependencies, they are all documented in the build guide linked in the first message
r

RD

11/19/2021, 9:09 AM
thank you very much... Really appreciated @alessandrogario!
a

alessandrogario

11/19/2021, 9:10 AM
Let us know if you encounter any issue in the build process
r

RD

11/19/2021, 9:10 AM
sure!!
a

alessandrogario

11/19/2021, 9:10 AM
You can also join #officehours if you are interested, it's once every two weeks
9:10 AM
Next one is this tuesday!
r

RD

11/19/2021, 9:52 AM
I would love too. Thank you very much for the invite.
9:53 AM
I will be installing this afternoon and I will let you know how does it go...
Stefano Bonicatti

Stefano Bonicatti

11/19/2021, 10:38 AM
I would additionally suggest to install the CMake extension in vscode and additional add
-DADD_HEADERS_AS_SOURCES=ON
to CMake, so that most of the headers that might be trickier to detect by vscode are seen by it. Also remember to put those configuration options in the CMake extension itself so that the extension will configure the same thing you have given from the command line. Finally if you are exploring before building, you might want to at least build the
prepare_for_ide
target. This is a special target that does some build steps to help the IDE find what it needs (because we have to generate some files and wire headers in a certain way).
s

seph

11/19/2021, 4:09 PM
Also worth mentioning, that extensions do not have to be in c++. Osquery talks to the extensions over a thrift socket, so anything that supports thrift should work. We distributed python and golang SDKs. The c++ is a little weird. And I’ve used ruby, though we don’t ship anything to make that easy
r

RD

11/20/2021, 8:15 PM
Amazing! I followed all your instructions and everything works smoothly. Thank you very much @alessandrogario, @Stefano Bonicatti ans @seph.
8:16 PM
I will be exploring osquery and I may soon have a lot of questions, and hopefully ideas... 🙂
10:09 PM
Hello all, I have tried to build again the project and getting errors related to gcc/c++ options. Is there any chance that tomorrow after the office hours any of you could help me understand what is happening?
10:09 PM
Thank you!
a

alessandrogario

12/07/2021, 4:02 PM
We have a section dedicated to this in the office hours schedule! We are happy to help 🙂
r

RD

12/07/2021, 4:34 PM
Thank you very much!! 🙂
a

alessandrogario

12/07/2021, 6:04 PM