Commit Graph

1921 Commits

Author SHA1 Message Date
Zachary Wasserman
8909602a40 Increase block period in flaky BufferedForwarder test (#2222)
This test was intermittently failing because it relies on the actual thread
scheduling. Our discussion in issue #2218 decided that it was worth keeping the
test around, while trying to mitigate the flakiness. The longer sleeps in this
test ran successfully hundreds of times in local testing.
2016-07-06 14:59:24 -07:00
Teddy Reed
21d1fca37d Add shutdown method to extensions (#2224)
This alters the osquery.thrift spec to add a ::shutdown method to the
Extension class. The ExtensionManager inherits from this but includes a
no-op shutdown method.

When an ExtensionManager (osquery core) stops, it optionally requests all
Extensions to shutdown immediately. This helps quit extensions processes
faster.
2016-07-06 12:23:24 -07:00
artemdinaburg
bede048323 Merge posix/windows processes table into single entity (#2220) 2016-07-05 21:18:14 -07:00
Teddy Reed
f740a1f020 Fix SQLite access after ASIO usage (#2217)
Using the boost ASIO libraries before calling SQLite open causes the
"file://" protocol to be rewritten with a prepended CWD.
2016-07-05 12:56:38 -07:00
artemdinaburg
e6fbde820e Windows Daemon/Shell: Make osquery code more Windows-friendly (#2188) 2016-07-01 14:56:07 -07:00
Teddy Reed
8dfe79ad83 Use a noexcept lexical_cast for SQL type conversions (#2212) 2016-07-01 11:37:19 -07:00
Teddy Reed
662b1483d5 Remove unused variable in virtual_table (#2210) 2016-06-30 18:41:43 -07:00
Teddy Reed
1f9739eed4 [Fix #2203] Restore extension respawn limits to 20s (#2207) 2016-06-30 17:53:05 -07:00
Teddy Reed
753c023640 Fix milli/micro conversion when waiting for active plugins (#2205) 2016-06-30 13:31:32 -07:00
artemdinaburg
5292100c22 Use vector.data() to get internal vector buffers (#2204) 2016-06-30 12:32:26 -07:00
Teddy Reed
9756713e36 Adds -fpermissive and fixes 'using' for anon struct (#2200) 2016-06-29 20:15:58 -07:00
artemdinaburg
c20c91f2e5 CMake changes to build Windows tables (#2194)
This PR implements the CMake changes to build Windows tables, and serves as a follow-on to PR
2016-06-28 11:19:32 -07:00
artemdinaburg
864d77b180 Windows Daemon/Shell: Windows Processes Table (#2184)
Include table changes necessary for a Windows processes table and changes to other tables needed for daemon and shell to run. The Windows processes table uses WMI as a backend to gather information. This commit does not yet build these tables.
2016-06-28 11:07:34 -07:00
Teddy Reed
47e1a5ba74 Use noexcept boost::filesystem overloads (#2195) 2016-06-27 16:39:04 -07:00
Nick Anderson
72df044ef5 Adding check for nullptr before dereferencing. This fixes #2185 (#2187) 2016-06-24 13:59:49 -07:00
Teddy Reed
c8c67c455a Simplify watchdog limits configuration (#2173) 2016-06-19 23:27:16 -07:00
Ryan Holeman
b47f246ab4 Optional randomization of shard ids for AWS Kinesis load balancing (#2157) 2016-06-15 15:29:59 -07:00
yying
d2d9a27845 [Fix #2165] Use noexcept boost methods in PlatformFile (#2167) 2016-06-15 10:23:48 -07:00
Zachary Wasserman
79818c72ab Add newlines in firehose records (#2166) 2016-06-14 16:50:28 -07:00
Nick Anderson
cf30388705 Moved test_utils to it's own directory out of core. Updated references (#2154) 2016-06-09 10:49:26 -07:00
Teddy Reed
866ff13fc3 Fix OS X kernel extension autoload (#2151) 2016-06-08 11:14:36 -07:00
Ryan Holeman
deb9c56633 Changed stream validation from list streams to describe streams (#2141) 2016-06-07 17:17:15 -07:00
Teddy Reed
78c8e8eca9 Minor cleanups to extension autoloading (#2147) 2016-06-07 17:14:17 -07:00
Teddy Reed
91b34010df Allow table specs to use multiple row indexes (#2146) 2016-06-07 17:13:48 -07:00
Zachary Wasserman
462cd8bdbf Update AWS logger code for AWS SDK 0.12.4 (#2140)
The AWS SDK changed how custom HTTP clients are used, and this commit brings
compatibility with the new initialization style.
2016-06-07 15:06:49 -07:00
yying
9879733867 Filesystem Abstractions - Integrations (#2128)
* Integrated filesystem operation abstraction code into filesystem.cpp
* Modified filesystem unit tests to be more platform agnostic
* Added append mode for PlatformFile
* Minor bug fixes in filesystem operations
2016-06-07 14:08:50 -07:00
Teddy Reed
a8d6bc7c58 Use self-process for query join tests (#2144) 2016-06-07 13:01:07 -07:00
Teddy Reed
763f4e9437 Use SQLite 3.14.0 to support LIKE and EQUALS (#2137)
This commit bumps the third-party SQLite to the 3.14.0 pre-release (18:59).
With 3.14.0 the LIKE and EQUALS constraint operators may be mixed within a
query. Previously these would fail to produce a valid set.

As part of the support, each virtual table should choose to bypass rowid-based
deduplication using the new "WITHOUT ROWID" create table epilog. This will
be appended to the schema if the table defines a PRIMARY KEY using index=True.
2016-06-06 09:36:53 -07:00
Teddy Reed
e0f350e439 Limit SMBIOS reads to 0x000f0000-0x00100000 (#2135) 2016-06-05 13:09:03 -07:00
Nick Anderson
240958ea76 Fixed typing in FileOps tests (#2127)
Some of the types in fileops tests were causing warnings to be thrown
during build, due to type mismatch. I've added a few local variables to
quiet these warnings.
2016-06-02 15:46:55 -07:00
yying
5f81cd9e2b Filesystem Abstractions - Code and Unit Tests (#2119)
* Implemented filesystem operations abstraction code
* Added filesystem operations abstraction unit tests
* Modified CMake configurations to support the building of the abstraction code and unit tests
2016-05-31 12:20:38 -07:00
Teddy Reed
05882d717c Add basic string split and inet_aton functions (#2124)
The three new SQLite functions:
- split: Splits a column using a set of tokens and a selected index.
- regex_split: Similar to split but with a regex instead of tokens.
- inet_aton: Returns the IPv4 decimal value for a string-formatted address.
2016-05-29 02:06:02 -07:00
Teddy Reed
1cf80c9300 Fix os_version detection for Ubuntu 16.04 (#2125) 2016-05-28 20:02:58 -07:00
Teddy Reed
37544138b5 Add basic math extension functions (#2123) 2016-05-28 17:46:24 -07:00
Teddy Reed
a9ed73c68d Add removeService to Dispatcher API (#2116)
With a removeService method, combined with the abstracted thread start in
the Dispatcher API, services auto-remove when finished.

This will un-break the kernel communication tests. These tests only stop
when all their producer threads/services have ended.

This also promotes the OS X kernel build to 10.11.
2016-05-27 11:17:06 -07:00
Teddy Reed
10664a4945 Add --ephemeral for daemons and disable shell events (#2111)
This changes several initialization steps:
- The daemon (and shell, though not needed) have a new --ephemeral flag.
- Events are now disabled in the shell by default, use --nodisable_events to
  re-enable.
- RocksDB-based backing storage is now disabled in the shell by default.

The --ephemeral flag for the daemon is disabled by default and will allow
skipping configuration and database path sanity, and skipping pidfile checks.
This is intended to be used when debugging or monitoring the daemon process.

To make the RocksDB backing storage feature usage very clear we introduce a new
flag: --disable_database. The shell sets this to true unless overridden in
a flagfile or via command line arguments.
2016-05-20 08:39:04 -07:00
Teddy Reed
a5100f7b12 Disable Google Benchmark and AWS SDK from build (#2113)
See: #2112 and #2107
2016-05-19 17:23:07 -07:00
Teddy Reed
9d53a1c148 Rename time and environment columns for process_events (#2096) 2016-05-19 14:41:03 -07:00
Sharvil Shah
8b0e6e138f Fix benchmark target and bump version of google-benchmark to 1.0.0 (#2065) 2016-05-19 11:56:54 -07:00
Teddy Reed
c4acfe89e5 Introduce table aliases (#2104) 2016-05-19 09:40:43 -07:00
Teddy Reed
b28c4d8d0f Introduce table options (#2101)
Table options includes a change to the Registry::call API for TablePlugins.
When requesting route information or the 'columns' action, a new 'op' key is included.
2016-05-18 12:23:52 -07:00
Teddy Reed
50694052c4 Use POST for distributed queries within the node API (#2103) 2016-05-18 09:20:17 -07:00
yying
26ad131c38 Building osquery unit tests on Windows 10 (#2100)
Integrated process abstraction code into more locations
Defined new macros for abstracting across various platforms
Added GLOG_NO_ABBREVIATED_SEVERITIES for glog to support Windows
Fixed some minor CMake issues involving thrift
Updated gflags package; reflecting change in provision script
Preparing CMake config files for WIN32 support
2016-05-17 12:39:11 -07:00
Teddy Reed
9c01d4a6e3 Add quicklook_cache to Darwin (#2099) 2016-05-13 23:49:10 -07:00
Teddy Reed
77273f6500 Add logEvent API to logger plugins (#2088) 2016-05-13 19:48:40 -07:00
yying
15d1455957 Process Operations - osquery/core Integration (#2087)
This integrates the process abstraction operations within osquery core.
2016-05-13 19:47:45 -07:00
Teddy Reed
0ffe0c9d16 Add --pack flag to the shell (#2093)
This introduces a new testing-related flag to the osqueryi shell.
The --pack flag takes a single argument, the name of a configured pack.

To list the configured packs try:
$ osqueryi -A osquery_packs

To run all queries, immediately and serially, try:
$ osqueryi --pack NAME_OF_PACK
2016-05-12 09:22:05 -07:00
Teddy Reed
3813f09abb Clean up host identifier UUID access (#2092)
When selecting UUID as the host identifier the client follows:
- If host_identifier is set to hostname, return the hostname
- If UUID check a static UUID container
- If empty request the UUID from the backing storage, RocksDB
- If empty use the Apple hardware UUID or generate a UUID
- If the Apple UUID request fails generate a UUID

When no UUID is available in the backing store save the new UUID.
2016-05-12 08:40:37 -07:00
Teddy Reed
fcd00aff2c [Fix #2032] Remove manual Thrift library discovery (#2085)
The Thrift library should be discovered simiarly to all others.
When using the build-macros for library discovery the caller can choose
how to discover static or dynamic links.
2016-05-11 14:17:12 -07:00
yying
63c0258aec Abstracted platform specific process operations into a common interface. (#2069)
Added Windows support for process operations.
Added unit tests for process abstraction code for POSIX and Windows.
Modified CMake config files to support building the new code and unit tests.
2016-05-11 14:16:32 -07:00
Teddy Reed
ce2ba6d9c8 Refactor logStatus and logger initialization (#2081)
The initialization of a logger plugin was confusing. The 'init' step was
introduced to allow a daemon to buffer status events before a logger plugin
is determined by external/remote configuration. The buffered statuses could
then be transferred via a medium other than Glog (the default). To determine
if Glog should continue to write statuses to the filesystem the 'init' method
returned a Status.

Logger plugins should now use a feature method override to select how status
logs should be handled.
2016-05-11 12:05:09 -07:00
Teddy Reed
57c6b2a521 Revive the OS X kernel-based publishers (#2083)
The OS X kernel subscribers have not been starting because they expect the
publisher thread to run before they begin configuration. Due to some recent
refactors the publisher thread creation now occurs after configuration.

The subscriber logic to check for a valid kernel connection is still valid.

This commit has two additional side-effects:
- The RocksDB plugin is modified to use 3 background merge threads.
- The OS X kernel publisher syncing thread is now non-blocking.
2016-05-11 11:47:42 -07:00
Teddy Reed
0bb79c83e0 Remove the logHealth method from logger plugins (#2079) 2016-05-10 08:34:55 -07:00
Nick Anderson
2ac2eef3c8 Filtering out LowBattery crash logs (#2080)
The mobile 'LowBattery' crash logs provide little if any data of value,
and seem to be nothing more than notification events.  We're filtering
these out of the crashes table.
2016-05-10 08:01:28 -07:00
Teddy Reed
947799d28e Introduce within-query caching (#2077)
This adds a new optimization feature that allows expensive tables to cache
their results between JOINs. Consider JOINing a list of open sockets, for each
process, then requesting to hash each process path. This query may hash
the same path multiple times.

Within-query caching allows the hash table to respond with the previous
result of the hash request as long as the requested computation was the result
of a single query. Subsequent queries will perform subsequent hashing.
2016-05-09 10:32:33 -07:00
Nick Anderson
209900d5a8 Adding mobile device crash parsing and 'type' column to Crashes table (#2076)
This commit adds mobile device crashes to the list of crash logs parsed by the Crashes table as well as adding a lamdba to improve code reuse.  The commit also adds a 'type' column to the table to indicate what kind of log this crash log was.
2016-05-06 13:14:06 -07:00
Nick Anderson
27fa7001c9 Renamed crash_log table. Small fixes to parsing behavior (#2074)
Renamed the crash_log table to crashes for future abstraction to other
operating systems. Also fixed how the table was parsing the most recent
stack trace and the registers.  Register values are now all parsed into
one column 'registers', which will be a space delimited string of the
form:

register:value register:value ... register:value

in order to best allow for OS abstraction.
2016-05-06 09:18:06 -07:00
Teddy Reed
9011123f2d Add local_timezone and datetime (ISO) to time table (#2073)
It is often helpful to know the local timezone of the machine. For this use
local_timezone, as the base timezone will use local or UTC depending on the
--utc flag. This will be default=UTC in osquery 1.8.0.

The datetime field is added to mimic ISO 8601, along with iso_8601.
The timestamp field remains as the time stamp used for logging (within osquery)
and commonly outside of osquery. The goal for adding multiple representations
is to allow joining/augmenting of other tables.
2016-05-05 23:05:51 -07:00
Teddy Reed
921221ed46 Add osquery version to status logs (#2067) 2016-05-05 13:19:25 -07:00
Teddy Reed
9053a1f125 Include decorations within results events (#2068)
Currently, the decorations are applied to statuses and results in batch format.
This seems like an oversight, decorations should be on all results.
2016-05-05 13:19:10 -07:00
Teddy Reed
5a56805970 Introduce --utc flag to convert all calendar UNIX times to UTC (#2064)
Beginning in version 1.8.0 all time uses will converge on an osquery-provided
getUnixTime() API call that returns, by default, UNIX time integers converted
to UTC/GMT. The 'time' table will respond with the parsed time for the
configuration. If the timezone is not UTC then osquery is using localtime.

This configuration option will affect the 'unix_time' response in the 'time'
table. Because of this configurable-effect the table is extended to include
'local_time' which is always the system local UNIX time.
2016-05-03 13:00:31 -07:00
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
Teddy Reed
b21c2ed943 [#1816] Refactor DB instance management 2016-02-25 19:07:52 -08:00
Teddy Reed
c314428c66 Merge pull request #1871 from theopolis/more_tests
Add fstests and reduce SQLite scope
2016-02-23 23:54:25 -08:00
Teddy Reed
cf40b8a967 Merge pull request #1869 from theopolis/deps_cxxflags
Add CXXFLAGS to deps build
2016-02-23 23:49:47 -08:00
Teddy Reed
897b2225b1 Add fstests and reduce SQLite scope 2016-02-23 17:09:02 -08:00
Teddy Reed
08a1d852a2 Add CXXFLAGS to deps build 2016-02-22 22:12:06 -08:00
Teddy Reed
50440ddea5 [Fix #1866] Emit warning log with unknown options 2016-02-22 21:39:17 -08:00
Teddy Reed
9c42ba51b3 Merge pull request #1858 from theopolis/sqlite_3.11
Bump sqlite to 3.11.0
2016-02-21 23:35:01 -08:00
Teddy Reed
9a54af29ce Bump sqlite to 3.11.0 2016-02-21 22:40:37 -08:00
Teddy Reed
3101a32b01 Improve logging tests, add filesystem logger tests 2016-02-21 19:40:16 -08:00
Teddy Reed
4b60d8f9d4 Merge pull request #1863 from theopolis/fix_1861
[Fix #1861] Add newline to all filesystem logger writes
2016-02-21 17:05:02 -08:00
Teddy Reed
c1b2af92c3 [Fix #1854] Unify power sensor tables 2016-02-21 16:02:58 -08:00
Teddy Reed
14ff03dbf7 [Fix #1861] Add newline to all filesystem logger writes 2016-02-21 14:12:58 -08:00
Teddy Reed
2b304154d2 Merge pull request #1856 from theopolis/cppnetlib_0.12_sni
[Fix #1746] Add SNI options for TLS plugins
2016-02-21 12:29:31 -08:00
Teddy Reed
4d41f7e5ba [Fix #1746] Add SNI options for TLS plugins 2016-02-19 22:39:29 -08:00
Joe Gallo
3cb18f9428 add powers table 2016-02-17 21:59:32 -05:00
Joe Gallo
b8d32a74ec add currents table
add smc genCurrent test
2016-02-13 16:09:14 -05:00
Teddy Reed
15b037542e Merge pull request #1850 from theopolis/consolidate_conversions
Consolidate string/text conversions outside of API
2016-02-13 09:53:03 -08:00
Joe Gallo
9704d3183a fix smc celsius -> fahrenheit calc
Add smc tests for temperatures, voltages.
2016-02-12 18:53:27 -05:00
Teddy Reed
2b6070d1dc Merge pull request #1848 from theopolis/fix_1828
[Fix #1828] Remove inline include from distributed
2016-02-12 13:12:55 -08:00
Teddy Reed
44c27a9e5f Merge pull request #1849 from kaizensoze/consolidate-converting-smc-hex-string-value-to-decimal
consolidate smc hex val -> float conversion
2016-02-12 12:59:16 -08:00
Teddy Reed
8dc0fc1c95 Consolidate string/text conversions outside of API 2016-02-12 11:38:15 -08:00
David Evens
cb1662aa79 Build fix for file_events_tests 2016-02-12 11:11:53 +00:00
Joe Gallo
89d8b3a654 consolidate smc hex val -> float conversion
Consolidate logic for returning a float given a smc type and value.
2016-02-12 03:49:45 -05:00
Teddy Reed
a9f1c65324 [Fix #1828] Remove inline include from distributed 2016-02-11 22:19:49 -08:00
Teddy Reed
dfbe049357 Exit shell with CTRL+C 2016-02-11 22:04:53 -08:00
Baraa Hamodi
21c2237eca [osquery] Update copyright headers to new format. 2016-02-11 11:48:58 -08:00
Teddy Reed
4031e299bb Cleanup/stabilize file_events-related APIs 2016-02-10 22:50:38 -08:00
Teddy Reed
90d2ac4c76 Merge pull request #1839 from sharvilshah/uuid_all_the_things
[#1800] Add UUID to users and disk_encryption on Darwin
2016-02-10 16:01:48 -08:00
Sharvil Shah
daf7777b54 [#1800] Adds uuid and user_uuid columns to the users table and
`disk_encryption` table on Darwin, respectively.
2016-02-10 13:12:43 -08:00
Teddy Reed
b3c8218df7 Merge pull request #1838 from kaizensoze/add-voltages-table
add voltages table
2016-02-10 12:26:57 -08:00
Teddy Reed
48a1adf77b Allow extensions autoloading in osqueryi 2016-02-10 10:20:23 -08:00
Joe Gallo
36ca9f5664 add voltages table 2016-02-10 04:10:44 -05:00
Teddy Reed
09788cd000 Merge pull request #1834 from theopolis/dns
Add dns_resolvers table
2016-02-09 09:38:26 -08:00
Teddy Reed
f252431706 Add dns_resolvers table 2016-02-08 21:52:23 -08:00
Teddy Reed
02eb57fc47 Merge pull request #1832 from theopolis/pack_valid
Valid bool in packs for shard/plaform/version checking
2016-02-06 20:29:55 -08:00
Teddy Reed
cf22d4c60e Fix -A/.all contention via do_meta_command 2016-02-06 19:20:25 -08:00
Teddy Reed
a2754a01ef Valid bool in packs for shard/plaform/version checking 2016-02-06 17:54:56 -08:00
Joe Gallo
66ed804eb6 add fan speeds table 2016-02-05 21:22:07 -05:00
Teddy Reed
45b8b2d56e Merge pull request #1826 from kaizensoze/small-temperature-value-change
small equivalent change to temperature calculation
2016-02-05 18:06:07 -08:00
Teddy Reed
39564149a2 Merge pull request #1825 from kaizensoze/adjust-smc-parse-fpe2-values
[Fix #1822] adjust smc parsing fpe2 values
2016-02-05 16:38:32 -08:00
Teddy Reed
1deee80bf2 Merge pull request #1829 from theopolis/dispatcher_refactor
Refactor dispatcher shutdown logic
2016-02-05 15:17:05 -08:00
Teddy Reed
7f37304c77 Refactor dispatcher shutdown logic 2016-02-05 01:29:42 -08:00
Joe Gallo
6307929163 small equivalent change to temperature calculation 2016-02-05 00:15:33 -05:00
Joe Gallo
503ffb6e54 adjust smc parsing fpe2 values
Lumping parsing of smc fpe2 values in with the else case, which is also
used for parsing sp78 values, seems to have it show correct values that
match those outputted by `./smc -l | grep -i fpe2` via the smc-fuzzer
tool.
2016-02-05 00:08:14 -05:00
Teddy Reed
72dfd258dd Merge pull request #1823 from theopolis/restricted_homedir
Handle restricted home directories
2016-02-04 14:26:15 -08:00
Teddy Reed
b91dc379b3 Handle restricted home directories 2016-02-04 13:43:24 -08:00
Teddy Reed
6b59d7673b Merge pull request #1820 from kaizensoze/remove-some-temp-related-comments
remove some temp-related comments
2016-02-04 12:12:38 -08:00
Joe Gallo
442c28c814 restrict getTemperatures to smc temp keys
Restrict getTemperatures() to smc temperature keys.
2016-02-04 07:18:04 -05:00
Joe Gallo
311dbeed4d remove some temp-related comments
Remove a few unnecessary temperature-related comments.
2016-02-04 07:05:41 -05:00
Teddy Reed
a48109a226 Add developer_id to safari_extensions 2016-02-03 23:46:52 -08:00
Teddy Reed
1e27791cf3 Merge pull request #1812 from theopolis/temp_rename
Rename 'temps' temperatures, add constraints
2016-02-03 23:16:25 -08:00
Teddy Reed
0b263114c1 Merge pull request #1818 from theopolis/inotify_access_limit
[#1814] Do not stat inotify access subscriptions
2016-02-03 22:08:51 -08:00
Teddy Reed
e07570c4e5 Merge pull request #1815 from theopolis/fix_1814
[Fix #1814] Various fixes for Linux inotify
2016-02-03 18:53:56 -08:00
Teddy Reed
77ceca4693 [#1814] Do not stat inotify access subscriptions 2016-02-03 18:13:44 -08:00
Teddy Reed
8947dac232 [Fix #1814] Various fixes for Linux inotify 2016-02-03 17:00:41 -08:00
Teddy Reed
ccda460ba0 Rename 'temps' temperatures, add constraints 2016-02-03 08:49:22 -08:00
Teddy Reed
fe3766796c Use '/rom' path for OS X platform_info 2016-02-03 08:31:57 -08:00
Teddy Reed
08ca034f02 Merge pull request #1808 from kaizensoze/add-temps-table
add temperature sensors table
2016-02-02 21:52:40 -08:00
Joe Gallo
3c6134c1fa add temperature sensors table
Extract temperature-related data from smc_keys table for table dedicated
to temperature sensors.
2016-02-02 23:57:55 -05:00
Teddy Reed
dd64d1df0d Use ROM iokit ID instead of name 2016-02-02 13:27:47 -08:00
Teddy Reed
5394fe62ec Add debug_package for OS X 2016-02-01 16:51:43 -08:00
Teddy Reed
724ca51e16 Lower severity of failed publishers 2016-02-01 16:42:21 -08:00
Teddy Reed
71d6107f83 Document logger_mode flag takes decimal values 2016-02-01 11:10:30 -08:00
Teddy Reed
f05cc345d3 Add an events_max limit for event buffering 2016-02-01 08:38:58 -08:00
Teddy Reed
b138c0be86 Fix constraint index checking on Linux 2016-01-27 11:38:06 -08:00
Teddy Reed
3951cac18f Merge pull request #1797 from sharvilshah/sip_nvram_fix_default_case
SIP config: handle default case when IOKit key is not set
2016-01-26 21:44:48 -08:00
Teddy Reed
e58f96572f Merge pull request #1796 from theopolis/better_constraints
Reduce complexity of SQLite constraints tracking
2016-01-22 15:45:02 -08:00
Sharvil Shah
f0e69204bc IOKit key csr-active-config not found is the default state and not an error 2016-01-22 12:02:35 -08:00
Teddy Reed
d43bc9f06f Reduce complexity of SQLite constraints tracking 2016-01-22 12:00:04 -08:00
Teddy Reed
f1c37f3ea8 Merge pull request #1794 from theopolis/tls_features
Add and document TLS debug features
2016-01-22 09:18:14 -08:00
Teddy Reed
95c4d733cc Add and document TLS debug features 2016-01-22 08:59:07 -08:00
Teddy Reed
7e983dc568 Merge pull request #1780 from sharvilshah/rootless
Report on System Integrity Protection
2016-01-21 23:59:26 -08:00
Sharvil Shah
1f1f0215f1 Create copy of UUID data so that we have a value and not a reference before releasing the properties 2016-01-21 23:20:24 -08:00
Sharvil Shah
8cb7ee71bf Report on System Integrity Protection 2016-01-21 21:28:13 -08:00
Teddy Reed
e6408e21f9 Add max log size for TLS logger of 1M per line 2016-01-21 10:43:15 -08:00
Teddy Reed
87ea41c6ec Improve TLS logger performance 2016-01-21 10:43:15 -08:00
Teddy Reed
7728915651 Merge pull request #1786 from theopolis/add_1778
[#1778] Add hardware/board info for Linux
2016-01-20 19:12:53 -08:00
Teddy Reed
b9117b17a1 [Fix #1788] Use an array for the 'data' key in TLS logs 2016-01-20 11:59:14 -08:00
Teddy Reed
b358d8029e [#1778] Add hardware/board info for Linux 2016-01-20 10:01:49 -08:00
Teddy Reed
9e4b1cc22c Merge pull request #1776 from sharvilshah/filevault_updates
Add currently authenticated FileVault user
2016-01-19 18:11:18 -08:00
Sharvil Shah
819f95ccc6 Add currently authenticated FileVault user (if available) to disk_encryption on Darwin 2016-01-19 15:46:39 -08:00
Teddy Reed
1a12b41d76 Promote 10.11 to default darwin package builder 2016-01-16 15:47:26 -08:00
Teddy Reed
30b1627038 Merge pull request #1771 from theopolis/improve_tls
Improve TLS logging memory
2016-01-15 00:50:56 -08:00
Teddy Reed
d6e91c81e9 Improve TLS logging memory 2016-01-15 00:22:31 -08:00
Teddy Reed
ec119f852f Merge pull request #1766 from sharvilshah/wifi_plist_parsing_fix
[Fix #1760] Fix wifi_networks for OS X 10.9
2016-01-14 00:58:09 -08:00
Sharvil Shah
826643adf8 [Fix #1760] wifi_networks now takes into account slight differences b/w OS X 10.9 and later 2016-01-13 22:52:52 -08:00
Teddy Reed
c117967d07 Restrict verbose warnings to osquery code 2016-01-13 09:26:51 -08:00
Teddy Reed
18528e7750 Merge pull request #1761 from theopolis/fix_benchmarks
Unify build script and fix EVENTS benchmarks
2016-01-12 18:11:24 -08:00
Teddy Reed
832c3cfcce Unify build script and fix EVENTS benchmarks 2016-01-12 17:09:52 -08:00