Commit Graph

90 Commits

Author SHA1 Message Date
Ateeq Sharfuddin
b63dc57e24
fix: on Windows use UTF-8 strings instead of system default locale strings (#6190) 2020-02-28 11:12:22 -05:00
Rachel Cipkins
3de799ef07
Support for "matches" and "js" keys from "content_scripts" in the chrome_extensions table (#6140)
Co-authored-by: William Woodruff <william@yossarian.net>
2020-02-21 18:13:41 -05:00
puffyCid
c722c68478
Expand SSH tables to support Windows (#6161) 2020-02-05 15:13:55 -05:00
Fritz
713c93fa29
Add Windows support to firefox_addons table (#6200) 2020-02-05 15:11:08 -05:00
Stefano Bonicatti
d0b42a98e2
Fix all TLS tests and framework (#6170) 2020-02-03 07:50:25 -08:00
Brad Thompson
0b2aa61a7d Create HVCI table for Windows Device Guard (#5426) 2020-01-23 20:57:03 -08:00
Teddy Reed
b1a55c31ea
tests: Improve hash table integration tests (#6184)
Co-Authored-By: Ryan Wilson <ryantimwilson@fb.com>
2020-01-18 15:38:32 -05:00
scoders-tob
b150367967 Adding process_open_pipes table (#6142) 2020-01-16 20:55:48 -05:00
João Godinho
a6ffa37c6c Add missing validation to fix last table (#6147)
* Fix: Allow `DEAD_PROCESS` in `last` table

* Test: Add test for `last` table
2020-01-15 00:50:44 +01:00
scoders-tob
6c9f8e30b0 adding docker image layers table (#6154) 2020-01-12 01:43:28 -05:00
Rachel Cipkins
3f632aaea2 Added tests for chrome_extensions table. (#6126) 2019-12-13 19:03:20 -05:00
seph
eb2ebd65b3 Enable more column validation on integration tests (#6106)
Co-Authored-By: Teddy Reed <teddy@casualhacking.io>
2019-12-12 20:45:55 -05:00
seph
a73ffad3bf tables: Add constraints and testing (#6105)
Co-Authored-By: Teddy Reed <teddy@casualhacking.io>
2019-12-12 20:45:15 -05:00
Rachel Cipkins
df20cb120a Added Brave/Chromium support for chrome_extensions (#6088) 2019-12-12 20:39:31 -05:00
Teddy Reed
6cf169c6d8
tables: Fix mdfind table by requiring query (#6103) 2019-12-06 10:11:51 -05:00
Garret Reece
5c3a4636ec macOS: Add a bsd_flags column to the file table (#5981) 2019-12-03 18:40:42 -08:00
Teddy Reed
b170a517b5
tables: Fix apt_sources and refactor tests (#6047) 2019-11-19 08:56:18 -05:00
Teddy Reed
19d4e3fc78
docs: Remove references to old osquery kernel extension (#6051) 2019-11-19 00:23:47 -05:00
Teddy Reed
2d4308b284 tables: Improve integration test debugging and fix deb_packages (#6045) 2019-11-18 20:43:18 -08:00
howar6hill
7a9f099903 Improve deb_packages test (#5980) 2019-11-01 10:36:42 -04:00
howar6hill
b67736d390 improve etc_protocols test (#5957) 2019-10-29 19:01:58 -04:00
Nick Anderson
b9bdcf40ce
tests: enabling certificates table sanity checks (#5914) 2019-10-27 20:45:14 -07:00
Will Newton
a1e4191109 tests: Increase reliability of interfaces test (#5879)
On macOS it is possible to have interfaces that have no netmask
set, for example:

| utun1 | 100.xx.xx.xx | | | 100.xx.xx.xx     | unknown |

This causes the interfaces test to fail. This change allows the
mask field to be blank and the test to pass on systems with this
type of interface configured.

The sockaddr for this interface has an ifa_netmask with sa_family
set to zero (AF_UNSPEC) which causes getnameinfo(3) to fail.
ifconfig does return a netmask for this interface but it's not
clear if the value is at all meaningful.
2019-10-26 12:36:45 -04:00
Will Newton
df8663516e tests: Add sanity test for nvram (#5903)
Add a simple sanity test for macOS nvram.

Closes: #5019
2019-10-20 22:17:39 -04:00
Will Newton
599e9d6f3a macOS keychain sanity test (#5885)
When requesting kSecClassIdentity items from the keychain sometimes
invalid items are returned. These cause errSecInvalidItemRef to
be returned from SecKeychainItemCopyAttributesAndData and result
in an empty row in the table. Catch the error and avoid returning
empty rows.
2019-10-17 08:50:17 -04:00
William Woodruff
1ca47d3e7a (Windows) New table: default_environment (#5441) 2019-10-16 14:20:52 -04: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
Alessandro Gario
225bbaf992
Integrate cppcheck and clang-tidy within the CMake project (#5730) 2019-10-08 18:17:11 +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
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
Zachary Wasserman
fe284506ac Fix typo in ValidationMap type name (#5837) 2019-09-25 23:35:15 -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
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
심명섭
7abf35488e [Table sanity check] etc_protocols 2019-08-22 00:47:37 -04:00
Sharvil Shah
d9fdc5b8fd tables: implement ibridge table to report on T1/T2 chip for mac notebooks (#5707) 2019-08-19 17:41:24 -04:00
Stefano Bonicatti
c2fde72fa6
Fix runningApps.test_sanity (#5670)
When run alone, using --gtest_filter to select the specific test,
it throws an exception because the tables are not registered.

It also wrongly checks for the query rows number to be >= 0 and then
proceeds to access the first one.
2019-07-29 15:47:30 +02:00
Stefano Bonicatti
9cf33c84f8 Restore AugeasTests test
PR: osquery/osquery#5629
2019-07-19 22:36:40 +02:00
Stefano Bonicatti
c56020cac3 Restore WindowsEventLogTests test
PR: osquery/osquery#5629
2019-07-19 22:36:40 +02:00
Stefano Bonicatti
36bb0b8b1e Restore ProcessTests test
Also add the same process name checks done on Windows to Linux.

PR: osquery/osquery#5629
2019-07-19 22:36:40 +02:00
Stefano Bonicatti
55e066322c Restore RegistryTablesTest test
PR: osquery/osquery#5629
2019-07-19 22:36:40 +02:00
uptycs-nishant
37caa44787 crontab testcase fix (#5637) 2019-07-18 06:52:37 -07:00
Stefano Bonicatti
dc02738db6 Disable InterfaceDetailsTest.test_sanity test on Windows
The table it tests has several issues, it doesn't properly check
for errors in several places and returns unexpected values in
the columns.
Moreover the code could also be improved to make testing possible
without passing through SQL queries, by separating the part
that uses WMI queries from the conversion to row results.
2019-07-09 12:59:45 +02:00
Stefano Bonicatti
e7fde8ad8e Fix wrong error code returned when querying the Windows registry (#5621)
Calling GetLastError() will not return the error code for the Windows registry APIs,
since they return a LSTATUS value which already the error code.

This also fixes the RegistryTablesTest.test_registry_non_existing_key
test case which was incorrectly expecting success when querying
for a non-existent registry key.

Ported from https://github.com/osql/osql/pull/50
2019-07-01 22:23:02 +02:00
Stefano Bonicatti
826723c29a Fix boost asio string_view detection hack
Only define BOOST_ASIO_DISABLE_STD_STRING_VIEW.

We shouldn't define BOOST_ASIO_HAS_STD_STRING_VIEW,
because even if we define BOOST_ASIO_DISABLE_STD_STRING_VIEW
the first define will actually enable parts of code that will use string_view.
This won't work on Windows and in general, string_view should not be
used unless compiling with C++17.

The hack has been also added to a test that was previously missed.
2019-06-26 21:49:06 -04: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
George Guliashvili
3f07c87b1b Homogenise integration test_name s
Summary:
8 out of 234 tests in the integration tests have TEST_F(classname, sanity) others have TEST_F(classname, test_sanity).

Making them all the same.

Reviewed By: jessek

Differential Revision: D14627709

fbshipit-source-id: d3ea6569d59fd3885004bde9421a0f1feafdb36c
2019-03-26 15:09:58 -07:00
Alexander Kindyakov
06633f2d1b Fix unused variable warning in table integration test
Summary: just switchin off some windows specific code on non-windows platforms

Reviewed By: guliashvili

Differential Revision: D14597685

fbshipit-source-id: 8b058ac1f9db8e4455e1b29e9e277d04468c2d64
2019-03-25 09:28:27 -07:00