Commit Graph

513 Commits

Author SHA1 Message Date
Teddy Reed
e1f0106710 Various fixes, checks 2015-04-11 15:57:12 -07:00
Teddy Reed
a8ced9a647 Merge pull request #977 from theopolis/process_parsing
[Fix #968] Refactor launchd
2015-04-11 14:18:58 -07:00
Teddy Reed
54af369702 [Fix #968] Refactor launchd 2015-04-10 18:04:26 -07:00
Mitchell Grenier
41283223af Better extended attributes
For the second time in a couple of weeks, I've rewritten the xattr table into
a new extended_attributes table.

If we find an attribute that we don't have a parser for, we will check if it
contains non printable characters. If it does, we'll base64 it. If it doesn't,
we will just output the unencoded string.
2015-04-10 13:17:22 -07:00
Teddy Reed
36479bbaf6 Merge pull request #970 from theopolis/osx_managed_configuration
[Implement #879] Add managed_policies to OS X
2015-04-09 12:14:50 -07:00
Teddy Reed
dc7cf9cf59 [Implement #879] Add managed_policies to OS X 2015-04-08 21:38:56 -07:00
Teddy Reed
8b2dd5e328 [Fix #962] Add OS name and friendly version 2015-04-08 07:33:17 -07:00
Javier Marcos
dee0bd683e Renaming safari_plugins table to browser_plugins 2015-04-07 14:26:00 -07:00
Sharvil Shah
e7a3d24ece Fix etc_hosts hostname parsing so that inline comments are now ignored; update tests 2015-04-06 23:32:56 -07:00
Teddy Reed
090f7e71f1 Fix event subscriber time 2015-04-04 13:28:45 -07:00
Wesley Shields
4fea1bba7c Fix broken YARA table.
After the merge you need to include yara.h after fsevents.h on OS X.

Apaprently DECLARE_SUBSCRIBER() was dropped during the merge, which
meant that attempts to find the subscriber would fail, throwing an
unhandled exception.

Fix the table spec to use the new table name.

Must use recursive on Linux.

In order to watch a directory you must set recursive to true in
SubscriptionContext under Linux.
2015-04-03 00:48:13 -07:00
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
Teddy Reed
d8d1ee7072 Move disk_encryption spec to OS X 2015-04-02 21:50:58 -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
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
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
Mitchell Grenier
57afea9449 Quick segfault fix 2015-03-31 18:20:27 -07:00
Teddy Reed
692c1b1751 Add package_receipts/package_bom OS X tables 2015-03-27 23:12:09 -07:00
Teddy Reed
38bfed3414 Remove libprocps(ng) in favor of parsing proc manually 2015-03-27 12:37:16 -07:00
Teddy Reed
a97d557e5a Add shared lock RAII helper around config access 2015-03-24 16:27:35 -07:00
David Reid
580fb6739e Correct typo: hose -> host. 2015-03-24 13:31:25 -07:00
Teddy Reed
6d0e64d548 Adding ad_config table to OS X 2015-03-23 10:10:01 -07:00
Teddy Reed
f25e151d9e [Fix #895] Prevent subkey stacking in preferences 2015-03-22 18:45:25 -07:00
Teddy Reed
709723efda Merge pull request #880 from theopolis/shell_db
Remove unused shell functions
2015-03-19 21:33:37 -07:00
Teddy Reed
c58599057b [Fix #885] Use list directories for homebrew 2015-03-19 16:31:11 -07:00
Teddy Reed
79ddc5ba38 Remove unused shell functions 2015-03-19 16:14:29 -07:00
Teddy Reed
91dce32095 Speed up shell and add max value size 2015-03-18 15:07:13 -07:00
Teddy Reed
09790478b3 Nit, prefer boolean columns to not use 'is_' 2015-03-17 15:21:37 -07:00
Teddy Reed
3da2e09a5c [Fix #869] Rename safari_plugins is_native 2015-03-17 11:28:37 -07:00
Teddy Reed
4440b2f791 Renamed osx_version to os_version, include Linux versions 2015-03-15 16:07:49 -07:00
Teddy Reed
660c6ec53f Merge pull request #839 from theopolis/addons_vtable
[#787] Add chrome, firefox, and safari related tables
2015-03-13 11:01:25 -07:00
Teddy Reed
e281e6a214 [#787] Add chrome, firefox, and safari related tables 2015-03-13 10:48:14 -07:00
Teddy Reed
33cbdd42ba Merge pull request #834 from theopolis/keychain_items
Add keychain_items to include basic item details
2015-03-10 16:06:17 -07:00
Teddy Reed
6a81cec937 Organize kernel_extensions to add signatures 2015-03-09 11:43:06 -07:00
Teddy Reed
995a16d83f Add keychain_items to include basic item details 2015-03-08 01:59:59 -08:00
Teddy Reed
4916392aa8 Merge pull request #812 from theopolis/keychain
Add more keychain search paths for certificates
2015-03-07 23:27:50 -08:00
Don Husa
f6b5c5a2e3 Cleaned Up Time Table 2015-03-05 16:57:44 -08:00
Teddy Reed
0673900837 Registry modules 2015-03-04 20:33:10 -08:00
Teddy Reed
99beceaef6 Switch lazy=active concept for registry setup 2015-03-04 18:51:41 -08:00
Mitchell Grenier
d5e8fe61d2 Removed the checks 2015-03-04 11:27:11 -08:00
Mitchell Grenier
3d27fff697 Merge pull request #784 from jedi22/directory_monitoring
Adding ability to monitor whole folders
2015-03-02 17:21:24 -08:00
Mitchell Grenier
f50593f030 Less capitals 2015-03-02 17:01:05 -08:00
Mitchell Grenier
fc09924a59 clang format 2015-03-02 16:48:01 -08:00
Teddy Reed
a6bc9d6d97 Merge pull request #804 from theopolis/network_settings
Add sysctl (system_controls) table
2015-03-02 16:01:39 -08:00
Teddy Reed
e123f9f0a2 Add more keychain search paths for certificates 2015-03-01 21:15:42 -08:00