Commit Graph

2484 Commits

Author SHA1 Message Date
Teddy Reed
bb65ec49ac [#1488] Shutdown Linux event publishers responsibly 2015-09-22 23:06:23 -07:00
Mike Arpaia
327a9bcdb1 Merge pull request #1522 from marpaia/startup_items
Include system startup items
2015-09-22 16:06:20 -07:00
Mike Arpaia
b09031adda Include system startup items
We were not parsing system startup items.
2015-09-22 15:50:55 -07:00
Teddy Reed
0b006f28c7 Merge pull request #1519 from theopolis/osx_events
[#1488] Stop OS X event publishers with SIGINT
2015-09-22 09:14:47 -07:00
Teddy Reed
97ca0e627a [#1488] Stop OS X event publishers with SIGINT 2015-09-21 22:02:27 -07:00
Mike Arpaia
4021a742df Merge pull request #1507 from jacknagz/os_version_rhel
RHEL os_version fix
2015-09-21 18:03:03 -07:00
Teddy Reed
709479becc Merge pull request #1516 from theopolis/db_nice_errors
Write helpful DB access/open error to verbose log
2015-09-20 11:18:45 -07:00
Teddy Reed
284dac71de Write helpful DB access/open error to verbose log 2015-09-20 10:35:26 -07:00
Teddy Reed
946ab354ff Merge pull request #1517 from theopolis/fix_yara
Fix YARA sigfile caching
2015-09-20 10:34:29 -07:00
Teddy Reed
d042967f43 Fix YARA sigfile caching 2015-09-20 00:06:57 -07:00
Jack Naglieri
9c1e114728 Fix os_version table regex for REDHAT_BASED systems. Updating centos6/7 and freebsd10 Vagrant boxes. 2015-09-18 14:47:08 -07:00
Mike Arpaia
a0795f300b Merge pull request #1512 from theopolis/schedule_tracking
Scheduled query success tracking
2015-09-17 13:39:04 -07:00
Teddy Reed
c51d214ddd Scheduled query success tracking 2015-09-16 23:31:07 -07:00
Mike Arpaia
89789f50a9 Merge pull request #1511 from marpaia/packs-move
Moving packs to top level include directory
2015-09-16 18:16:52 -07:00
Mike Arpaia
73045e4974 Moving packs to top level include directory
I could've swore that I did this already, but this moves
`include/osquery/config/packs.h` to `include/osquery/packs.h`.
2015-09-16 15:51:05 -07:00
Teddy Reed
52daba67b7 Merge pull request #1509 from theopolis/nice_kernel
[#1506] Silent kext loading messages from syslog
2015-09-16 13:44:14 -07:00
Teddy Reed
333f2ce8c8 [#1506] Silent kext loading messages from syslog 2015-09-16 13:13:56 -07:00
Mike Arpaia
3d81223dfb Merge pull request #1508 from marpaia/distributed_test_fixes
Making distributed tests more awesome and less flaky
2015-09-16 12:05:51 -07:00
Mike Arpaia
e8d91189e9 Merge pull request #1510 from marpaia/fix-1504
Only log to warning if the config can't be read by the daemon
2015-09-16 11:16:24 -07:00
Mike Arpaia
dc6e395b77 Only log to warning if the config can't be read by the daemon
fix #1504
2015-09-16 10:54:38 -07:00
Mike Arpaia
41ef6798c6 Making distributed tests more awesome and less flaky
Distributed tests were failing every now and then because the test
plugin didn't implement retry's and the test server wasn't always
starting up fast enough. I fixed this by refactoring the tests to use
the real TLS plugin, which has retry logic. This required some mangling
of the configuration options, which should serve as a good reference as
well.
2015-09-16 10:36:34 -07:00
Teddy Reed
7852c356ec Merge pull request #1494 from theopolis/signals
[#1488] Use signal handlers for teardown and reloading
2015-09-15 16:14:40 -07:00
Teddy Reed
65162e7239 Merge pull request #1501 from sharvilshah/sysinfo_updates
Update system_info table to include CPU type, CPU cores and total memory
2015-09-14 20:02:56 -04:00
Teddy Reed
7c2a625ef2 Use signal handlers for teardown and reloading 2015-09-14 16:57:00 -07:00
Teddy Reed
944e3de206 Merge pull request #1496 from theopolis/events_table
[#1487] Add osquery_events table to track pubsub stats
2015-09-14 15:27:35 -04:00
Mike Arpaia
54ce2f5d66 Merge pull request #1503 from mlw/master
Fix build for Ubuntu Lucid
2015-09-11 15:41:17 -07:00
Sharvil Shah
28143f64f0 Update system_info table: adds CPU type, CPU cores and total memory.
This change adds following columns to `system_info` table:

    cpu_type, cpu_subtype, cpu_brand, cpu_physical_cores,
    cpu_logical_cores, physical_memory, hardware_model

Here's an example output of those columns:

```
              cpu_type = x86_64h
           cpu_subtype = Intel x86-64h Haswell
             cpu_brand = Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
    cpu_physical_cores = 4
     cpu_logical_cores = 8
       physical_memory = 17179869184
        hardware_model = MacBookPro11,3
```
2015-09-10 14:44:48 -07:00
Matthew White
28d456a2f1 Fix build for Ubuntu Lucid 2015-09-10 13:55:59 -04:00
Mike Arpaia
ee125a34eb Merge pull request #1490 from 0xdabbad00/1447-collect_hostname
Added system_info table
2015-09-09 19:00:23 -07:00
Scott Piper
5e7d0d6a37 Added system_info table 2015-09-09 10:26:16 -07:00
Mike Arpaia
9929c61c94 Merge pull request #1500 from marpaia/remote
Client-side implementation of distributed queries
2015-09-08 15:02:32 -07:00
Mike Arpaia
aaa03a1058 Distributed queries client-side 2015-09-08 13:33:48 -07:00
Mike Arpaia
2a20804f59 Merge pull request #1499 from marpaia/flub
Removing remnants of a refactoring from Christmas Past
2015-09-07 17:34:20 -04:00
Mike Arpaia
07283817cb Removing remnants of a refactoring from Christmas Past 2015-09-04 11:33:33 -07:00
Mike Arpaia
041cc6784e Merge pull request #1495 from marpaia/config-md5
Config MD5 a bit more deterministic
2015-09-03 22:24:22 -07:00
Mike Arpaia
de58353131 Config MD5 a bit more deterministic
```
$ ./build/darwin/osquery/osqueryi --config_path=/asdfasdfadfs
E0903 11:45:02.050308 1990836992 init.cpp:370] Error reading config: config file does not exist
Using a virtual database. Need help, type '.help'
osquery> .mode line
osquery> .all osquery_info
           pid = 33700
       version = 1.5.2-43-gb06fa92
    config_md5 =
  config_valid = 0
   config_path = /asdfasdfadfs
    extensions = active
build_platform = darwin
  build_distro = 10.10
osquery> .exit

$ ./build/darwin/osquery/osqueryi
osquery> .mode line
osquery> .all osquery_info
           pid = 33781
       version = 1.5.2-43-gb06fa92
    config_md5 = 8a432ac93d3de080c62d77ba99b89783
  config_valid = 1
   config_path = /var/osquery/osquery.conf
    extensions = active
build_platform = darwin
  build_distro = 10.10
osquery> .exit
```
2015-09-03 22:03:40 -07:00
Teddy Reed
b57040db60 Add osquery_events table to track pubsub stats 2015-09-03 15:10:53 -07:00
Teddy Reed
b06fa92e76 Merge pull request #1463 from theopolis/linux_audit2
Add a Linux audit event publisher
2015-09-03 09:38:15 -07:00
Teddy Reed
2813d3ab87 Add a Linux audit event publisher 2015-09-03 08:45:02 -07:00
Teddy Reed
ba7cef3f78 Merge pull request #1493 from theopolis/fix_1492
[Fix #1492] Fix firefox key counting and spec typo
2015-09-02 23:49:55 -07:00
Teddy Reed
01e040a01c Merge pull request #1491 from theopolis/cleanups3
Static analysis cleanups, static libmagic
2015-09-02 23:49:13 -07:00
Teddy Reed
7a15d25796 [Fix #1492] Fix firefox key counting and spec typo 2015-09-02 19:50:36 -07:00
Teddy Reed
bb2b5f594b Static analysis cleanups, static libmagic 2015-09-02 16:55:20 -07:00
Mike Arpaia
d5db0ccd17 Merge pull request #1485 from marpaia/ptvalue
Removing the ptvalue typedef
2015-09-02 14:53:12 -07:00
Mike Arpaia
fb2f33d770 Removing the ptvalue typedef
Removing the ptvalue typedef in favor of just using `pt::ptree::value_type`
2015-09-02 12:50:24 -07:00
Mike Arpaia
f92fa761f7 Merge pull request #1484 from theopolis/faster_plist
Add plist parsing benchmarks and refactor slightly for perf wins
2015-09-02 12:48:44 -07:00
Mike Arpaia
673e9869c0 Merge pull request #1474 from marpaia/packs-A-F
query pack re-org
2015-09-02 12:44:08 -07:00
Mike Arpaia
a140333441 [fix #1390] query pack re-org
This commit contains the features specified in #1390 as well as a
refactoring of the general osquery configuration code.

The API for the config plugins hasn't changed, although now there's a
`genPack` method that config plugins can implement. If a plugin doesn't
implement `genPack`, then the map<string, string> format cannot be used.
The default config plugin, the filesystem plugin, now implements
`genPack`, so existing query packs code will continue to work as it
always has.

Now many other config plugins can implement custom pack handling for
what makes sense in their context. `genPacks` is not a pure virtual, so
it doesn't have to be implemented in your plugin if you don't want to
use it. Also, more importantly, all config plugins can use the standard
inline pack format if they want to use query packs. Which is awesome.

For more information, refer to #1390, the documentation and the doxygen
comments included with this pull requests, as well as the following
example config which is now supported, regardless of what config plugin
you're using:

```json
{
  "options": {
    "enable_monitor": "true"
  },
  "packs": {
    "core_os_monitoring": {
        "version": "1.4.5",
        "discovery": [
          "select pid from processes where name like '%osqueryd%';"
        ],
        "queries": {
          "kernel_modules": {
              "query": "SELECT name, size FROM kernel_modules;",
              "interval": 600
          },
          "system_controls": {
              "query": "SELECT * FROM system_controls;",
              "interval": 600,
              "snapshot": true,
          },
          "usb_devices": {
              "query": "SELECT * FROM usb_devices;",
              "interval": 600
          }
        }
    },
    "osquery_internal_info": {
        "version": "1.4.5",
        "discovery": [
          "select pid from processes where name like '%osqueryd%';"
        ],
        "queries": {
          "info": {
              "query": "select i.*, p.resident_size, p.user_time, p.system_time, time.minutes as counter from osquery_info i, processes p, time where p.pid = i.pid;",
              "interval": 60,
              "snapshot": true
          },
          "registry": {
              "query": "SELECT * FROM osquery_registry;",
              "interval": 600,
              "snapshot": true
          },
          "schedule": {
              "query": "select name, interval, executions, output_size, wall_time, (user_time/executions) as avg_user_time, (system_time/executions) as avg_system_time, average_memory from osquery_schedule;",
              "interval": 60,
              "snapshot": true
          }
        }
    }
  }
}
```

The `osquery_packs` table was modified to remove the superfluous
columns which could already have been found in `osquery_schedule`. Two
more columns were added in their place, representing stats about pack's
discovery query execution history.

Notably, the internal API for the `osquery::Config` class has changed
rather dramatically as apart of the refactoring. We think this is an
improvement. While strictly adhering to the osquery config plugin
interface will have avoided any compatibility errors, advanced users may
notice compilation errors if they access config data directly. All
internal users of the config have obviously been updated. Yet another
reason to merge your code into mainline; we update it for you when we
refactor!
2015-09-02 10:56:26 -07:00
Teddy Reed
5f56490835 Add plist parsing benchmarks and refactor slightly for perf wins 2015-09-01 18:56:09 -07:00
Teddy Reed
8c75b15b5d Merge pull request #1480 from theopolis/remove_benchmark
Remove benchmark from third-party, prefer deps-build
2015-08-31 23:59:58 -07:00