Commit Graph

87 Commits

Author SHA1 Message Date
Teddy Reed
cb428e105e
Apply scheduler_timeout correctly (#6618) 2020-09-03 23:56:16 -04:00
Breakwell
6d57dc8066
Windows 32 bit Support (#6543) 2020-09-01 23:29:26 -04:00
Teddy Reed
0d3bd8d476
database: Change reset interval from 5m to 1hr (#6614) 2020-08-29 20:22:53 -04: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
Teddy Reed
8ee7e3a3b0
refactor: Move osquery/include files to appropriate places (#6557) 2020-08-11 11:54:54 -04:00
Omer Katz
d70417270a
Scheduler code clean up (#4633)
Co-authored-by: Teddy Reed <teddy@casualhacking.io>
2020-07-21 23:02:36 -04:00
Ted Reed
96c74a99e1 detangle: Move osquery shutdown logic outside of Initializer
The goal is to have less inter-dependency within osquery components.
This is the first of several changes that take small steps towards a
simpler dependency graph.

Later we can revisit the directory structure to see if we can convey
what components are intended to be widely used and what components
are specialized.
2020-07-09 10:38:53 -04:00
Breakwell
a154e45026
Add additional logging in the watcher for windows (#6376)
Co-authored-by: Teddy Reed <teddy@casualhacking.io>
2020-05-25 12:33:21 -04:00
seph
b85f8cb00a
Non-error status messages should be verbose (#6271)
Non-error status messages should be verbose
2020-02-25 21:18:02 -05:00
Teddy Reed
11ae5a21b0
docs: Move the schedule_max_drift description into docs (#6003) 2019-11-06 23:34:55 -05:00
Teddy Reed
04896c85cd
killswitch: Remove killswitch code (#5949)
This was determined to be the wrong approach to adding simple
killswitches. The intent was to quickly flip on/off features. It was
not widely adopted due to the dependencies killswitching has.

A different approach is to implement the same functions with something
simple like filesystem flags.
2019-10-29 19:14:35 -04:00
George Guliashvili
af68bfa122 Per owner monitoring
Summary: Add per owner monitoring capability.

Reviewed By: jessek

Differential Revision: D14478621

fbshipit-source-id: 99193d64d71d7261ae9fc6cd061f4dbb0c7f3a39
2019-03-15 07:20:09 -07:00
George Guliashvili
02e843607d Improve query monitoring
Summary: Improving query monitoring by adding monitors for each owner.

Reviewed By: marekcirkos

Differential Revision: D14359616

fbshipit-source-id: 85d69b74b363cb73f38f388096e36d88cbe0446b
2019-03-08 03:21:45 -08:00
Jeremy Calvert
c8bb439442 OSQueryd changes for encoding type in JSON syntax
Summary:
Add log_numerics_as_numbers flag.

Internal SQLite query has method that returns QueryDataTyped (instead of QueryData), which are boost::variant<string, double, long long>.

Ints are encoded as such if and only if new log_numerics_as_numbers flag is set to true.

Reviewed By: fmanco

Differential Revision: D13778323

fbshipit-source-id: 7d7bb31781486f63fcc088cd479d3b6f255a5cb4
2019-03-04 09:15:21 -08:00
George Guliashvili
ea766bcd3a Add query monitoring
Summary: Add query monitoring without specifying the scheme. It will help us in the simpler aggregation.

Reviewed By: marekcirkos

Differential Revision: D14280109

fbshipit-source-id: d70971c9ebe1e15c66f36e1490b7d8e198a68a7a
2019-03-04 05:37:37 -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
George Guliashvili
758706331f Remove unused flag enable_monitor
Summary: Removing flag which was declared but never used. enable_monitor

Reviewed By: marekcirkos

Differential Revision: D13958265

fbshipit-source-id: 3a812330950b101abdbd83ada4afd5b262cabd26
2019-02-07 08:16:00 -08:00
George Guliashvili
6f8b044a4c Use machine identity for monitoring
Summary: For some monitoring, we need to include machine identity. Two example, I found is hostname or similar hostnames schema name.

Reviewed By: SAlexandru

Differential Revision: D13880705

fbshipit-source-id: e1d0238f4981adad1554d73f0ef6e5ef65a98c33
2019-02-04 11:08:32 -08:00
George Guliashvili
5ec525aaed Rename profiler.[cpp|h] to code_profiler.[cpp|h]
Summary: profiler file contained the CodeProfiler class, which is a bit odd. Thanks alecx

Reviewed By: akindyakov

Differential Revision: D13861320

fbshipit-source-id: 11d711fd1d15830d4cce0be084cc6da3b1c6589c
2019-01-30 08:11:21 -08:00
George Guliashvili
7edf72ed6d Split query name and pack name
Summary:
Split query name and pack name with the delimiter(dot) which should not accrue inside their names(instead of _ or -).
Also log things per pack name

Reviewed By: SAlexandru

Differential Revision: D13854471

fbshipit-source-id: 181e7e19fcfb5d57a779cea6a2804eda09dc5a91
2019-01-30 06:50:08 -08:00
George Guliashvili
c7a9338819 Split query name and pack name
Summary:
Split query name and pack name with the delimiter(dot) which should not accrue inside their names(instead of _ or -).
Also log things per pack name

Reviewed By: mkareta

Differential Revision: D13854389

fbshipit-source-id: 35ba80813d98371dd36a83ec32aad677f24aa6eb
2019-01-30 06:50:07 -08:00
George Guliashvili
745758d5cd Allow CodeProfiler to send the same thing for multiple keys
Reviewed By: SAlexandru

Differential Revision: D13844446

fbshipit-source-id: aabdde2aa1e5480868d2363c88891559ce12b4f6
2019-01-30 06:50:07 -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
Jeremy Calvert
80351aff7d Get rid of size field in QueryPerformance
Summary: As discussed in [an old PR](37ffdf8a48 (r213278358)) this is of questionable benefit and will get complicated when we change to typed values, so dropping.

Reviewed By: guliashvili

Differential Revision: D13631227

fbshipit-source-id: ada9b5434297d8c1c4b3e3855fe595faf5937bf6
2019-01-11 12:25:49 -08:00
George Guliashvili
971bee4441 Move build system to BUCK
fbshipit-source-id: 8ffef5e6a393ac67ce56dcb74845402e43d964a0
2018-12-07 16:12:35 +00:00
Nick Anderson
0314871908
bug: explicitly set safe permissions on osquery dbs (#5229) 2018-09-18 22:51:29 -07:00
Giorgi Guliashvili
53a48d8fb4
posix profiling (#5187) 2018-09-14 16:04:28 +01:00
Giorgi Guliashvili
c301e361ca
executing query monitor under killswitch (#5170) 2018-09-03 18:02:40 +01:00
Giorgi Guliashvili
4b7e211965
pauseMili to pause transform (#4796) 2018-08-02 16:57:02 +01:00
Alexander
ce59c72145
Profile scheduled queries using numeric monitoring plugins (#4739)
Profile scheduled queries using numeric monitoring plugins
2018-07-24 11:33:47 +01:00
Giorgi Guliashvili
80bfef9f77
setThreadName boilerplate removal (#4749) 2018-07-23 19:50:35 +01:00
Mitchell Grenier
69d307b64c
Add labels for threads (#4295) 2018-07-23 11:13:43 -07:00
Alexander
422c1400b8
Simple solution to reduce drift time in loop of scheduled queries (#4393)
* Simple solution to reduce drift time in loop of scheduled queries #4301

based on measuring time of loop step and reduce sleep time on it.

* Change schedule time drift compensation policy

Sleep less time or do not sleep at all if there is non-zero accumulated drift.
Also new flag [schedule_max_drift] was added to make it configurable.

* Add test to check time drift accumulation and fix up code according review comments
2018-05-29 18:48:43 +01:00
Jonathan Keljo
1ea714a325 Plumb used columns into QueryContext; use that to make processes table more efficient on macOS (#4269) 2018-05-12 09:07:57 -07:00
Alexander
1a48150be0 Pass name of query to lambda in Config::scheduledQueries by value (#4367) 2018-05-09 14:56:19 +01:00
Nick Anderson
6ba14264e7
bug: fix handle leaks in Windows process functions (#4323) 2018-04-24 14:48:51 -07:00
Teddy Reed
483fbbb594
query: Force query results into proper order (#2947) 2018-01-21 01:20:48 -05:00
uptycs-nishant
1acc7b91ef Reducing memory footprint of osquery by achieving zero-copy (#3977) 2017-12-27 19:43:20 -08:00
Teddy Reed
f6d077cbf7
license: Change license to Apache 2.0 and GPLv2 (#4007) 2017-12-18 16:04:06 -08:00
Teddy Reed
523ad777a8
[Fix #3931] Remove removed results correctly (#3938) 2017-11-18 15:21:11 -08:00
Teddy Reed
d106647c7f tables: Require explicit requests for query results caching (#3805) 2017-10-12 20:00:51 -07:00
Seshu Pasam
6fab8b6083 logging: adding "counter" to differentiate initial results (#3651)
When setting up alerts for differential logs data you might want to skip the
initial added records. counter can be used to identify if the added records
are all records from initial query of if they are new records. For initial
query results that includes all records counter will be "0". For subsequent
query executions counter will be incremented by 1. When epoch changes, counter
will be reset back to "0".
2017-09-07 15:01:15 -07:00
Teddy Reed
cf170c4278 cleanup: Move query out of database header (#3576) 2017-08-20 02:44:38 -07:00
Lambda Conjecture
ecb9e2ccf2 Add Epoch marker to scheduled query results (#3378) 2017-07-07 17:56:03 -07:00
Teddy Reed
b38a62be8b config: Rename getInstance to get for consistency (#3350) 2017-05-28 23:04:53 -07:00
Teddy Reed
76fe5d748c logging: Allow Glog reentrancy (#3142) 2017-04-06 15:57:44 -07:00
Teddy Reed
e330203e9d Remove enable_monitor flag functions (#3123) 2017-04-01 23:05:45 -07:00
Teddy Reed
bc85f726ad events: Execute schedule before expiring (#3091) 2017-03-21 12:38:04 -07:00
Jonathan Lee
a1de136c1a Change logging level in certain cases (#2896) 2017-01-31 08:07:42 -08:00