Commit Graph

305 Commits

Author SHA1 Message Date
Teddy Reed
2c0791276e
CMake: Add an option to disable building libdpkg tables and library (#6848) 2020-12-26 16:09:16 -05:00
Stefano Bonicatti
704d75abed
CMake: Add an option to disable building AWS tables and library (#6831)
Added the OSQUERY_BUILD_AWS option due to
oss-fuzz CI failing to build the AWS EC2 library,
due to its high requirement of memory.
The fuzzers do not gain much from having these tables enabled,
moreover this can be used during development
to avoid building a possibly unneeded table.

Done some minor cleanups to remove logic duplication
and enable ec2 integration tests on all the platforms
that supports them.
2020-12-22 09:10:32 -05:00
Stefano Bonicatti
5b17d9a4b4
Permit running formatting earlier in the CI (#6836)
Also find the clang-format binary using find_program and
permit to give a path if it doesn't find it,
unless the Linux osquery toolchain is used.
2020-12-22 09:09:46 -05:00
Stefano Bonicatti
2b0c4304c7
CMake: add max version limit to 3.18.0 on Linux (#6801)
Due to a bug present in CPack provided with CMake
version 3.18.0 and higher on RPM packages generation,
add a check which fails the configuration
if a version with the bug is found.
Provide a way to ignore the check by setting
OSQUERY_IGNORE_CMAKE_MAX_VERSION_CHECK=TRUE.
2020-12-13 10:04:29 -05:00
Stefano Bonicatti
4dd97ea6a0
Update cmake_minum_required to 3.17.5 and pin version in CI (#6770) 2020-11-30 15:02:19 +01:00
Alessandro Gario
76c7733a75
Port the extended_attributes table to Linux, add support for Linux capabilities (#6195) 2020-11-24 13:36:56 -08:00
Alessandro Gario
37f2be6143
CMake: Disable BPF support if the LLVM libs are not compatible (#6746) 2020-11-24 13:50:18 -05:00
Rachel Cipkins
82908870a1
startup_items: Add systemd support on Linux (#6562)
Co-authored-by: Alessandro Gario <alessandro.gario@gmail.com>
2020-11-22 22:37:55 -08:00
Alessandro Gario
5c1bf4ff0c
Initial implementations for BPF-based socket and process events tables (#6571)
* deb_packages: Fix include order issue

* bpf_socket_events, bpf_process_events: Initial implementation

* BPF: Add process tracking to process events, remove sockets_event

* CMake: Upgrade the C++ standard to C++17

* BPF: Improve initial system state snapshot and event collection

* BPF: Add tests for SystemStateTracker

* BPF: Add tests for BPFEventPublisher

* BPF: Refactor, add tests for ProcessContextFactory

* Refactor: Improve initial scan/event handling, fix openat

* BPF: Improve event ordering

* BPF: Fix test issue in BPFEventPublisher::processOpenAt

* BPF: Mark WIP functions as deprecated

* BPF: Improve tests

* BPF: Add back bpf_socket_events and connect() support

* BPF: Add Netlink addr support, add bind()

* BPF: Add accept/accept4 support

* BPF: Add tests for BPFEventPublisher::processOpenat2Event

* BPF: Add remaining tests for BPFEventPublisher

* BPF: Add configuration flags for memory management

* BPF: Add cmdline support to ProcessContextFactory

* BPF: Add additional tests

* BPF: Add unit test for SystemStateTracker::accept

* BPF: Update cwd handling

* BPF: Add tests for bpf_socket_events

* BPF: Add tests for bpf_process_events

* BPF: Add json_cmdline hidden column to bpf_process_events

* BPF: Update all copyright headers

* BPF: Add syscall duration in socket_events/process_events

* BPF: Code review changes

* BPF: Update ebpfpub to the latest version

* BPF: Removed unused functions

* BPF: Code review changes

Add whitespace around namespaces

* BPF: Revert header changes in rot13.cpp

* BPF: Code review changes

Rename the bpf_ntime column in bpf_socket_events/bpf_process_events
to ntime and make it the last visible column

* BPF: Code review changes

Update the dependencies for the BPF tests

* BPF: Code review changes

Update the dependencies for the BPF table tests

* BPF: Code review changes

Update how characters are appended to strings in the
system state tracker class

* BPF: Code review changes

Update the string -> integer conversion utilities in the
process context factory class.

* BPF: Hide failed exec syscalls from bpf_process_events results

* BPF: Do not log an error for invalid sockaddr structures

* BPF: Code review changes

Remove clang-format ignore block

* BPF: Code review changes

Update log messages in the BPFEventPublisher class

* BPF: Code review changes

Remove clang-format ignore block around the function tracer
descriptors

* BPF: Code review changes

Document the IFilesystem interface

* BPF: Code review changes

Document the IProcessContextFactory interface

* BPF: Code review changes

Document the ISystemStateTracker interface
2020-10-16 01:14:00 -07:00
seph
29f4694df2
Update copyright notices (#6589)
Bulk update copyright notices from Facebook to "The osquery authors"
2020-08-11 16:46:54 -04:00
kumarak
2aa313db40
Enable yara table on windows (#6564) 2020-07-23 21:16:10 -04:00
Stefano Bonicatti
7f21ccfe67
Drop the facebook and source_migration layers (#6473)
We have ported all platforms to use the source layer.
The facebook layer is not needed anymore since we build everything from source now,
the same is for the transitional source_migration layer.

Minor cleanups about the recently removed python modules.
2020-06-01 09:58:56 -04:00
Teddy Reed
c34bdf6214
codegen: Port Jinja2 to Templite (#6470) 2020-05-31 18:36:47 -04:00
Oleg Dolgov
2bf31f3311
build sleuthkit under windows (#6445) 2020-05-25 12:17:11 -04:00
Stefano Bonicatti
296c6d336e
Update openssl to 1.1.1d (#6302)
- Update libarchive to build from source on Windows and macOS

- Update yara to build from source on macOS

- Update librdkafka to build from source on macOS

- Build librdkafka with SSL and SASL_SCRAM support on Linux

- Update librpm to 4.15.1 to support the newer openssl

- Update libxml2 to build from source on Windows and macOS

- Update lzma to build from source on Windows and macOS

- Use ICU library not only for boost but libxml2 too

- Implement a workaround to have Buck builds still compile
  with the old openssl version
2020-03-27 17:11:43 +01:00
flappy-sh
d9faba2d9e
Build librdkafka on Windows (#6095) 2020-03-06 15:06:55 -05:00
Stefano Bonicatti
46430df8c5 Restore WEL logger plugin (#6164)
- Restore the ability of osquery to log to the Windows Event Log.
- Restore the information normally shown on the Details tab
of the Properties of the osquery executable.
- Add and refactor utility functions to parse and transform
  the osquery version, needed by the Windows resource files
  and packaging.
2020-01-12 01:42:44 -05:00
Ted Reed
0d4372ed48 libraries: Add lzma and libxml2 to source_migration 2019-11-11 08:35:33 -05:00
Zachary Wasserman
7e18771f16 Migrate glibc from "facebook" dependencies (#5900) 2019-10-31 19:08:09 -04:00
kumarak
9346926030 Restore extension SDK support to osquery 4.x (#5851)
CMake utility functions(generateOsqueryExtensionGroup,addOsqueryExtensioni{Ex},
addOsqueryModule) to add extensions.

Updates the boost library submodules needed for extensions build.

Use cache variable(OSQUERY_EXTENSION_GROUP_NAME) for the grouping of extensions
and fix the linkage with osquery interface library.
2019-10-18 18:45:20 -04:00
Stefano Bonicatti
3ad7f65a0d Support source and build directory to be on different filesystems (#5907)
Instead of moving a patched submodule from source to build directory,
we copy it and then hard reset the submodule to its original HEAD.

Minor message change when a library fails to be imported.
2019-10-18 18:25:05 -04:00
Alessandro Gario
225bbaf992
Integrate cppcheck and clang-tidy within the CMake project (#5730) 2019-10-08 18:17:11 +02:00
Stefano Bonicatti
0b2cd791d3 Linux custom toolchain integration (#5759)
- Always link to libc++abi.a, dl and rt.
- Add OSQUERY_TOOLCHAIN_SYSROOT option which should contain
  the path to the sysroot where the portable compiler and its libraries are in.
- Fix OpenSSL build with custom toolchain.
- Always include the custom toolchain cmake.
  Unfortunately system name detection is done when project() is called
  which is also when compiler detection is done, and we need the compiler
  to be set before that, so we always include the cmake file.
- Do not use getrandom syscall in Boost, for glibc < 2.25 support.
- Remove usage of secure_getenv and getauxval in librpm.
- Update CI to use the toolchain.
- Reflect changes in the docs.
2019-09-06 19:51:25 -04:00
Stefano Bonicatti
f6ed617394
Uniform and update CMake version to 3.14.6 (#5756)
The new version contains a fix for the FindBison module.
The docs have been updated too.
2019-09-06 22:12:13 +02:00
Alessandro Gario
6481b34e23
Refactor third-party libraries to build from source on Linux (#5706)
Add a way to compile third-party libraries from source instead of downloading prebuilt ones.
Each library source code is downloaded with git into a submodule at configure time,
in response to the find_package(library_name) CMake call,
except for OpenSSL where the official source archive is used.
Each submodule is attached to a release tag on its own upstream repository.
All the libraries are built using CMake directly, except for OpenSSL which uses a formula system,
which permits to build libraries with a separate build system
when there's no easy way to integrate it directly with CMake.

This new dependency system determines which library is fetched from where using the concept of "layers".
Currently we have three of them: source, formula, facebook,
where the last layer represents the pre-built libraries.
The provided order will be used when looking for libraries.

A system to patch submodule source code has been added and it's currently used with googletest, libudev and util-linux.
Patches should be put under libraries/cmake/source/<library name>/patches/<submodule>,
where <submodule> is often one and is "src", but in other cases, like AWS,
there are multiple with a more specific name.
If for whatever reason the submodule cloning or the patching fails,
the submodule has to be unregistered and its folder should be cleared.
This should be achievable with "git submodule deinit -f <submodule path>"

Following some other changes on existing functionality:

- Changed the CMake variable BUILD_TESTING to OSQUERY_BUILD_TESTS
  to avoid enabling tests on third party libraries.
  Due to an issue with glog the BUILD_TESTING variable
  will be always forced to OFF.
- Moved compiler and linker flags to their own file cmake/flags.cmake
- Moved all the third-party CMakeLists.txt used for pre-built libraries under libraries/cmake/facebook
- Added the --exclude-folders option to tools/format-check.py and tools/git-clang-format.py,
  so that it's possible to ignore any third party library source code.
- The format and format_check target use the new --exclude-folders option
  to exclude libraries/cmake/source from formatting.
- The test and osquery binaries are properly compiled with PIE (osquery/osquery#5611)

Co-authored-by: Stefano Bonicatti <stefano.bonicatti@gmail.com>
Co-authored-by: Teddy Reed <teddy@casualhacking.io>
2019-08-30 16:25:19 +02:00
Stefano Bonicatti
942878854b Add CMake support
Taken from osql-experimental.

- Change CMake code license to the one present in osquery right now

- Package metadata doesn't mention Trail of Bits or osql anymore

- Set specific ACLs for the osqueryd on Windows when packaging

- Remove LLVM_INSTALL_PATH support on macOS, since we are using AppleClang

- Remove OSQUERY_SOURCE_DIR variable need and source in a submodule support

- Add targets format_check and format to check code formatting and
  format it with clang-format

- Do not warn about not using Clang on macOS when using AppleClang
2019-06-26 21:49:06 -04:00
Alessandro Gario
33fbbecb5f Initial commit
Taken from osql-experimental.

Initial support for Linux and macOS.
2019-06-26 21:49:06 -04:00
George Guliashvili
971bee4441 Move build system to BUCK
fbshipit-source-id: 8ffef5e6a393ac67ce56dcb74845402e43d964a0
2018-12-07 16:12:35 +00:00
packetzero
5188ce5288 update aws-sdk-cpp 1.4.55 on windows (#5255) 2018-10-29 21:24:29 +00:00
Giorgi Guliashvili
d5ccbd1813
treat warnings as error only in the osquery core (#5113) 2018-08-28 17:22:06 +01:00
Giorgi Guliashvili
c2b7747673
posix treat warnings as errors (#4913) 2018-08-14 14:40:06 +01:00
Nick Anderson
478a7b39b6
deps: boost updates for windows vs 2017 (#4781) 2018-08-06 11:37:42 -07:00
Teddy Reed
37e5c9f4b6
review: Small code review fixes (#4743) 2018-07-25 18:48:11 -04:00
Allan Liu
8f4529d2a3 General SMART drive information virtual table (#4133) 2018-07-13 09:51:55 -04:00
Vova Mishatkin
29b596dc85 Add ssdeep table for posix (#4629) 2018-06-29 19:50:47 +01:00
Max Kareta
6344f58712
Improved xcode compatibility (#4643) 2018-06-26 17:13:48 +01:00
Max Kareta
d085f2dca1
added custom version of realpath function (#4416) 2018-06-22 15:02:22 +01:00
Max Kareta
bccc28dd98
xcode support (#4581) 2018-06-21 15:46:39 +01:00
Craig Cook
7a66202e5e
Fix make sync on centos7 (#4574)
* Add LIBRARY_PATH environment variable to sync.sh so that "make sync" works as expected to find libraries
needed to link.  Added 2nd parameter (libraries path) to CMakeList.txt when calling sync.sh

* Revert database CMakeLists.txt change - as was for testing

* Add indentation to sync.sh

* Fix indentation on tool/sync.sh
2018-06-19 12:41:02 +01:00
Max Kareta
408c54565e
Removing macOS kernel module (#4572) 2018-06-17 19:21:07 +01:00
Filipe Manco
b522e7422b
Build posix with -fno-limit-debug-info (#4558) 2018-06-15 10:12:28 +01:00
M Amin
bdd2c47551 build: Update provisioning and build scripts to VS2017 (as per #4151) (#4496) 2018-06-08 21:05:40 -07:00
Max Kareta
bf391e5b83
reworked core cmakefiles.txt (#4443) 2018-05-30 00:04:52 +01:00
Teddy Reed
6e9f55d15d
llvm 6.0 and libFuzzer implementation (#4370) 2018-05-12 21:56:00 -04:00
Filipe Manco
293f2d2628
Improve debugging (#4277) 2018-04-16 16:00:54 +01:00
Teddy Reed
999034367a
freebsd: Update CMake for thrift 11 and boost 1.66 (#4166) 2018-03-05 09:13:05 -05:00
Teddy Reed
6f20eced93
thrift: Optionally build and link with fbthrift (#4105) 2018-02-10 23:37:15 -08:00
Teddy Reed
181d2f9dbc
build: Fix OSQUERY_BUILD_SHARED linkage (#4062) 2018-01-14 23:08:36 -05:00
Teddy Reed
193de0c818
deps: Improve native (non-deps) builds (#4060) 2018-01-14 20:14:40 -05:00
Teddy Reed
82235e3c13
deps: Build linenoise locally (third-party) (#4058) 2018-01-14 16:31:41 -05:00