Commit Graph

1710 Commits

Author SHA1 Message Date
Teddy Reed
b6f09a7ecb Add action for snapshot query results (#2061) 2016-05-03 11:16:22 -07:00
Zachary Wasserman
4bb95a3a29 Fix AWS credentials test failure when env vars set (#2062) 2016-05-02 19:17:09 -07:00
Teddy Reed
9c541ee1ce [Fix #2058] Send Content-Encoding when using TLS compression (#2060)
When the configuration flag: --logger_tls_compress is used the client should
send a "Content-Encoding: gzip".
2016-05-02 18:03:04 -07:00
Zachary Wasserman
5f778a201b Prevent error when TLS response body is empty (#2053) 2016-04-25 18:10:12 -07:00
Zachary Wasserman
262833c86a Add AWS Kinesis and Firehose logger plugins (#2045)
This commit adds logger plugin implementations for the Amazon
Kinesis (https://aws.amazon.com/kinesis/) and Kinesis
Firehose (https://aws.amazon.com/kinesis/firehose/) services. To support
these plugins there are a number of utility classes and functions for
AWS authentication, configuration and API integration. The logger plugin
implementations take advantage of the BufferedLogForwarder base class
for reliable buffering and batch sending of logs. In their current
implementations, the logger plugins only support sending of result logs
to these AWS services.
2016-04-25 16:19:51 -07:00
Zachary Wasserman
9be5c465ef Improve error messages for TLS JSON (de)serialization (#2050) 2016-04-22 11:29:56 -07:00
yying
18013da24b Initial support for building on Windows (#2015)
* Committing changes related to our experimentation with a "pure" Win64 build

* Placates CMake such that a Visual Studio 14 x64 solution is generated!

* Updated changes to fix the issue of GFlags not being found.

* Added cases to handle Win64 specific CMake options such as include/link
directories and compiler options

* Comment change in CMakeList.txt

* Changed wording of get_platform error message. Adding Powershell
provisioning script.

* Finalized provision powershell script

* Added a deployment XML file for insuring C++ support exists for VS2015

* Added admin check and resolved some potential PATH issues.

* Fixed some potential bugs in VS2015 automated install

* Adding a wrapper for provision.ps1 so people don't need to know obscure
powershell syntax

* Fixing a bug with third-party archive extraction

* Ignoring the updating of pip for now...

* Fix invocation of choco.exe

* Resolved pip install issues

* Removed some debugging residue

* Changing get_platform.py from tabs to spaces

* Added distro detection for ubuntu and darwin

* Using 4 spaces

* Added a newline after powershell invocation

* Added OS detection for freebsd and fedora

* Fixed bug with freebsd

* Adding arguments parsing to prepare for modularizing platform detection

* Removing bash platform detection logic and forwarding the task to
get_platform.py

* Removing get_platform support in provision.sh since it doesn't appear to
be used anywhere now

* Fixed some comment/spacing issues. Made a few efficiency changes

* A few bug fixes, revereted back to WIN32 variable for now

* Added Facebook copyright information.

* Fixed boost and rocksdb library paths

* Added support for installing our custom chocolatey packages

* Fixed path to ignore the symlink

* Force environment variable propagation

* Forgot to add new line after make-win64-dev-env.bat

* Added error handling for choco install failures

* Handles download and python/pip errors

* When chocolatey is not detected, refreshenv.bat is not found in the PATH.
Hardcode the PATH as per chocolatey install instructions

* Takes care of updating git submodules in third-party\

* Fixes a bug in which Linux provisioning fails because of unset FAMILY
env var.
2016-04-15 14:01:16 -07:00
Zachary Wasserman
9370d9e1f5 Fix pessimizing move warnings (#2040)
Fixes warnings generated by Clang when `std::move` is used in a `return`
statement. Verified by `make clean`, saw no warnings, `make test` passes.
2016-04-15 13:15:23 -07:00
Zachary Wasserman
2376fedb73 Introduce BufferedLogForwarder (#2036)
BufferedLogForwarder is a base class for external log forwarding schemes
that require buffering and retries. It generalizes the logic from the
existing TLSLogForwarderRunner.

The existing TLSLoggerPlugin and TLSLogForwarderRunner are refactored to
demonstrate the use of this new base class.
2016-04-15 09:49:35 -07:00
Serey Ty
a8c8e9e9cb fix the cpu id displayed in core column (#2038) 2016-04-15 08:38:32 -07:00
Nick Anderson
134c2750c2 Adding Crash Logs table for OS X (#2027)
Added a table that parses out some of the informaiton in the OS X logs
stored in /Library/Logs/DiagnosticReports as well as
/Users/<user>/Library/Logs/DiagnosticReports
2016-04-13 16:25:40 -07:00
Teddy Reed
a98e483ef5 Reset configuration state in relative tests 2016-04-12 13:06:02 -07:00
Teddy Reed
192953bcd3 [Fix #2030] Add generate_foreign and --enable_foreign (#2034) 2016-04-11 09:33:45 -07:00
Zachary Wasserman
8cb862e327 Allow TLS to proceed without node key if enrollment disabled 2016-04-07 08:47:03 -07:00
Justin Gerace
8207feecd1 Add time column to shell_history table
* Add time column to shell_history table

* Add support for zsh timestamp format in shell_history table
2016-04-05 11:02:14 -07:00
Zachary Wasserman
f8ff713d81 Add type safe dispatcher pause APIs
These APIs using std::chrono::duration allow us to take advantage of
automatic time conversion and type safety among different units of time.
No changes were made to existing call sites.
2016-04-01 20:53:51 -07:00
Zachary Wasserman
cebd103e9b Add gmock into gtest CMake config 2016-04-01 14:59:24 -07:00
Teddy Reed
c159ea7c71 Refactor install_history 2016-04-01 10:02:56 -07:00
Tim Zimmermann
5c47e2b91e Add InstallHistory table
See #1922.
2016-04-01 09:51:01 -07:00
Teddy Reed
97690b1b95 Merge pull request #1983 from theopolis/decorators
Introduce decorator queries
2016-03-30 21:04:31 -07:00
Teddy Reed
c727b6d015 Merge pull request #1961 from zwass/syslog_events
Add syslog table for querying of rsyslog logs
2016-03-30 14:22:34 -07:00
Zachary Wasserman
98cdd3643f Add linux syslog virtual table
This commit adds an event-based virtual table implementation for
querying the linux syslog. It introduces an event publisher that
attaches to a named pipe to ingest CSV formatted syslog forwarded from
rsyslogd. An event subscriber/virtual table makes these log lines
available for queries. Currently, no additional processing is done on
the input data besides parsing.

Using this table requires a properly configured rsyslogd. Documentation
for this configuration is forthcoming in the wiki.
2016-03-30 13:36:57 -07:00
Justin Gerace
0c07203121 Add more Scientific Linux conditionals 2016-03-29 23:56:11 -07:00
Teddy Reed
4de0737ce4 Add test for SchedulerRunner 2016-03-29 15:27:07 -07:00
Teddy Reed
e3436c72ef Merge pull request #1981 from PoppySeedPlehzr/master
Treating the disabled plugins as a folder
2016-03-29 15:24:45 -07:00
Nick Anderson
7677494849 Treating the 'Disabled Plug-ins' as a folder as opposed to a plugin, and added a 'disabled' column to the table 2016-03-29 14:28:25 -07:00
Teddy Reed
2379493721 Introduce decorator queries 2016-03-29 10:03:50 -07:00
Mike Arpaia
d70affe3d3 [Fix #1962] Clear cache of distributed query results after flush
If the distributed plugin's `writeResults` method can be successfully
called, we must clear the local vector of results so that we're not
constantly growing it over time.
2016-03-29 09:26:27 -07:00
Zachary Wasserman
91691f71d6 Update flaky test for ASL table
Previously, this test relied on there being console messages available
to query for. Now, it actually writes a message to ASL, then verifies
that the message can be found. It also exercises a more complicated
query than previously. Also remove potentially high latency queries.

Fixes issue #1975
2016-03-28 14:06:53 -07:00
Teddy Reed
2a350afb10 Merge pull request #1974 from theopolis/sane_logging_disable
[Fix #1973] Improve logging/extensions relays
2016-03-27 01:00:16 -07:00
Teddy Reed
b9194026db [Fix #1973] Improve logging/extensions relays 2016-03-27 00:43:02 -07:00
Teddy Reed
e663d91f00 Merge pull request #1972 from theopolis/fix_1971
[Fix #1971] Use recursive locks for config data predicates
2016-03-26 22:27:45 -07:00
Teddy Reed
a18444813b [Fix #1971] Use recursive locks for config data predicates 2016-03-26 21:52:22 -07:00
Zachary Wasserman
0eff0f2f4e Collection of doc fixes
- Minor fix in creating tables documentation
- Fix docs for join
- Add note about config paths
- Update events docs
- Fix link to query packs
2016-03-25 14:12:41 -07:00
Teddy Reed
684697ba8d Merge pull request #1963 from theopolis/yara_move
Add move events to yara_events
2016-03-24 12:16:18 -07:00
Teddy Reed
339f142da4 Add move events to yara_events 2016-03-24 11:24:54 -07:00
Teddy Reed
d2d1431061 Move dispatcher to public API 2016-03-21 15:27:51 -07:00
Teddy Reed
52a3285c18 Merge pull request #1953 from theopolis/pgroup
[Fix #1878] Rename processes 'group' to 'pgroup'
2016-03-20 22:14:08 -07:00
Teddy Reed
eb76fc1860 Rename processes 'group' to 'pgroup' 2016-03-20 19:35:49 -07:00
Teddy Reed
27f4754e5e [Fix #1928] Reorder deps installs to build all with clang 2016-03-20 19:15:44 -07:00
Teddy Reed
482eecfab1 Protect udev publisher from fast interrupts 2016-03-20 18:46:34 -07:00
Teddy Reed
59196b6f44 Merge pull request #1952 from theopolis/profile_fix
Fix shell's --profile switch
2016-03-20 16:37:46 -07:00
Teddy Reed
ebb0ab30ce Fix shell's --profile switch 2016-03-20 16:05:13 -07:00
Teddy Reed
89c32de89d Merge pull request #1950 from friedbutter/signature_multiple_results
add feature to select multiple rows to signature table
2016-03-20 13:53:09 -07:00
Teddy Reed
15a998e54f Use the default shutdown flow within extensions 2016-03-20 01:45:49 -07:00
Sereyvathana Ty
0706146c01 add feature to select multiple rows to signature table 2016-03-19 17:42:21 -07:00
Teddy Reed
4609486f74 Merge pull request #1947 from theopolis/osx_publisher_locks
Enhance publisher resource locking on OS X
2016-03-18 19:13:55 -07:00
Teddy Reed
54578df073 Merge pull request #1946 from theopolis/debian_packages_fixup
Fixup Debian package builds
2016-03-18 18:17:33 -07:00
Teddy Reed
9f5de79af1 Fixup Debian package builds 2016-03-18 16:59:59 -07:00
Teddy Reed
d7c2f88289 Enhance publisher resource locking on OS X 2016-03-18 16:14:15 -07:00
Teddy Reed
3576189281 Check for interrupt requests in TLS config refresher 2016-03-18 12:03:27 -07:00
Teddy Reed
c62a0f41b6 Various cleanups 2016-03-18 10:40:07 -07:00
Teddy Reed
3e103e69ba Merge pull request #1931 from ilovezfs/iokitlib-header-casesensitivity
IOKitLib.h not IOKitlib.h
2016-03-16 22:32:03 -07:00
Teddy Reed
593f024514 Merge pull request #1936 from theopolis/events_ex
Expire data when record is before expire time
2016-03-16 12:58:21 -07:00
Teddy Reed
7040780863 Expire data when record is before expire time 2016-03-16 12:35:06 -07:00
Teddy Reed
621f1bd3a9 [Fix #1896] Gate additional and kernel tests/benchmarks 2016-03-15 23:05:37 -07:00
Teddy Reed
bb20a968d9 Merge pull request #1930 from theopolis/debug
Build debug packages
2016-03-15 11:12:56 -07:00
ilovezfs
52e7d55600 IOKitLib.h not IOKitlib.h
As with all other appearances of IOKitLib.h in the osquery sources, use
the capitalization "IOKitLib.h" not "IOKitlib.h" to avoid build failure
on case-sensitive file systems.
2016-03-15 09:43:11 -07:00
Teddy Reed
42222bd4a5 Build debug packages 2016-03-15 08:58:01 -07:00
Sereyvathana Ty
f912fca415 add cdhash, team_identifier, and authority to signature table
cdhash - code directory hash
(https://developer.apple.com/library/mac/documentation/Security/Conceptu
al/CodeSigningGuide/RequirementLang/RequirementLang.html)

team_identifier is a unique id of the app developer

authority is the common name of the signed certificate
2016-03-14 23:19:27 -07:00
Zachary Wasserman
1af6684019 Apple system log virtual table implementation
This adds a virtual table implementation for efficient querying of the
Apple System Log (ASL) store.
2016-03-14 12:19:03 -07:00
Teddy Reed
0ba2861cf9 [Fix #1920] Detach thread before joining/clearing (terminate) 2016-03-13 12:15:18 -07:00
Teddy Reed
59274e59c6 Remove boost::thread from fsevents tests 2016-03-12 00:30:05 -08:00
Teddy Reed
21c7ab642b Remove boost::thread from inotify tests 2016-03-12 00:15:58 -08:00
Teddy Reed
3de52846d0 Remove boost::thread 2016-03-11 11:50:44 -08:00
Teddy Reed
bc384ba7ad Merge pull request #1914 from russellhancox/certificate-files
Darwin: Allow certificates table to read DER/PEM files
2016-03-11 08:19:51 -08:00
Russell Hancox
05c1dbecb0 Darwin: Allow certificates table to read DER/PEM files as well as keychain 2016-03-11 11:02:54 -05:00
Teddy Reed
d3786c45a3 Merge pull request #1916 from theopolis/deps_updates
Several package updates within provision code
2016-03-10 20:26:04 -08:00
Teddy Reed
32efa9a09b Several package updates within provision code
1. Update boost to 1.60 from 1.55 on Linux platforms
2. Add asio (1.11.0) to the deps set
3. Update snappy to 1.1.3 on Linux platforms
4. Update cpp-netlib to 0.12.0-rc1 from 0.11 on Linux platforms
 - OS X and brew also include 0.12.0-rc1 as a devel option
5. Update libapt to 1.2.6 from 0.8.6 on Ubuntu/Debian
 - This adds lzma as a dependent link
2016-03-10 19:40:15 -08:00
Zachary Wasserman
c91798b083 Add path to error message when config file not found
Example:
```
$ sudo ./build/darwin/osquery/osqueryd --allow_unsafe --config_path
/foo/bar
W0310 13:34:40.473743 1955008512 init.cpp:506] Error reading config:
config file does not exist: /foo/bar
```
2016-03-10 14:13:08 -08:00
Teddy Reed
9d8c3adef7 Merge pull request #1879 from theopolis/lints-2
Fix various lint issues
2016-03-10 01:10:42 -08:00
Teddy Reed
96e2562e2d Merge pull request #1913 from sharvilshah/process_state_mnemonics
[#1886] Use mnemonics for process states on Darwin
2016-03-09 23:30:41 -08:00
Teddy Reed
26c8b5640f Fix various lint issues 2016-03-09 19:55:39 -08:00
Teddy Reed
03d0d7e835 Merge pull request #1910 from theopolis/null
Allow NULL values, stop using -1 as int/double invalid values
2016-03-09 19:23:35 -08:00
Teddy Reed
a6c147700f Allow NULL values, stop using -1 as int/double invalid values 2016-03-09 18:24:17 -08:00
Sharvil Shah
a713fbcc55 Use mnenomics for process states on Darwin
Process states in `processes` table now use mnemonics instead of the
integer code. They follow closely to the states defined sys/proc.h,
which means processes with state as:

  state    value   meaning                           mnemonic
 -------- ------- --------------------------------- ----------
  SIDL     1       process being created by fork     'I'
  SRUN     2       currently runnable                'R'
  SSLEEP   3       sleeping on an address            'S'
  SSTOP    4       process debugging or suspension   'T'
  SZOMB    5       awaiting collection by parent     'Z'

Note: The mnemonics here will not match up with what `ps` or `top`
reports.

`ps` and `top` queries run state of all Mach Threads (by grabbing a Mach Task)
of a process, and then coalesces it to represent the process state.

This is no longer possible to do by non-Apple signed binaries,
as the only way to a Mach Task (and therefore list of Mach Threads)
is by calling `task_for_pid()`, which no longer works under
System Integrity Protection (SIP) introduced in OS X 10.11
2016-03-09 11:25:58 -08:00
Teddy Reed
d8650c7630 Minor changes to support a Windows build 2016-03-08 10:47:38 -08:00
Teddy Reed
6f69330920 Merge pull request #1907 from theopolis/fix_1900
Allow extensions to use the backing store
2016-03-08 10:45:56 -08:00
Teddy Reed
b5defa7436 Allow extensions to use the backing store 2016-03-08 08:56:03 -08:00
Teddy Reed
44488fe0a6 Merge pull request #1895 from DaanDeMeyer/cpu_time
Cpu time table implementation (solves #1889)
2016-03-08 08:20:12 -08:00
Daan De Meyer
d4737f9214 Create table called cpu_time for inspecting where the cpu cores spent time since the last system restart. 2016-03-08 15:14:06 +01:00
Teddy Reed
53c108d02e Merge pull request #1902 from theopolis/remove_glog
Remove Glog from third-party build
2016-03-07 14:53:32 -08:00
Teddy Reed
956ce75601 Remove Glog from third-party build 2016-03-07 12:54:00 -08:00
Teddy Reed
5f8fa32e21 [Fix #1901] Tear down TLS server runner 2016-03-07 09:38:37 -08:00
Teddy Reed
677c448dea Merge pull request #1897 from theopolis/remove_rdb
Refactor backing storage
2016-03-06 21:09:23 -08:00
Teddy Reed
afd17f8134 1. Reorganize RocksDB database handle into a plugin
2. Introduce a SQLite-based database plugin
3. Refactor database usage to include local 'fast-calls'
4. Introduce an 'ephemeral' database plugin for testing (like a mock)
2016-03-06 20:40:16 -08:00
Teddy Reed
bcd0debaee Merge pull request #1894 from theopolis/sql_debug
Add define to enable SQLite WHERETRACE
2016-03-06 09:32:18 -08:00
Teddy Reed
8607d319a1 Merge pull request #1893 from theopolis/dm_bind
[Fix #1892] Build devmapper statically
2016-03-04 21:04:05 -08:00
Teddy Reed
8c3d2387e9 Add define to enable SQLite WHERETRACE 2016-03-04 20:41:06 -08:00
Teddy Reed
5fbde8ec4f [Fix #1892] Build devmapper statically 2016-03-04 20:09:43 -08:00
Teddy Reed
683e5c1778 Merge pull request #1890 from theopolis/join_tests
Add high level join tests for processes, file, and hash
2016-03-03 22:01:47 -08:00
Teddy Reed
ee1182f526 Add high level join tests for processes, file, and hash 2016-03-03 18:47:55 -08:00
Joe Gallo
544ae37e9d add fan name to fan speeds table 2016-03-03 19:44:53 -05:00
Teddy Reed
297d6ae1c3 [Fix #1887] Do not generate row for invalid pids 2016-03-03 13:47:27 -08:00
Teddy Reed
69fe7ca4be Merge pull request #1884 from russellhancox/fix-darwin-groups
Darwin: Use undocumented getgroupcount() before getgrouplist
2016-03-02 13:58:33 -08:00
Teddy Reed
f08c1c5ec5 Merge pull request #1885 from theopolis/fix_1874
[Fix #1874] Update SQLite to 3.12.0
2016-03-02 12:37:21 -08:00
Teddy Reed
489a5e839c [Fix #1874] Update SQLite to 3.12.0 2016-03-02 10:12:41 -08:00
Russell Hancox
cc964af444 Darwin: Use undocumented getgroupcount() before getgrouplist 2016-03-01 09:39:01 -05:00
Teddy Reed
94c9824f12 Merge pull request #1876 from sharvilshah/fix_leaks
Fix potential leak in Darwin disk_encryption table
2016-02-27 17:38:17 -08:00
Sharvil Shah
cf573d668e Fix potential leak 2016-02-26 14:54:23 -08:00