Commit Graph

367 Commits

Author SHA1 Message Date
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
Alexander Kindyakov
84b7f4f7a4 Change semantics of 'start_time' colume in processes table (#5414)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5414

Now on different platforms column `start_time` in `processes` table means different things. On Linux it is seconds since system boot, but it works correct only for some platforms, because the number of clock ticks per second was hardcoded. On windows it was abs unix time in seconds since Epoch. On macos it is a time in milliseconds (may be?) since system boot. On freeBSD as far as I can see it an abs time since boot, but also I'm not sure.

In order to make it consistent for all OS we changed to more convenient format - absolute time since Epoch. This commit is about Linux. Next diffs going to be about Darwin and freeBSD.

Reviewed By: guliashvili

Differential Revision: D13918626

fbshipit-source-id: a9cf0570dc6ac9fa125bc8233e9965c4e01566a6
2019-02-05 03:50:20 -08:00
drakearonhalt
e205458be0 Added is_hidden column to the users and groups tables on macOS. (#5368)
Summary:
This PR is the result of the discussion in a previous PR (#5348) after we determined account_policy_data was the wrong place for the column.

Add `is_hidden` column to the users and groups tables in macOS. `is_hidden` is populated by looking for the `dsAttrTypeNative:IsHidden` attribute in the OpenDirectory record for the user/group if the value is `1`, `True`, or `Yes` is_hidden is 1. If the value is anything else it's set to 0. Invalid values have the same affect as the attribute not existing at all.

The `dsAttrTypeNative:IsHidden` attribute controls whether a user account is is visible in the preferences panel similar to having a uid < 500.

One test failed when running buck test:
```
====STANDARD OUT====
tests/integration/tables/helper.cpp:159: Failure
Value of: boost::get<CustomCheckerType>(validator)(value)
  Actual: false
Expected: true
Custom validator of the column "mask" with value "" failed
```
This also fails when I ran the test on the current experimental branch as well.

Important to note I had to remove the optimization on both the user and group tables that just called `getpwnam` if the query specified the `uid` or `gid` since the struct returned doesn't contain the `IsHidden` attribute.  I'm not sure if or how much this will affect performance since I wasn't able to get the profiling to work with the new version (very likely I'm just doing it incorrectly).
Pull Request resolved: https://github.com/facebook/osquery/pull/5368

Differential Revision: D13862375

Pulled By: akindyakov

fbshipit-source-id: 1fec88a6ba71884f7e611e1d96ea00630c5be655
2019-01-30 09:07:56 -08:00
aporlebeke@gmail.com
96e0cd2fd6 Fix typo: "Extensions" (#5388)
Summary:
Fix minor typo in description.  Moved original PR (#5380) from master to experimental
Pull Request resolved: https://github.com/facebook/osquery/pull/5388

Differential Revision: D13781801

Pulled By: guliashvili

fbshipit-source-id: d57d5e45c1597c6d640dbf908a42ced4f4bbf54c
2019-01-23 09:50:49 -08:00
Filipe Manco
a67525fae1 Fix LICENSE information on file headers (#5375)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5375

LICENSE is now defined in a single file on the root of the project, update the
header to contain that information.

**Project LICENSE did not change.**

Reviewed By: akindyakov

Differential Revision: D13750575

fbshipit-source-id: 1e608a81b260b8395f9d008fc67f463160c1fc2b
2019-01-21 11:51:54 -08:00
William Woodruff
bab228b8fa sudoers table: Support file and directory includes (#5350)
Summary:
This adds support for the `#includedir` and `#include` directives to the `sudoers` table, making `sudoers` behave more like the actual `sudo` rule parser:

* When an `includefile` directive is encountered, the referenced file will be parsed using the same rules as the top-level sudoers file.
* When an `includedir` directive is encountered, the referenced directory will be listed and each valid file within (i.e., each file *not* containing a `.` and *not* ending with `~`) will be parsed using the same rules as the top-level sudoers file.
* An additional `source` column tracks the file that provides the row's rule.
* Like `sudoers(5)`, nesting is limited to 128 individual files, with directory inclusions being counted once for each file they contain.
Pull Request resolved: https://github.com/facebook/osquery/pull/5350

Differential Revision: D13717394

Pulled By: akindyakov

fbshipit-source-id: 9659526f21e82c712c495caa80775b15d7e47e37
2019-01-18 05:49:07 -08:00
Julia
039b40288b Fix plist.table description (#5242)
Summary:
The column "path" is a required column.  Fixed description.
Pull Request resolved: https://github.com/facebook/osquery/pull/5242

Reviewed By: guliashvili

Differential Revision: D13693342

Pulled By: fmanco

fbshipit-source-id: ba7bcb88a201cadaf913054900294c3b1d342ead
2019-01-18 03:11:46 -08:00
George Guliashvili
d498bcbd65 unique target names for xcode (#5328)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5328

xcode needs unique target names to properly parse buck generated project

Reviewed By: marekcirkos

Differential Revision: D13487400

fbshipit-source-id: cf0c76145344d0873a0973e226d007597a06d17d
2019-01-16 12:28:04 -08:00
seph
637eb104b8 Spelling (#5256)
Summary:
While running `misspell` on a different codebase. I happened to notice that some misspellings in the osquery code base. So, I fixed them
Pull Request resolved: https://github.com/facebook/osquery/pull/5256

Reviewed By: guliashvili

Differential Revision: D13670897

Pulled By: fmanco

fbshipit-source-id: 5d33d858284955c376e8c3980acdf366d4edf3d3
2019-01-16 08:17:07 -08:00
Filip Hrenić
6d159d4046 Osquery support for atom packages
Summary:
Add support for listing atom packages on Linux and Mac. Shouldn't be a problem adding support for Windows, but have no way to test it right now.
Lists package name, version, description, package path, license and homepage (see test).

Reviewed By: fiorix

Differential Revision: D13636097

fbshipit-source-id: f38a57128cedde2d027a0205588c8b563e2b188c
2019-01-16 03:12:54 -08:00
micheal-o
6fe7b4cbc2 Epoch in rpm_packages table (#5248)
Summary:
code for issue: #5202
Pull Request resolved: https://github.com/facebook/osquery/pull/5248

Differential Revision: D13677333

Pulled By: fmanco

fbshipit-source-id: e245c3733bb73a1d4d6ab61e007c1cf274c29e59
2019-01-15 16:53:35 -08:00
Jonathan Keljo
5bb1ec75a0 Migrate processes to strongly-typed TableRows on macOS
Summary:
Continuing to march toward low-overhead, type-safe table rows, this commit
converts the Darwin `processes` table to using the generated row types.

My march concludes here, but there's a lot of work yet to be done with
migrating other tables.

(Adapted from https://github.com/facebook/osquery/pull/5199)

Reviewed By: guliashvili

Differential Revision: D13438014

fbshipit-source-id: 0e8365f26fe95131fe53ba3491cf07899600e997
2019-01-09 13:50:15 -08:00
Jonathan Keljo
898ed37dfb Table for OSX Running and Active Applications
Summary:
This is a manual port of https://github.com/facebook/osquery/pull/5216 to the new build system.

This table allows you to fetch a list of running applications on OSX. Contains PID, Bundle ID and whether or not the application is in focus. (The latter can be used to figure out what application was being used at a given moment.)

Reviewed By: guliashvili

Differential Revision: D13422150

fbshipit-source-id: 236b28d9140a9a9062fb913815d0c9f1da21c8b5
2018-12-12 09:17:19 -08:00
George Guliashvili
971bee4441 Move build system to BUCK
fbshipit-source-id: 8ffef5e6a393ac67ce56dcb74845402e43d964a0
2018-12-07 16:12:35 +00:00
Michael McGrew
e6302379fd Add per process performance data to windows processes table (#5224) 2018-09-18 20:59:35 -07:00
James Jerger
b8d7243aa9 Add InstallDate to os_version for Windows (#5226) 2018-09-14 16:07:37 -07:00
James Jerger
e10b243ecf Add NTDomain Table for Windows (#5152) 2018-09-14 11:25:49 -07:00
Adrien Schildknecht
bdf504f6b6 tables: netmask should be an integer (#5217) 2018-09-14 16:13:37 +01:00
Alessandro Gario
e2f1a11d75 Add a 'permission' field to the chrome_extensions table (#5193) 2018-09-12 01:03:36 +01:00
Adrien Schildknecht
0b686c4834 Add interface_ipv6 table (#4903) 2018-09-10 05:50:03 +02:00
Allan Liu
5457ef0ea9 tables: add pci_class_id and pci_subclass_id to pci_devices (#5183) 2018-09-06 01:05:11 +01:00
Allan Liu
37ae0ef4d5 tables: augment pci_devices table on linux with pci_subclass (#5175) 2018-09-05 20:20:27 +01:00
Alexander
2b24cf22de
[Table sanity check] sanity check for the table interface_addresses (#5142) 2018-08-31 14:28:26 +01:00
Jibola
e05be701ed Expand "opaque" values in system_controls table (#5082) 2018-08-28 11:52:06 +01:00
Allan Liu
a17d6b5963 SMBIOS oem_strings table (#4849) 2018-08-22 20:02:40 -04:00
Allan Liu
9091fd98a5 pci_devices: model and vendor information from system PCI db && add subsystem info (#4391) 2018-08-16 23:51:38 +01:00
Allan Liu
2081cf8e02 tables: fix cpu_physical_cores and cpu_logical_cores on linux (#4848) 2018-08-14 15:30:38 +01:00
Adrien Schildknecht
ba1bde1d8f Add hopcount entry to the 'routes' table (#4900) 2018-08-14 15:29:50 +01:00
Scott Lundgren
54a9ee8f35 querying of named objects in windows across terminal services sessions. even mutexes. (#4547) 2018-07-27 15:08:51 -07:00
Jared Atkinson
8d9332e6c7 tables: Added a new table for Windows Logon Sessions (#4660) 2018-07-27 11:56:01 -07:00
Julia
8435891f54 Update autoexec.table (#4769) 2018-07-27 16:47:24 +01:00
Mitchell Grenier
ce768dc40c
Add cpu architectures for running processes on macOS (#4702) 2018-07-26 10:32:57 -07:00
Teddy Reed
919219c551
tables: Add ELF-file related virtual tables (#4708) 2018-07-21 12:21:32 -04:00
James Jerger
182212330f Add socket_designation to CPU info (#4715) 2018-07-18 18:46:29 +01:00
Nate Felton
d74fa4033f Adding content_caching to sharing_preferences (#4699) 2018-07-16 12:13:14 +01:00
Rich5
352e3ff7f8 Windows file ops (#4613) 2018-07-15 14:12:46 -07:00
Daniel Roethlisberger
1ed050147a Support CDHash algorithms other than SHA-1 (#4679) 2018-07-13 12:00:43 -07:00
Jeremy Calvert
d6bebc8f81 Add support for getting ethernet link speeds for non-linux posix (#4675) 2018-07-13 10:09:35 -07:00
Allan Liu
8f4529d2a3 General SMART drive information virtual table (#4133) 2018-07-13 09:51:55 -04:00
Max Kareta
140f2bd72f
disk_encryption macOS, fix for issue #4479 (#4687) 2018-07-13 10:59:33 +01:00
Mitchell Grenier
978a3f82bb
Add unique pid field to the processes table on macOS (#4667) 2018-07-11 13:49:50 -07:00
Alessandro Gario
9497df67cc Add a new audit-based table to collect SELinux events (#4224) 2018-07-08 11:22:03 -04:00
uptycs-nishant
1cf5cb7dbc Fixing user_time, system_time bug and changing the cpu utilization logic (#4431) 2018-07-08 11:20:45 -04:00
Alessandro Gario
e622f62d8a macOS signature: Add a hash_resources parameter to the table (#4246) 2018-07-02 19:47:18 +01:00
Vova Mishatkin
29b596dc85 Add ssdeep table for posix (#4629) 2018-06-29 19:50:47 +01:00
Alexander
1179915350
The default timestamp was added for shell_history without timestamp (#4618)
If the shell history file does not contain a timestamps for the lines
osquery will miss the time in rows and will show an confusing error
about attempt to convert empty string to INTEGER.

```
% head -n 3 ~/.zsh_history
ls
cd source
ls
```

```
osquery> select * from shell_history limit 1;
I0621 11:56:37.804193 2629124992 virtual_table.cpp:292] Error casting time () to INTEGER
+------------+------+---------+-------------------------------+
| uid        | time | command | history_file                  |
+------------+------+---------+-------------------------------+
| 1868255265 |      | exit    | /home/akindyakov/.zsh_history |
+------------+------+---------+-------------------------------+
```
So, default value for the time in shell history can solve the problem.
2018-06-25 16:55:49 +01:00
Kyle Creyts
19843b8253 first pass at ssh_config table (#4380) 2018-06-22 19:37:29 -07:00
M Amin
7623f5380f tables: Added NTFS ACL permissions virtual table (#4518) 2018-06-18 16:12:36 -04:00
Filipe Manco
0a08620b65
Move process namespaces to separate table (#4534) 2018-06-13 14:28:16 +01:00
Teddy Reed
e1676c9ef5 Make macOS signatures table architecture aware (#4525) 2018-06-11 14:03:57 -07:00