Commit Graph

50 Commits

Author SHA1 Message Date
Jeremy Calvert
67447bbd96 Custom cast so that 0.0 as a double casts as "0.0"
Summary:
This fixes a regression introduced in D13586036 .

The tailer downstream sometimes determines type by trying to parse the string as an int.  We want this to consistently fail to do so when the value is in fact a float.

Reviewed By: SAlexandru

Differential Revision: D14161125

fbshipit-source-id: 8e2bb9c59559a5774813a7c7777257742f885c35
2019-02-22 10:23:07 -08:00
Jesse Kornblum
c7355b19aa Update osquery licensing wording (#5452)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5452

As suggested in another diff, this diff updates the language we use to describe the osquery licensing terms. We are changing all instances of

//This source code is licensed as defined on the LICENSE file found in the root directory of this source tree.//

to

//This source code is licensed in accordance with the terms specified in the LICENSE file found in the root directory of this source tree.//

We accomplish this with a codemod:

  $ codemod -md xplat/osquery/oss --extensions cpp,h,in,py,sh,mm,ps1 "(.\s+)This source code is licensed as defined on the LICENSE file found in the(.*)root directory of this source tree\." "\1This source code is licensed in accordance with the terms specified in\2the LICENSE file found in the root directory of this source tree."

Reviewed By: fmanco

Differential Revision: D14131290

fbshipit-source-id: 52c90da342263e2a80f5a678ecd760c19cf7513e
2019-02-19 10:59:48 -08:00
Filipe Manco
be07c2938a Move plugins to a separate directory [1/?]
Summary:
Initial steps to separate plugins from the rest of osquery. On the long run separating plugins will provide more build flexibility such that we can have configurable builds that include only the bits and pieces we actually need per deployment. Reducing the attack surface, possibility of supply chain attacks, binary size, etc.

Move config and config_parser plugins

Reviewed By: marekcirkos

Differential Revision: D14119102

fbshipit-source-id: 0bc956398b3829c6f1013b38ebba2f0fc1071a93
2019-02-19 00:55:27 -08:00
Alexander Kindyakov
e44cbe0f3f Add thirdparty [boost] dependency to osquery/utils:utils
Summary: It was apparently missed

Reviewed By: guliashvili

Differential Revision: D13991104

fbshipit-source-id: aadc22de6a679e2ede97c483bbedf17d066ea0ae
2019-02-12 04:08:17 -08:00
Alexander Kindyakov
6ee0fd18ea Do not mess with namaspace which comes from thirdparty library (rapidjson) (#5424)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5424

Let's use `SizeType` definition from rapidjson itself

Reviewed By: marekcirkos, fmanco

Differential Revision: D13986840

fbshipit-source-id: 53b3bf4dcb41c27e2cf18fee3aed97b9e2e42202
2019-02-11 02:33:19 -08:00
Alexander Kindyakov
79cd575790 Make message realated methods of class Error shorter and less diverse (#5410)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5410

 - get rid of *Short* methods
 - getFullMessage -> getNonRecursiveMessage
 - getFullMessageRecursive -> getMessage

Reviewed By: mkareta

Differential Revision: D13897854

fbshipit-source-id: 3e97ceefb2a48a16cd400f7ba7dd730724957ef0
2019-02-01 07:33:53 -08:00
Alexander Kindyakov
da91d8cfe8 to<std::string>() conversion template for c++ enums (#5408)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5408

Move out c++ enums to std::string conversion function from
osquery/utils/error.h to separate module. To be able to use it somewhere else.

Reviewed By: guliashvili

Differential Revision: D13896772

fbshipit-source-id: 0a9f6327d5b2f115ce688446a67677879411eb1f
2019-02-01 07:33:53 -08:00
Alexander Kindyakov
32385bd9ca Hash function for enum classes (#5409)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5409

This is just a ad-hoc fix up to handle libc++ and libstdc++ bug:
http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2148
Eventually it will be removed.

Reviewed By: guliashvili

Differential Revision: D13896844

fbshipit-source-id: 38b3cd43b913e5e64d8d9ac40417e6ed0fcb6c41
2019-02-01 03:47:02 -08:00
Max Kareta
188a229d8c fixed double main function
Summary: before this diff osqueryd was relying on linker order to use right main function, since gtest also contains main function

Reviewed By: guliashvili

Differential Revision: D13897622

fbshipit-source-id: d260b7496f513c7052f4db87c8e7ff9300493671
2019-01-31 15:09:12 -08:00
Filipe Manco
aad04ed428 Fix link to expected tests on comment. (#5398)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5398

The file moved to a different location.

Reviewed By: marekcirkos

Differential Revision: D13817331

fbshipit-source-id: 6bd3947894daa712edae84b71502af997947b9b0
2019-01-27 06:53:38 -08:00
George Guliashvili
a6069b85bc Remove duplication of the target names (#5391)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5391

Make target names unique

Reviewed By: marekcirkos

Differential Revision: D13785378

fbshipit-source-id: 5bdf02d57ecbf574a1376feb13d07331b43ff89d
2019-01-25 07:23:20 -08:00
Marek Cirkos
3a2bbf3b05 Make system utils target name unique
Summary: Pull Request resolved: https://github.com/facebook/osquery/pull/5382

Reviewed By: guliashvili

Differential Revision: D13761609

fbshipit-source-id: 76437e5c84903bfa31272c3145192aa17600bcb4
2019-01-22 05:28:28 -08:00
Alexander Kindyakov
3acaf40d78 eBPF output via perf_event_output kernel mechanism (#5374)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5374

Part of a linux `syscalls` tracing system, blueprint: [#5218](https://github.com/facebook/osquery/issues/5218)

Reviewed By: mkareta

Differential Revision: D13622579

fbshipit-source-id: d88b49d785e532b0dbcc42d9245bfee2a9209145
2019-01-22 03:53:48 -08:00
Alexander Kindyakov
4d38dba2ac wrapper for perf_event_open syscall (#5373)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5373

I made wrapper for the syscall  perf_event_open to isolate syscall code definition and use `Expected<>` as a return value.

Reviewed By: mkareta

Differential Revision: D13622565

fbshipit-source-id: 616080a64376d4b042629513ad715b1d2458b8a2
2019-01-22 03:53:48 -08:00
Filipe Manco
68cf457709 Make linter happy, remove whitespaces
Summary: Pull Request resolved: https://github.com/facebook/osquery/pull/5376

Reviewed By: jessek

Differential Revision: D13750590

fbshipit-source-id: 230be8e0930b00b80150a21eedf0668411ef6d56
2019-01-21 11:51:55 -08:00
Filipe Manco
a67525fae1 Fix LICENSE information on file headers (#5375)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5375

LICENSE is now defined in a single file on the root of the project, update the
header to contain that information.

**Project LICENSE did not change.**

Reviewed By: akindyakov

Differential Revision: D13750575

fbshipit-source-id: 1e608a81b260b8395f9d008fc67f463160c1fc2b
2019-01-21 11:51:54 -08:00
Alexander Kindyakov
e7d01f84d2 linux native events wrapper (#5370)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5370

Handler to enable event with certain type, get an id of the event and make sure it will be disables afterwards.

Part of a linux `syscalls` tracing system, blueprint: [#5218](https://github.com/facebook/osquery/issues/5218)

Reviewed By: mkareta

Differential Revision: D13621388

fbshipit-source-id: 8adfbe3cc1d87f70538851c5036eae51c93bede8
2019-01-21 02:46:36 -08:00
Alexander Kindyakov
57d4f31b16 eBPF program loader class (#5355)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5355

C++ wrapper to load and keep track of eBPF program in order to close if afterwards.

Blueprint: [#5218](https://github.com/facebook/osquery/issues/5218)

Reviewed By: guliashvili

Differential Revision: D13609628

fbshipit-source-id: dd4ecb547a37c7d83753249e156b0d2c56194ec0
2019-01-18 03:07:35 -08:00
Alexander Kindyakov
dbe467b1a7 eBPF map cpp wrapper (#5356)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5356

To make the process of interacting with eBPF map structure more clear

Blueprint: [#5218](https://github.com/facebook/osquery/issues/5218)

Reviewed By: guliashvili

Differential Revision: D13608479

fbshipit-source-id: cffe76883c280a947da12641b7db6824a571ab1e
2019-01-18 03:07:35 -08:00
Alexander Kindyakov
668c4f7f51 eBPF initial declarations and isSupportedBySystem function (#5354)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5354

eBPF system call osquery wrapper with Expected as a return value and function to check if functionality is supported by current kernel.

Blueprint: [#5218](https://github.com/facebook/osquery/issues/5218)

Reviewed By: mkareta

Differential Revision: D13607442

fbshipit-source-id: 58be84a86aba3fe5e33ca5ab15418976fd36107c
2019-01-18 03:07:35 -08:00
George Guliashvili
d498bcbd65 unique target names for xcode (#5328)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5328

xcode needs unique target names to properly parse buck generated project

Reviewed By: marekcirkos

Differential Revision: D13487400

fbshipit-source-id: cf0c76145344d0873a0973e226d007597a06d17d
2019-01-16 12:28:04 -08:00
seph
637eb104b8 Spelling (#5256)
Summary:
While running `misspell` on a different codebase. I happened to notice that some misspellings in the osquery code base. So, I fixed them
Pull Request resolved: https://github.com/facebook/osquery/pull/5256

Reviewed By: guliashvili

Differential Revision: D13670897

Pulled By: fmanco

fbshipit-source-id: 5d33d858284955c376e8c3980acdf366d4edf3d3
2019-01-16 08:17:07 -08:00
Alexander Kindyakov
0f15c5fc6a C++ enum wrapper for posix general error codes (#5342)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5342

This sort of enumeration is required to pass posix system errors with `Expected<>`

Reviewed By: mkareta, fmanco

Differential Revision: D13608306

fbshipit-source-id: 0b787b12fac915f097dc310b616df507772da455
2019-01-15 05:38:12 -08:00
Alexander Kindyakov
d893ec4aa8 Semantic version parser (#5343)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5343

Just a parser for the semantic version in string. I gonna use it later to parse kernel version from the `int uname()` result.

Reviewed By: guliashvili

Differential Revision: D13607313

fbshipit-source-id: d6d01fe220f242d3811406dcd63d609feb0d6688
2019-01-15 05:38:12 -08:00
Alexander Kindyakov
3d5309b615 One place to define version of api (#5346)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5346

Let's define win32 api version only inside of buck files, but not in cpp header

Reviewed By: guliashvili

Differential Revision: D13635704

fbshipit-source-id: cd978661ed6f733950363c2ac261811045263ed2
2019-01-14 09:46:36 -08:00
Max Kareta
8c0c403796 fixed headers_namespace to match file path
Summary: Some tools does not support virtual headers namespaces and expect header path to match actual file path from project root. This diff will fix few namespaces in utils library

Reviewed By: guliashvili

Differential Revision: D13552878

fbshipit-source-id: 2a06f73550c69777bf73be73abdde297fe580583
2019-01-14 03:33:32 -08:00
Jonathan Keljo
43cb6d7535 Fix NODISCARD on C++17
Summary:
On C++17 `NODISCARD` maps to a `[[nodiscard]]` attribute, which must
appear at the start of the function signature.

Reviewed By: j-calvert, guliashvili

Differential Revision: D13627821

fbshipit-source-id: d308650cf0188141a4942f528b7ec91825a0c318
2019-01-11 14:28:40 -08:00
Steven Peters
41b785b86c Fix build with boost 1.69: add missing boost/noncopyable.hpp includes (#5325)
Summary:
boost 1.69 is in a pull request in homebrew-core at https://github.com/Homebrew/homebrew-core/pull/35030 and `osquery` is failing to compile due to using `boost::noncopyable` in a couple header files without including `boost/noncopyable.hpp`:

* [jenkins log of build failure](https://jenkins.brew.sh/job/Homebrew%20Core%20Pull%20Requests/34941/version=high_sierra/testReport/junit/brew-test-bot/high_sierra/install_osquery/)

The build still fails on homebrew due to #5284.
Pull Request resolved: https://github.com/facebook/osquery/pull/5325

Differential Revision: D13464741

Pulled By: fmanco

fbshipit-source-id: bdaf573b180f8cdfd08dc719db4829911249caaf
2019-01-10 08:48:37 -08:00
Alexander Kindyakov
081d5053ee Create OSQUERY_NODISCARD to prevent non returning errors (#5331)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5331

Let's use attributes to prevent such mistakes (see previous diff in the stack)

Reviewed By: guliashvili

Differential Revision: D13504146

fbshipit-source-id: 7cab2dd345599b036fa2a27bf682f2a159fd1c08
2018-12-19 03:58:50 -08:00
George Guliashvili
ae2486ff16 fix xcode duplicate target names (#5323)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5323

xcode needs unique target names not to fail on buck generated project

Reviewed By: marekcirkos, akindyakov

Differential Revision: D13449869

fbshipit-source-id: 73511aeaa3245586adc293fbe0311f51f71ea12f
2018-12-13 16:13:44 -08:00
Jonathan Keljo
5f81138eaf Four new "add" wrapper JSON methods
Summary:
Manual port of https://github.com/facebook/osquery/pull/5153 to the new build system.

New methods to allow adding larger numeric types.

Reviewed By: guliashvili

Differential Revision: D13422612

fbshipit-source-id: 6b503553f05139351f803ea6fcc5c825e62c35ea
2018-12-12 10:40:58 -08:00
Filipe Manco
22da13d863 Remove unused and most likely broken operator== overload from error (#5318)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5318

This is most likely broken and is causing problems with some toolchains (e.g. clang on Ubuntu xenial).

Reviewed By: guliashvili

Differential Revision: D13415457

fbshipit-source-id: b4aa686913d3cfe6bb26089b0525144fae7cc928
2018-12-11 16:10:38 -08:00
Filipe Manco
6ebabe6ce0 Add missing includes to posix/filepath.cpp
Summary: These missing includes make the build fail with some toolchains.

Reviewed By: guliashvili

Differential Revision: D13414926

fbshipit-source-id: b9a7992e37751da81ec1f5a9055703bc1e3cc4bc
2018-12-11 05:00:18 -08: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
ryandeivert
68be4f10fa [aws] adding aws proxy support in ClientConfiguration (#4850) 2018-08-17 10:25:10 +01:00
Giorgi Guliashvili
ac4cbbe062
pvs-studio errors and warnings fix (#4744) 2018-07-30 23:51:35 +01:00
Max Kareta
8f7ea728d2
reworked part of cmake files (#4638) 2018-06-26 12:03:35 +01:00
Max Kareta
5aca61375f
reorganized includes to improve compile time (#4445) 2018-05-30 00:17:40 +01:00
Teddy Reed
9e98cefd22
deps: Update aws-sdk-cpp to version 1.4.55 (#4437) 2018-05-26 22:09:33 -04:00
Seshu Pasam
b49feec0d3 aws: Deal with missing uuid file on C5/M5 instances. (#4397) 2018-05-17 22:33:34 -04:00
Teddy Reed
f6d077cbf7
license: Change license to Apache 2.0 and GPLv2 (#4007) 2017-12-18 16:04:06 -08:00
uptycs-nishant
473920d601 Removing cpp-netlib name references (#3978) 2017-11-30 11:08:48 -08:00
Teddy Reed
9b3d02ff2f remote: Various refactors for the http_client (#3882) 2017-10-24 10:08:42 -07:00
uptycs-nishant
d8b700ab74 Implementing http_client based on boost.beast and adding proxy support to tls logger (#3623) 2017-10-22 22:00:29 -07:00
Seshu Pasam
863cd72e17 AWS code refactoring. (#3660) 2017-09-07 09:26:17 -07:00
Nick Anderson
093d1337c1 deps: fixing up aws-sdk-cpp choco build script (#3648) 2017-09-05 08:00:08 -07:00
Alessandro Gario
6489c8b050 logging: Add Firehose/Kinesis support to Windows (#3641) 2017-09-03 16:52:47 -07:00
Teddy Reed
7b2f905f43 aws: Fix TSAN warning in request exception (#3556) 2017-08-21 01:04:58 -07:00
Seshu Pasam
6495f14828 EC2 instance tags implementation. (#3507) 2017-08-02 13:40:59 -07:00