Commit Graph

5174 Commits

Author SHA1 Message Date
Teddy Reed
2b9ea20563
fuzz: Silence config parsing log lines in fuzz-config (#5886) 2019-10-16 10:19:18 -04:00
Zachary Wasserman
419a2c97e8 Use git 2.21.0 for macOS CI (#5892)
This fixes issues with shallow clones of submodules and will enable
#5889 to pass CI.
2019-10-16 10:18:46 -04:00
Alessandro Gario
6ba37014ef
BPF/Map: Add missing return value in move assignment operator (#5874) 2019-10-14 21:45:23 +02:00
Stefano Bonicatti
974bdef901 Various fixes and CI steps for packaging (#5881)
* Fix packaging regression on Windows

Component variables should be set only for Linux and macOS,
otherwise on Windows the internal WiX IDs change and the
WiX fragment patch won't work.

Cleanup the version patch component, since WiX doesn't support
version components that are not digits.

* Add the rpm package to the CI Dockerfile, to test rpm packaging

* Fix TGZ generation on other platforms

* Add dpkg-dev and file packages to the CI Dockerfile

They are needed for creating DEB debug packages.

* Add a packaging steps to the CI

Set TGZ as a default packaging system when one cannot detected.

Fix generatePackageTarget indentation.
2019-10-13 12:53:16 +02:00
widberg
6a20e79424 [Table sanity check] chocolatey_packages (#5871) 2019-10-11 17:26:44 -07:00
howar6hill
2a4acdbd53 [Table sanity check] sudoers (#5869) 2019-10-11 17:25:30 -07:00
Sharvil Shah
bdca64fbcd [shell] support previously supported on|off toggle for osqueryi shell functions (#5876) 2019-10-11 17:17:10 -07:00
Stefano Bonicatti
e1dca49663 Fix regression in calling core only plugins from extensions (#5875)
PR osquery/osquery#5464 makes it impossible to call plugins
which are only registered in the core, as its happening with osquery/osquery#5839.

What happens when this is working is that the filesystem plugin is not present
in the extension registry, so when Registry::call tries to search for a plugin
that provides the "config" feature, it won't find one and the resulting plugin name,
and later item_name, will be empty.

This results in the RegistryInterface::call reroute the call to the core,
through Thrift, which will end up in the plugin correctly answering.
2019-10-11 17:15:19 -07:00
Stefano Bonicatti
7d1d486c1e Fix git command not found after first configure (#5880)
During the first configuration, the git command is searched
when submodules are initialized and it's then saved into a cache variable.
If though we delete the build folder and run configure again,
the submodules won't be initialized again, so the git command
won't be cached and visible to CMake.
Therefore we need to search for it each time.

Cleanup dead/deprecated code.
2019-10-11 23:31:31 +02:00
Stefano Bonicatti
56c69e3cfa Add ccache support also for compiling C (#5872) 2019-10-08 22:39:28 +02:00
Alessandro Gario
225bbaf992
Integrate cppcheck and clang-tidy within the CMake project (#5730) 2019-10-08 18:17:11 +02:00
Teddy Reed
846c392903
cpack: Update package logic to build DEB debuginfo (#5843)
This enables a component install for DEB (only). This is required in
CMake version 3.17.0 (planned) and lower to produce a debuginfo version.

One side-effect is we have to gate the stripping for DEB.
2019-10-07 22:36:18 -07:00
Chris Broome
99bfa342ef Fix thirdparty_*_settings target_link_libraries (#5870)
- Reorder `add_library(osquery_thirdparty_extra_c_settings INTERFACE)`
  for consistency
- Use correct target link library in osquery_thirdparty_extra_*_settings
2019-10-07 21:18:17 +02:00
Stefano Bonicatti
fdd2272148 Provide CI Dockerfile and some fake packages (#5855)
Since normally the tests are run on a more complete VM or physical host,
we create fake empty packages to install so that
the test DebPackages.test_sanity doesn't fail.
2019-10-07 16:26:43 +02:00
widberg
e62ec85444 [Table sanity check] startup_items (#5864) 2019-10-05 19:14:33 -04:00
widberg
a81688809a [Table sanity check] npm_packages (#5857) 2019-10-05 10:30:52 -04:00
adhamehab
657932cd2c Upgrade Python tools to Python3 (#5846) 2019-10-05 10:30:10 -04:00
Stefano Bonicatti
8de035ba94 Improve error reporting from extension manager (#5860)
Change the message that is logged when a required extension is not
loaded or found from "Extension not autoloaded: <extension id>" to
"Required extension not found or not loaded: <extension id>".

Change the message that is logged when the extension manager has an
error happening during startup from "Cannot start extension manager:
<error>" to "An error occurred during extension manager startup: <error>"

Add the possibility of startExtensionManager returning with an error
if the Dispatcher failed to properly add the ExtensionManagerWatcher
or ExtensionManagerRunner.

Fallback to logging the startExtensionManager error message with a
severity of INFO only if extensions are required to be disabled.

Add tests for starting the extension manager with a nonexistent
socket path and a nonexistent required extension.

Issue osquery/osquery#5679
2019-10-04 15:44:54 -04:00
William Woodruff
a9b23807b2 darwin/firewall: Fixes for alf_exceptions, make alf_services an alias for sharing_preferences (#5378) 2019-10-04 15:42:10 -04:00
William Woodruff
06dd05cd33 (Windows) New table: connectivity (#5500) 2019-10-04 15:18:15 -04:00
seph
ba81289baf Documentation around process-auditing (#5852) 2019-10-04 16:47:28 +02:00
Stefano Bonicatti
f2007c7057 Temporarily disable Buck tests on Linux (#5856)
Buck compiles tests in Debug mode even if supposedly told otherwise,
this exhausts disk space available on the CI and makes the step always fail.
2019-10-03 21:26:34 -04:00
Teddy Reed
92e7b9033d
fuzzing: Restore simple libFuzzer-based config fuzzing (#5844)
This defines a new CMake option: OSQUERY_FUZZ, which appends compiler
and linker flags for libFuzzer to be effective.

There is one example harness that will fuzz config parsing.
2019-10-02 18:09:35 -04:00
Teddy Reed
0f3ad48b77
bug: Use RecursiveMutex and additional read locking on getEventSubscriber (#5841) 2019-10-02 01:02:24 -04:00
Stefano Bonicatti
457150c94c CMake: Improve submodule patching system (#5850)
Keep patched source in the build directory instead of the source.

A new variable with the format OSQUERY_<submodule name>_ROOT_DIR
is set to the directory of where the submodule is, in case it's patched.

A new option PATCH has been added to importSourceModule
to let the patching system know that the submodule has to be patched
and which is the main submodule folder.
2019-10-01 17:47:10 -04:00
Teddy Reed
52171f5676
azure/macos: Fix for brew/ant install failing (#5845) 2019-09-30 11:35:27 -04:00
Teddy Reed
54859ace98
tests: Enable RocksDB plugin tests (#5832) 2019-09-27 08:26:53 -04:00
grrrrrrrrrr
31e6dfdfeb Fix make rpm script to not break because of symlinks (#5780)
Signed-off-by: grant <grantseltzer@gmail.com>
2019-09-26 07:32:21 -04:00
Stefano Bonicatti
dd575f93f4 Add a test for the format_check script (#5835)
The test modifies the source code, appending "\n\n" at the end of each .cpp files.

Then runs the format_check target and verifies if the list of files to be formatted,
identified by the script, are the same ones previously modified.
2019-09-25 23:35:43 -04:00
Zachary Wasserman
fe284506ac Fix typo in ValidationMap type name (#5837) 2019-09-25 23:35:15 -04:00
Teddy Reed
e5599c01f3
packaging: Fix up make_osx_package to work for version 4+ (#5827) 2019-09-25 23:00:01 -04:00
Teddy Reed
bb25075599
linux: Add --build-id linker option (#5823) 2019-09-25 15:20:22 -04:00
Stefano Bonicatti
6f3063bef7 Specify PATH when calling format_check if using the custom toolchain (#5834)
The script would not find clang-format or it would use the system one,
which it shouldn't.
2019-09-24 19:17:55 -04:00
Zachary Wasserman
2a6ddd62ea Implementation of windows_security_products table (#5479)
Provides information about the security products registered on a Windows
system.
2019-09-23 17:44:31 -04:00
Zachary Wasserman
9a2304aa57 Update Windows build instructions (#5820)
Co-Authored-By: Stefano Bonicatti <smjert@gmail.com>
2019-09-23 17:41:11 -04:00
Teddy Reed
835ae84635
CPack: Linux package nitpicks and docs (#5822)
This fixes the license for RPMs, sets the homepage for DEBs, and sets
the package revision correctly.
2019-09-23 17:39:27 -04:00
Nick Anderson
789f70f2d9 deploy: updating osquery --install to wrap binary path and flagfile (#5824) 2019-09-23 17:38:20 -04:00
Teddy Reed
9134c7a6d1
format: Fix auto-formatting and format checking (#5830) 2019-09-23 17:32:06 -04:00
Tomohito Nakayama
553ab52b38 Fix error with implicitly-deleted default constructor of glob_t (#5828) 2019-09-22 01:03:46 -04:00
Zachary Wasserman
33f7c6fc3f Prune Vagrant boxes and fix AWS support (#5819)
- Remove Vagrant boxes provided by individual users and not well-known organizations.
- Use osquery/aws-dummy box for AWS support.
- Fix AWS startup when used without VPC and subnet.
2019-09-21 21:02:12 -04:00
Teddy Reed
bbec01d5fa
Revert "Remove deprecated macOS package generator (#5808)" (#5821)
This reverts commit 54289cd3d4.
2019-09-21 19:02:38 -04:00
seph
8e678847c2 Fix MSI Service Error handling
When ErrorControl is set to `critical`, a failure to start osquery results in a system reboot. Instead, this should be set to `normal` where it is logged and the startup proceeds.

Upstream docs are Docs are http://wixtoolset.org/documentation/manual/v3/xsd/wix/serviceinstall.html

This was fixed in https://github.com/osquery/osquery/pull/5467 and seems to have gotten lost.
2019-09-19 12:32:35 -04:00
Zachary Wasserman
010949cc4e Suppress Boost warnings about newer compiler (#5816) 2019-09-19 01:19:26 +02:00
Zachary Wasserman
5cec1f4331
Upgrade SQLite to 3.29.0 on macOS and Windows (#5810)
Mitigates recent CVEs in SQLite. It was already this version on Linux.

Establish a pattern for migrating source dependency builds to macOS and Windows.
2019-09-18 15:49:27 -07:00
Alessandro Gario
65aca42e5f
CMake: Add CentOS to the RPM-based distributions (#5809) 2019-09-16 21:19:39 +02:00
Alessandro Gario
54289cd3d4
Remove deprecated macOS package generator (#5808) 2019-09-16 17:03:36 +02:00
seph
4f9f63a667 Update CHANGELOG for 4.0.2 (#5803) 2019-09-12 18:34:44 -04:00
Stefano Bonicatti
57f9916473 Patch environment file path in initd and systemd scripts during DEB packaging (#5802)
Also add a check to systemd script to create and empty config file,
if this is missing.

Co-authored-by: seph <seph@directionless.org>
2019-09-12 18:02:23 -04:00
Alessandro Gario
b3a9342783
CMake: The AWS library was not correctly enabling OpenSSL support (#5799) 2019-09-12 20:01:46 +02:00
Stefano Bonicatti
1463d0a76e Add make to be installed among the other packages on Linux (#5784)
Also use --no-install-recommends to avoid installing unneeded packages.
2019-09-12 13:24:09 -04:00