Commit Graph

416 Commits

Author SHA1 Message Date
Jason Meller
309ca4a510
Add new macOS virtual table screenlock (#6243) 2020-03-15 21:03:16 -04:00
scoders-tob
4e5dcd9832
Adding LXD tables (#6249)
Co-authored-by: Stefano Bonicatti <stefano.bonicatti@gmail.com>
2020-03-15 21:02:18 -04:00
Jason Meller
a7655d3e37
Add new virtual table windows_security_center (#6256) 2020-02-28 10:51:55 -05:00
scoders-tob
3eae135bc1
Adding docker_container_fs_changes table (#6178)
* adding docker pip package to dockerfile

* adding docker fs changes table

Co-authored-by: scoders <sahil@cs.toronto.edu>
2020-02-24 01:00:38 +01:00
Rachel Cipkins
3de799ef07
Support for "matches" and "js" keys from "content_scripts" in the chrome_extensions table (#6140)
Co-authored-by: William Woodruff <william@yossarian.net>
2020-02-21 18:13:41 -05:00
Drake Aronhalt
da4bfd4762
mdls table implementation (#4825)
Created mdls table which mimics the functionality of the mdls command in macOS. Table allows osquery to retrieve key/value pairs from spotlight metadata.
2020-02-11 09:15:00 -08:00
puffyCid
c722c68478
Expand SSH tables to support Windows (#6161) 2020-02-05 15:13:55 -05:00
Fritz
713c93fa29
Add Windows support to firefox_addons table (#6200) 2020-02-05 15:11:08 -05:00
Zachary Wasserman
d7ac675d27
Update build files to include windows_optional_features table (#6207)
The table was added without the proper updates to the build files, so it is not built into the binary.
2020-01-31 09:36:39 -05:00
Zachary Wasserman
0de84e0937
Fix description for prometheus_metrics table (#6217) 2020-01-30 18:11:48 -05:00
Alessandro Gario
abc6695c96
apparmor_profiles: New table that presents active AppArmor profiles (#6138) 2020-01-29 01:13:08 +01:00
Alessandro Gario
8d9059f914
selinux_settings: New table that presents effective SELinux settings (#6118)
* selinux_settings: New table that presents effective SELinux settings

* selinux_settings: Use the SELinux root path from the mounted fs

The code that was originally directly implemented inside the
`mounts` table has been moved outside so that it can be reused
by the selinux_settings table.

This also updates the code to use getmntent_r instead of getmntent.
2020-01-27 15:03:52 +01:00
Brad Thompson
0b2aa61a7d Create HVCI table for Windows Device Guard (#5426) 2020-01-23 20:57:03 -08:00
scoders-tob
b150367967 Adding process_open_pipes table (#6142) 2020-01-16 20:55:48 -05:00
scoders-tob
6c9f8e30b0 adding docker image layers table (#6154) 2020-01-12 01:43:28 -05:00
William Woodruff
c18f5bc75c windows/bitlocker_info: Fetch WMI method results (#6155)
Retrieves version, in-progress encryption status, and the lock
status for each BitLocker-encrypted volume via WMI methods.
2020-01-06 18:19:26 +01:00
obfuscatedbytes
ab42b1a210 Update plist.table description (#6127)
Fixed typo
2020-01-02 11:48:46 +01:00
William Woodruff
e79e76eb8e (Windows) New table: ntfs_journal_events (#5371)
Co-authored-by: Garret Reece <GarretReece@users.noreply.github.com>
Co-authored-by: Alessandro Gario <5714290+alessandrogario@users.noreply.github.com>
2019-12-31 19:22:44 -05:00
Rachel Cipkins
b5bddbef87 Add optional_permissions column to chrome_extensions table (#6115) 2019-12-22 22:21:55 -05:00
Teddy Reed
a1f15a4bbd tables: Match column attributes to usage (#6122) 2019-12-15 13:26:34 -08:00
seph
a73ffad3bf tables: Add constraints and testing (#6105)
Co-Authored-By: Teddy Reed <teddy@casualhacking.io>
2019-12-12 20:45:15 -05:00
Alessandro Gario
ec2593e143 rpm_packages: Add the install_time column 2019-12-10 22:41:45 +01:00
Stefano Bonicatti
e7cef1a906 Prepare CMake and Python framework for Python tests
test_base.py received several fixes and now supports and requires
a custom folder where to find the config files that the tests need.
It has been also updated to use Python 3.

Fixed the gen_api function in genapi.py missing the path to the spec
file when evaluating blacklisted tables.

Co-Authored-By: SS <sahil.suneja@trailofbits.com>
2019-12-07 20:51:09 -05:00
Teddy Reed
6cf169c6d8
tables: Fix mdfind table by requiring query (#6103) 2019-12-06 10:11:51 -05:00
Garret Reece
5c3a4636ec macOS: Add a bsd_flags column to the file table (#5981) 2019-12-03 18:40:42 -08:00
mark m
706874c3d3 Implement azure metadata and tags tables (#5434) 2019-11-26 21:12:27 -05:00
Teddy Reed
19d4e3fc78
docs: Remove references to old osquery kernel extension (#6051) 2019-11-19 00:23:47 -05:00
packetzero
0f9b15b05b new windows_optional_features table (#5991) 2019-11-18 20:48:11 -08:00
Teddy Reed
07afc4e2a7 tables: Change atom_packages to use user constraints (#6052) 2019-11-18 20:40:45 -08:00
Teddy Reed
3e437d555d tables: Improve nvram to use input variable names (#6053) 2019-11-18 20:39:37 -08:00
Chris Broome
4cbb4ad6c8 process_open_sockets/windows: add state column (#5927) 2019-11-01 01:17:24 +01:00
packetzero
f0d00b44b2 Advert index not implemented (#5938) 2019-10-28 20:27:06 -04:00
seph
3e1dd14d8d Add platform_mask (#5898)
Right now, there is no way to tell what platform osquery is running on. We have `os_version.platform` and `os_version.platform_like`, but they are highly inconsistent, and require a lot of custom parsing to use. We should expose the underlying platform bitmask.

This adds the `platform_mask` to the `osquery_info` table.

This replaces https://github.com/osquery/osquery/pull/5488
2019-10-23 12:24:26 -04:00
William Woodruff
1ca47d3e7a (Windows) New table: default_environment (#5441) 2019-10-16 14:20:52 -04:00
William Woodruff
a9b23807b2 darwin/firewall: Fixes for alf_exceptions, make alf_services an alias for sharing_preferences (#5378) 2019-10-04 15:42:10 -04:00
William Woodruff
06dd05cd33 (Windows) New table: connectivity (#5500) 2019-10-04 15:18:15 -04:00
Zachary Wasserman
2a6ddd62ea Implementation of windows_security_products table (#5479)
Provides information about the security products registered on a Windows
system.
2019-09-23 17:44:31 -04:00
Alessandro Gario
444b2cc017
Audit: Implement support for fork/vfork/clone/execveat (#5701)
* Audit: Implement support for fork/vfork/clone/execveat

Also implement a test target for the process_events table
2019-08-23 16:09:00 +02:00
Sharvil Shah
d9fdc5b8fd tables: implement ibridge table to report on T1/T2 chip for mac notebooks (#5707) 2019-08-19 17:41:24 -04:00
Alex
f98403fcfc fixing the mixed line-endings causing PyAST error (#5645) 2019-07-18 20:10:30 -07:00
Mark Mossberg
a60b940290 windows/certificates: Fix enumeration bugs, add columns (#5631)
* Initial implementation

* Use case insensitive comparisons for all service names

Fixes a bug where certificates for services that correspond to Local Service or
Network Service may not have their sids appear correctly. This is because the
services table is inconsistent with its user_account column.

* Make service name cache query-local

Previously, the service name cache existed for the lifetime of the
osquery process, which made it susceptible to stale reads if a service
restarted under a different user during osquery's lifetime. Now the
cache is created for each query. Also refactor it to directly map to the
sid, rather than the account name, which removes the need to translate
from account name to sid every row.

* Fix reference to destroyed object

Previously, getCurrentUserInfo took a reference to data from a local
vector, whose data is free'd after the function. This refactors the code
to use a unique_ptr (similar to how getSidFromUsername) does it.
2019-07-16 17:34:39 +02:00
Stefano Bonicatti
942878854b Add CMake support
Taken from osql-experimental.

- Change CMake code license to the one present in osquery right now

- Package metadata doesn't mention Trail of Bits or osql anymore

- Set specific ACLs for the osqueryd on Windows when packaging

- Remove LLVM_INSTALL_PATH support on macOS, since we are using AppleClang

- Remove OSQUERY_SOURCE_DIR variable need and source in a submodule support

- Add targets format_check and format to check code formatting and
  format it with clang-format

- Do not warn about not using Clang on macOS when using AppleClang
2019-06-26 21:49:06 -04:00
Alessandro Gario
33fbbecb5f Initial commit
Taken from osql-experimental.

Initial support for Linux and macOS.
2019-06-26 21:49:06 -04:00
Alessandro Gario
507638dda0 chrome_extensions: Add the profile name to the table (#5213)
Summary:
This PR adds a new column to the `chrome_extensions` table named `profile`, used to show the name of the Chrome profile that owns each extension.

```
osqueryi --verbose 'SELECT profile, name, version FROM chrome_extensions;'
```
```
+---------------+---------------------+--------------+
| profile       | name                | version      |
+---------------+---------------------+--------------+
| trail_of_bits | Slides              | 0.10         |
| trail_of_bits | Docs                | 0.10         |
| trail_of_bits | Google Drive        | 14.1         |
| trail_of_bits | YouTube             | 4.2.8        |
| trail_of_bits | Sheets              | 1.2          |
| trail_of_bits | HTTPS Everywhere    | 2018.8.22    |
| trail_of_bits | Google Docs Offline | 1.7          |
| trail_of_bits | __MSG_APP_NAME__    | 1.0.0.4      |
| trail_of_bits | Gmail               | 8.1          |
| trail_of_bits | Chrome Media Router | 6818.528.0.0 |
| Person 1      | Slides              | 0.10         |
| Person 1      | Docs                | 0.10         |
| Person 1      | Google Drive        | 14.1         |
| Person 1      | YouTube             | 4.2.8        |
| Person 1      | Sheets              | 1.2          |
| Person 1      | Google Docs Offline | 1.7          |
| Person 1      | __MSG_APP_NAME__    | 1.0.0.4      |
| Person 1      | Gmail               | 8.1          |
| Person 1      | Chrome Media Router | 6818.528.0.0 |
+---------------+---------------------+--------------+
```
Pull Request resolved: https://github.com/facebook/osquery/pull/5213

Reviewed By: mkareta

Differential Revision: D14224080

Pulled By: guliashvili

fbshipit-source-id: 8f831163ccf38c7ba6c8d17aeb8c90c43031529f
2019-03-27 03:02:16 -07:00
Filipe Manco
353d7613d7 Add missing tables to windows build. (#5497)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5497

Some tables were forgotten during the port to Buck.

Checking missing tables:

```
diff <(find oss/specs -iname "*.table" -exec basename {} \; | sort) <(grep -e "[a-z0-9_]\+\.table\"," oss/specs/BUCK | sed -e 's: *"\([a-z]*/\)*\(.*\)",:\2:' | sort)
```

Reviewed By: guliashvili

Differential Revision: D14300038

fbshipit-source-id: 70939d8540f141e256259eb0f722f3994af7e6f0
2019-03-05 08:53:57 -08:00
William Woodruff
fe70a514af windows/logged_in_users: Add sid, hive columns (#5454)
Summary:
This introduces two new (Windows-only) columns to the `logged_in_users` table:

* `sid` corresponds to the logged in user's security identifier, used to uniquely identify the user and their permissions on the local system.
* `registry_hive` corresponds to the user's HKU registry hive, used to look up per-user configuration information.

I've updated the integration tests to test for these columns on Windows only. Please let me know if there's anything else I can do!
Pull Request resolved: https://github.com/facebook/osquery/pull/5454

Differential Revision: D14195466

Pulled By: fmanco

fbshipit-source-id: def9c362fac1b5a68b68f826916daafee224295b
2019-02-27 05:52:56 -08:00
William Woodruff
139aaef0ed windows/logical_drives: Refactor (#5400)
Summary:
This generally refactors the `logical_drives` table on Windows to conform more closely to C++11 idioms. It also enables the integration test for `logical_drives`.

See #5367. I'll open a PR for the boot partition fixes once this is merged.

cc akindyakov guliashvili
Pull Request resolved: https://github.com/facebook/osquery/pull/5400

Differential Revision: D14131722

Pulled By: fmanco

fbshipit-source-id: c3077da48147a9880ce08925d165e5d1da363bb9
2019-02-26 16:03:20 -08:00
Mark Mossberg
5edb4c5b81 Add Windows product version information to file table (#5431)
Summary:
Hi! This PR adds a new column called `product_version` to the file table, which is only
populated when queries are done on Windows. It is a very minimal PR that uses an existing helper function (`windowsGetFileVersion`) to populate the column.

The column is not named `file_version`, despite the name of the helper function because the underlying data retrieved by that helper function is actually the `dwProductVersion*` fields of the `VS_FIXEDFILEINFO` struct. In the future, if we want to add a column that _actually_ contains the results of the `dwFileVersion*` fields, we can add a new column called `file_version` without modifying existing functionality.
Pull Request resolved: https://github.com/facebook/osquery/pull/5431

Differential Revision: D14169773

Pulled By: fmanco

fbshipit-source-id: 6fa7c92425fc92aa2e83a37383b1a8c796b17644
2019-02-21 13:45:46 -08:00
Alexandru Stefanica
1621213813 fix magic table (#5438)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5438

currently the magic table is broken. libmagic which is used to generate this information needs a database/configuration file that it usually auto-finds.
Our libmagic library tries to open the following file ```open("/usr/local/osquery/Cellar/libmagic/5.32_200/share/misc/magic.mgc", O_RDONLY) = -1 ENOENT (No such file or directory)``` (you can generate  this by using strace like ```trace -q -e trace=open ./buck-out/debug/gen/xplat/osquery/oss/osquery/osqueryd#gcc-5-glibc-2.23-clang -verbose -S "select * from magic where path = '/etc/passwd'"```).
How it auto-finds it I don't know 100%, but I guess it has something to with how the libmagic.so is actually build and installed. Basically this never works unless you are a developer on mac and used our previous build system.

I've updated the table to be able to specify the path to magic database file. If you don't specify it, I tried to check if one of the default files (files that should be present under /usr/share/ exists and use the first found). If all fail, I try the default one, but that most likely will fail.

Reviewed By: guliashvili

Differential Revision: D14066467

fbshipit-source-id: d9d2aca4829b2275e6792f974de1f2a7808dc321
2019-02-13 13:58:52 -08:00
Max Kareta
e79d0ae5ce add feature that allow to mark tables foreign at build time
Summary:
Not every environment requires all tables, this diff introduce flag that allows you mark table as foreign. New option should be used in conjunction with target filer.

Example:
> buck build ... --config osquery.target_ignore_list="smart" --config osquery.spec_ignore_list="smart/smart_drive_info.table" -- -S

Reviewed By: fmanco

Differential Revision: D13942107

fbshipit-source-id: fb34d6b7a296f69f6b95bf17bfd19cee31b34dec
2019-02-05 04:03:50 -08:00