Commit Graph

5855 Commits

Author SHA1 Message Date
Teddy Reed
89ef888b6a
Fix scheduler to print the correct number of elapsed seconds (#7016) 2021-03-21 12:13:08 -04:00
Teddy Reed
f0edadffac
shell: Add .connect meta command (#6944) 2021-03-20 11:03:27 -04:00
seph
ae03298d2e
Move CI to using docker from osquery (#7012)
This moves the CI to using `osquery/builder18.04`
2021-03-19 16:10:09 -04:00
seph
0aa3775ce8
Update dockerfile to multiplatform (#7011)
This updates the dockerfile use to make the ci builders to use dockerx,
multistage, and multiplatform builds. There is a Makefile as a
convenience for the command.
2021-03-19 11:43:22 -04:00
Mike Myers
6918cbfa77
Add a note for enabling Windows to build osquery (#7010) 2021-03-17 16:18:23 -04:00
Teddy Reed
0c2024da39
Run GH Actions workflows on all tags (#7004) 2021-03-16 22:35:12 -04:00
timothybritton
c4016ec2a4
CI: Setting non-required deb_packages fields as optional in test (#7001) 2021-03-12 23:26:48 -05:00
timothybritton
b5b9b0872d
CI: Disable BPF tests when BPF builds are disabled (#7002) 2021-03-12 23:24:56 -05:00
seph
3b9cb8fb29
Add 4.7.0 CHANGELOG (#6985) 2021-03-12 11:49:01 -05:00
Ryan Mack
06a4721889
ATC fails because journal_mode pragma is blocked by sqlite authorizer (#6999)
Add `journal_mode` to the pragma allow list
2021-03-11 20:33:13 -05:00
Mike Myers
552b2d42f7
Always use BIGINT macro for 'long long' data (#6986) 2021-03-11 16:38:54 -05:00
Alessandro Gario
cf722bc3f3
chrome_extensions: Refactor the table, add tests (#6780) 2021-03-11 16:38:10 -05:00
Sharvil Shah
ae7d34f33a
Remove extraneous lenses directory for augues on macOS (#6998) 2021-03-10 11:10:59 -05:00
Mike Myers
deb290d398
Update the info about macOS CI (#6988) 2021-03-05 10:02:50 -05:00
Mike Myers
c7f10f3921
Make Group ID columns consistent across Windows tables (#6987) 2021-03-04 16:21:14 -08:00
Mike Myers
74d6a3edc0
Fix mem leak regression with Windows' sids API (#6984) 2021-03-03 09:06:20 -08:00
seph
dcef5d54c8
Fix error in process_open_files around stoi vs stoul (#6983) 2021-03-02 21:40:56 -05:00
Teddy Reed
191acd3fbc
Remove hash and yara table from fuzz harnesses (#6972) 2021-03-02 21:40:35 -05:00
seph
d3a216abbc
Augeas Table: Don't autoload system lenses (#6980)
Do not autoload augeas lenses from the system path. Instead, use only the osquery one
2021-03-01 20:52:37 -05:00
seph
2364d42488
Augeas Table: Fix output bug (#6981)
Fix output bug where the augeas table incorrectly calculated path from
node.
2021-03-01 20:51:44 -05:00
seph
02b91b5126
Add concat and concat_ws functions (#6927) 2021-03-01 12:18:18 -05:00
Teddy Reed
c485d44f64
Copy JSON objects to avoid MemoryPool buildup (#6957) 2021-02-27 13:04:57 -05:00
Teddy Reed
2eda1fd039
Fix CODEOWNERS syntax to allow committers and TSC (#6975) 2021-02-27 13:04:00 -05:00
Teddy Reed
38acc6a64c
augeas: Clear aug pointer on error (#6973) 2021-02-27 10:26:58 -05:00
Josh Brower
77361f15f9
Adds support for the computer field in Windows Eventlogs (#6952) 2021-02-26 20:57:31 -05:00
puffyCid
121f7e2589
Add Shellbags table (#6949)
Hello, this largish PR adds shellbags support to osquery.
Shellbags is a complex (imo) windows Registry artifact that primarily keeps track of directories a user has browsed to (specifically directories accessed using Windows Explorer).  By parsing shellbags its possible to recreate what directories a user accessed
Shellbags are composed of shellitems, this PR also adds support to parsing several shellitems, finally shellbags also contain FAT timestamps that show when a directory was created, modified, accessed, FAT timestamp parsing is also included in this PR

Example query of what shellbags looks like
```
osquery> select * from shellbags;
+-----------------------------------------------+--------------+-------------------------------------------------------------------------------------+---------------+--------------+---------------+-----------+--------------+
| sid                                           | source       | path                                                                                | modified_time | created_time | accessed_time | mft_entry | mft_sequence |
+-----------------------------------------------+--------------+-------------------------------------------------------------------------------------+---------------+--------------+---------------+-----------+--------------+
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob                                                                | 0             | 0            | 0             | 0         | 0            |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\Downloads                                                      | 1571635108    | 1571620406   | 1571635108    | 3074      | 5            |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\Projects                                                       | 0             | 0            | 0             | 0         | 0            |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\Projects\osquery                                               | 0             | 0            | 0             | 0         | 0            |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\Projects\osquery\build                                         | 0             | 0            | 0             | 0         | 0            |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\Projects\osquery\build\osquery                                 | 0             | 0            | 0             | 0         | 0            |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\Projects\osquery\build\osquery\RelWithDebInfo                  | 0             | 0            | 0             | 0         | 0            |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\Projects\osquery\osquery                                       | 1578192498    | 1571701478   | 1578192498    | 495902    | 4            |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\Projects\osquery\osquery\killswitch                            | 1578192406    | 1575859554   | 1578192406    | 707032    | 2            |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\Projects\clamav-osquery                                        | 1572045050    | 1572045050   | 1572045050    | 221518    | 14           |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\Projects\clamav-osquery\extension_clamav                       | 1572045050    | 1572045050   | 1572045050    | 432733    | 8            |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\Projects\clamav-osquery\extension_clamav\src                   | 1572045050    | 1572045050   | 1572045050    | 432736    | 11           |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\.osquery                                                       | 1571706262    | 1571706212   | 1571706262    | 575462    | 4            |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\AppData                                                        | 1571623328    | 1571623318   | 1571623328    | 206482    | 7            |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\AppData\Local                                                  | 1571701908    | 1571623318   | 1571701908    | 206502    | 8            |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\AppData\Local\Microsoft                                        | 1593297370    | 1571623318   | 1593297370    | 206504    | 8            |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\AppData\Local\Microsoft\Office                                 | 1593297370    | 1593295160   | 1593297370    | 52684     | 60           |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\AppData\Local\Microsoft\Office\16.0                            | 1593297388    | 1593295160   | 1593297388    | 81742     | 11           |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\AppData\Local\autopsy                                          | 1612935328    | 1612935328   | 1612935328    | 37041     | 7            |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\AppData\Local\autopsy\Cache                                    | 1612935328    | 1612935328   | 1612935328    | 37104     | 8            |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\super secret sensitive stuff                                   | 1613198066    | 1613198066   | 1613198066    | 101729    | 123          |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\super secret sensitive stuff\secret data                       | 1613198092    | 1613198092   | 1613198092    | 383733    | 38           |
| S-1-5-21-1079689790-2336414676-942872339-1001 | usrclass.dat | This PC\C:\Users\bob\super secret sensitive stuff\secret data\dont look secret data | 1613198108    | 1613198108   | 1613198108    | 383736    | 15           |
+-----------------------------------------------+--------------+-------------------------------------------------------------------------------------+---------------+--------------+---------------+-----------+--------------+
```
Due to the complexity of shellbags currently this PR does not support (or only has partial support) for the following shellitems:
* optical disc
* variable (partial support)
* mtp (partial support)
* user property view data (partial support)

I was not able to generate shellbag data (or only some data) for the above shellitems in my windows vms (tested on two different Windows 10 systems, Windows 8.1, and Windows Server 2019), if osquery encounters any unknown shellbag data it will log a warning and mark the shellitem as "[UNKNOWN SHELL FORMAT]" when building directory paths.  
The main value of shellbags is reconstructing directories accessed as shown above, but this PR does include additional shellbag support such as FTP servers connected to via Windows Explorer, ZIP files opened, MTP devices (partial), and network shares browsed to via Windows Explorer
This PR is kind of large, let me know if there are any questions, suggestions for improvements, or issues, thanks!

Shellbags references:
[Shellitems](https://github.com/libyal/libfwsi/blob/main/documentation/Windows%20Shell%20Item%20format.asciidoc)
[Shellbags](https://www.magnetforensics.com/blog/forensic-analysis-of-windows-shellbags/)
[Property Stores](https://github.com/libyal/libfwps/blob/main/documentation/Windows%20Property%20Store%20format.asciidoc)
2021-02-26 15:47:37 -08:00
Eugene Sidorov
b6b17f7629
Implementation of VM metadata table for Yandex.Cloud (#6961) 2021-02-26 15:44:20 -08:00
Zach Wasserman
001aa5622a
Clarify FIM exclude category documentation (#6966) 2021-02-25 15:41:48 -08:00
Ryan Mack
0717ab79b7
Fix pids column in docker_container_stats table (#6965)
Add missing string conversion to docker_container_stats table
2021-02-24 09:13:36 -05:00
Mike Myers
d80bb56534
Update the Linux install steps and package listing (#6956)
Update linux install docs to reflect paths
2021-02-22 22:40:42 -05:00
Mike Myers
070a0960d2
Update the info about osquery's TLS version support (#6963)
Update documentation to align with the change made in PR #6910
2021-02-22 22:40:02 -05:00
Teddy Reed
0fd3b2fa5d
Use a distinct carver request_id (#6959) 2021-02-21 16:43:18 -05:00
Teddy Reed
d69380cb77
Initialize TLSLogForwarder before enrollment check (#6958) 2021-02-21 15:57:04 -05:00
Teddy Reed
1e66c88d33
Do not start scheduler when shutting down (#6960) 2021-02-21 15:56:48 -05:00
Mike Myers
f33d00209e
Improve explanations of event control flags (#6954)
* Improve explanations of event control flags

* Fix a couple of nits

* Try a different code fence formatting

* Try another code fence formatting

* Revert code fence formatting but keep newlines
2021-02-19 09:57:27 -08:00
Teddy Reed
63ff57d01f
Update CODEOWNERS to reflect existing teams (#6955) 2021-02-18 19:24:17 -08:00
Breakwell
4516508f49
Put noisy thrift logs behind a flag (#6951) 2021-02-18 21:21:48 -05:00
seph
552c6bc32f
Remove Azure Pipelines (#6953)
GitHub Actions is at parity with Azure Pipelines. Remove Azure
2021-02-17 16:27:55 -05:00
Stefano Bonicatti
56b56cd26e
Fix an incorrect check in StartupItems test (#6950) 2021-02-15 22:14:06 -05:00
Stefano Bonicatti
358db03eff
Fix StartupItemTest failing due to unexpected values (#6940)
The "path" column for a systemd unit row can be empty.

Added missing possible values for the "status" column,
when the "type" column value is "systemd unit".

Removed "Login Item" as a possible value for the "type" column,
since now "Startup Item" is used.

Removed "disabled" as a possible value for the "status" column,
since it's not returned anymore and due to the type "Startup Item"
being either a script or a .desktop file, which do not have a disabled state;
if they need to be they'll just be removed
and they won't appear in the table anymore.

Separately check for the "status" column possible values
since they differ based on the "type" column value.
2021-02-10 21:03:08 -05:00
Stefano Bonicatti
58a6a8d288
Fix XattrTests failing due to unexpected attribute name (#6941)
The extended attributes present on a test file
might not be only the ones set by the test itself.
If SELinux is installed for instance, an additional extended attribute
is present.
Therefore instead of requiring that the list of attribute names
is exactly the one set by the test, verify that the attribute names
we expect are present in the list.
2021-02-10 21:02:50 -05:00
Stefano Bonicatti
fd742c51ac
Fix ExtendedAttributesTableTests failing due to an unexpected attribute (#6942)
Do not expect that the extended attributes list of a test file
contains only the attributes that have been set by the test.
Check that the extended attributes set by the test are all present
instead.
2021-02-10 21:02:36 -05:00
np5
d138313713
Fix packs discovery queries documentation (#6946)
Packs queries are scheduled only if all the discovery queries return
rows.
2021-02-10 11:10:45 -08:00
Teddy Reed
1699adc387
rpm: Add support for SQLite RPM databases (#6939) 2021-02-06 08:48:04 -05:00
Teddy Reed
fedc90225f
Use librpm bdb_ro backend and remove bdb (#6931) 2021-02-05 12:44:48 -05:00
Alessandro Gario
8b6de9788d
bpf: Change execve/execveat function tracers to kprobes (#6802) 2021-02-05 10:22:38 -05:00
Breakwell
0e1de30ec8
Update the scheduler to log the query name at info level (#6934) 2021-02-04 21:35:44 -05:00
seph
eeda88b2e3
Move try/catch to all partial failure during /proc iteration (#6933) 2021-02-03 21:40:56 -05:00
Teddy Reed
fb48650526
Add patch for apache/thrift#5078 (#6937) 2021-02-03 08:05:54 -05:00
Mike Myers
65f21578f0
Docs: fix reference to a Powershell script on Windows (#6936) 2021-02-02 22:51:24 -08:00