Commit Graph

1783 Commits

Author SHA1 Message Date
Teddy Reed
2b20d3dde0 Merge yara subscribers 2015-04-03 00:48:13 -07:00
Wesley Shields
a9644d22c2 Implement YARA table.
Currently only for OS X, will port to others soon.

Also need to add tests.

Remove old comment and add loading message.

Implement YARA table for Linux.

Use mask properly.

Use the various masks to specify the kinds of events we are interested
in. This removes the need to do the dirty "DELETED" check when the event
fires.

Make getYARAFiles return a const map.

Switch to LOG(WARNING) and emit error number.

Add vim .swp files to .gitignore.

Add yara_utils.(c|h).

Start to condense common code between the Linux and Darwin YARA tables
into a yara_utils.h. Right now it includes a function to compile rules
and store the results back in the map, indexed by category. It also has
the callback used by YARA when a rule is processed. I can not move much
more than that for the row creation code because the structures used in
the event callback are slightly different.

Include a better error message.

The errors are still printed by the compiler callback, but this will
allow my future work to return a Status from the event initialization to
print a useful message in summary.

Make Subscriber init() return Status.

Each EventSubscriber::init() now returns a Status. If the init() fails
for any reason the EventSubscriber is still stored but the failure is
tracked.

EventSubscribers now have a state member, which represents the current
state of the subscriber. The current supported states are:
uninitialized, running, paused, failed. Currently the only meaningful
ones are running and failed, but I put paused in there as a
forward-looking feature.

Subscriptions now have a subscriber_name member. This is used in
EventPublisherPlugin::fire() as a lookup to get the EventSubscriber and
check the state. If the EventSubscriber is not running the event will
not fire.

Only the EventSubscribers on OS X are using this. I'll do the Linux
implementation next.

Chase the init() changes to Linux.

This brings the Linux YARA table in line with the OS X one.

Require a EventSubscriberID when creating a subscription.

Now that Subscriptions are "tied" to EventSubscribers you must create a
Subscription with the name of the Subscriber it is for. This is because
when the event fires the list of Subscriptions is walked and the name is
used to lookup the EventSubscriber and make sure it is in the running
state.

Fix various tests.

Some tests would fire an event with only a Subscription, which is no
longer a valid thing to do. For these tests an EventSubscription is
created and registered in the EventFactory.

When Subscriptions are created pass the name of the EventSubscriber to
them. In some cases where no event is ever fired it is fine to pass a
bogus name.

Fix inotify tests.

Move a test down so the class is defined and make sure to create an
EventSubscriber and use it properly.

Add support for yara to provision.sh.

Right now this grabs yara 3.3.0 and applies the patch to fix min() and max(),
which is commit fc4696c8b725be1ac099d340359c8d550d116041 in the yara repo.

This has been tested under Ubuntu 14.04 only.

Remove NOMINMAX.

This is no longer necessary after the patch was backported to 3.3.0.

Revert "Add support for yara to provision.sh."

This reverts commit a8bd371498c0979f070adeff23d05571882ac3f1.

Use vendored YARA code in third-party.

This switches to using the YARA code contained in third-party, including
the patch to fix min/max macros.

Fix mismerge.

Remove unused function after merge.

Well, soon to be unused as soon as I fix up the Linux YARA table. ;)

Chase config changes.

Make the Linux YARA table use ConfigDataInstance along with files() and
yaraFiles().
2015-04-03 00:47:39 -07:00
Javier Marcos
d19eef1c76 Merge pull request #934 from facebook/provision_break_up
Breaking provision.sh into multiple scripts
2015-04-02 22:07:13 -07:00
Teddy Reed
d8d1ee7072 Move disk_encryption spec to OS X 2015-04-02 21:50:58 -07:00
Javier Marcos
4a1aced53a Breaking provision.sh into multiple scripts 2015-04-02 21:34:55 -07:00
Teddy Reed
dce4b6ca71 Merge pull request #913 from sharvilshah/filevault
[#911] Implement FDE status
2015-04-02 20:28:15 -07:00
Sharvil Shah
7b5ffefa21 add encrypted column to block_devices table and implement is_encrypted on each block device (OS X) by querying IORegistry
properly query IORegistry

remove fde_status implementation from block_devices

scaffolding for disk_encryption table

add disk_encryption table schema

implement disk_enryption table for OS X

clang-format the source

add newline at the end of disk_encryption.table

add device prefix to the bsd_name

provide link to apple's open source

renamed fde_status to disk_encryption, more readable code

preserve alphabetical ordering

tiny formatting fix

change header comment back to original
2015-04-02 17:28:50 -07:00
Mitchell Grenier
c4d32498c1 Merge pull request #930 from jedi22/opera
Adding Opera support by cookie cutting Chrome
2015-04-02 17:11:42 -07:00
Mitchell Grenier
b67ca8598b Adding Opera support by cookie cutting Chrome
Apparently if it ain't broke, don't fix it. Opera support seems to be exactly
the same as Chrome except changing the path. The file is basically just copied
with Chrome replaced with Opera + path change.

Added cross platform functionality to chrome and opera. Plus abstracted it in
more general functions that can be used for other chrome based browsers.
2015-04-02 15:22:54 -07:00
Mitchell Grenier
59d79ee385 Merge pull request #927 from jedi22/xattr_plist
eXtended attribute table optimization
2015-04-02 14:46:48 -07:00
mtmcgrew
da0ce578da correct chkconfig level
3 is not needed twice
2015-04-02 13:53:25 -07:00
Teddy Reed
6dd92bd051 [#915] Skip daemon initialization if checking config 2015-04-02 13:31:51 -07:00
Mitchell Grenier
9a1fdf0cbe eXtended attribute table optimization attack surface minification
The extended attributes table used to have its own parsing algorithm
and functions. These are unnecessary because osquery has built in PLIST parsing
provided by the operating system. Thus, I've moved the code to using that and
removed the xattr tests because they only tested the now non-existant parsing.

Further, the files have been renamed so they should now play nice with the
included profiler.
2015-04-02 13:27:12 -07:00
Mitchell Grenier
1a7dce6453 Merge pull request #917 from jedi22/firefox_plugins
Adding the ability to get addons in Ubuntu
2015-04-02 10:45:08 -07:00
Javier Marcos
796259a36e Merge pull request #925 from maus-/patch-2
Cleaned up Vagrantfile
2015-04-01 13:59:20 -07:00
maus-
e9631bd823 Update Vagrantfile
Forgive me as I've forgotten how to read
2015-04-01 13:22:22 -07:00
maus-
fc950e702b Update Vagrantfile 2015-04-01 12:25:10 -07:00
maus-
6c3ef967b5 Cleaned up Vagrantfile
Forgot a line, my bad!
2015-04-01 12:22:40 -07:00
Mitchell Grenier
560bfcdc02 Adding the ability to get addons in Ubuntu
I added a couple preprocessor macros so the table can be used under all linux distros
 as well
2015-04-01 10:41:56 -07:00
Teddy Reed
b1640a9c0c Merge pull request #906 from eastebry/902_clean_option
Added clean options, general osqueryctl cleanups
2015-03-31 22:17:38 -07:00
Bryan Eastes
afe76d4f6e Added clean options, general osqueryctl cleanups 2015-03-31 21:50:28 -07:00
Teddy Reed
8482b618e3 Merge pull request #918 from maus-/patch-1
Cleaned up Vagrantfile
2015-03-31 20:31:35 -07:00
maus-
016fe5a0d5 Cleaned up Vagrantfile 2015-03-31 19:53:29 -07:00
Mitchell Grenier
4c1d25bc12 Merge pull request #921 from jedi22/keychain_seg_fix
[Fix #919] Fixing segfault for non-existent path in keychain_items
2015-03-31 18:42:06 -07:00
Mitchell Grenier
57afea9449 Quick segfault fix 2015-03-31 18:20:27 -07:00
maus-
d033190cbf Cleaned up Vagrantfile 2015-03-31 16:57:25 -07:00
Teddy Reed
800dc7745e [#907] Bump tp to prefer non-execl logs 2015-03-30 15:36:56 -07:00
Teddy Reed
433931094a Merge pull request #914 from theopolis/date_logs
[Fix #907] Use glog to log to data-identified files
2015-03-30 14:07:06 -07:00
Teddy Reed
53782c1c7c [Fix #907] Use glog to log to data-identified files 2015-03-30 12:49:57 -07:00
Teddy Reed
448215aa41 Merge pull request #899 from theopolis/pkg_tables
[#890] Add package_receipts/package_bom OS X tables
2015-03-30 10:38:07 -07:00
Teddy Reed
2a29651b2e Merge pull request #912 from theopolis/external_registry
Declare extension registries 'external'
2015-03-30 09:54:35 -07:00
Teddy Reed
fc623d98d5 Declare extension registries 'external' 2015-03-30 02:03:26 -07:00
Teddy Reed
52a3dd5f86 Remove '_' in ubuntu package revision 2015-03-29 12:28:10 -06:00
Teddy Reed
692c1b1751 Add package_receipts/package_bom OS X tables 2015-03-27 23:12:09 -07:00
Teddy Reed
d9d068bb5d Merge pull request #910 from theopolis/centos_pkgs
Remove snappy/libproc from CentOS deps
2015-03-27 20:04:45 -07:00
Teddy Reed
c37474775c Remove snappy/libproc from CentOS deps 2015-03-27 19:19:55 -07:00
Teddy Reed
76e769d95e Merge pull request #908 from theopolis/linux_process_opt
Remove libprocps(ng) in favor of parsing proc manually
2015-03-27 12:51:25 -07:00
Teddy Reed
020cf83046 Merge pull request #905 from theopolis/config_update_extension
Add 'update' action to ConfigPlugin call
2015-03-27 12:38:41 -07:00
Teddy Reed
38bfed3414 Remove libprocps(ng) in favor of parsing proc manually 2015-03-27 12:37:16 -07:00
Mike Arpaia
80a4a16ba0 Merge pull request #904 from theopolis/manage_exts
Prevent extensions autoload when extensions are disabled
2015-03-27 10:58:54 -07:00
Teddy Reed
4fc274201c Add 'update' action to ConfigPlugin call
ConfigPlugin items can use action='update' along with a single
source, data to add to the config structure. If multiple external
sources update at the same time, multiple 'update' actions are needed.
2015-03-24 20:59:33 -07:00
Teddy Reed
ec3854ced0 Prevent extensions autoload when extensions are disabled 2015-03-24 17:44:49 -07:00
Teddy Reed
2ba009de2d Merge pull request #889 from theopolis/config_update
Support specific config source async updating
2015-03-24 16:55:12 -07:00
Teddy Reed
7fbc7140ca Merge pull request #901 from theopolis/better_events
Reduce restart times for event runloops
2015-03-24 16:42:44 -07:00
Teddy Reed
14a09cc6f2 Change schedule to a map, splay on config update 2015-03-24 16:28:49 -07:00
Teddy Reed
a97d557e5a Add shared lock RAII helper around config access 2015-03-24 16:27:35 -07:00
Teddy Reed
5b227c8e3d Scheduler organization for async config updates 2015-03-24 16:27:35 -07:00
Teddy Reed
2c4d9a8c88 Support specific config source async updating 2015-03-24 16:27:35 -07:00
Teddy Reed
eee5b7d462 Reduce restart times for event runloops 2015-03-24 16:27:07 -07:00
Teddy Reed
77022f9d52 Merge pull request #900 from dreid/patch-1
Correct typo: hose -> host.
2015-03-24 13:46:26 -07:00