Commit Graph

5746 Commits

Author SHA1 Message Date
Benjamin Herrenschmidt
dfcd537d82 events/linux: Use unistd.h
We currenty inclulde unistd_64.h which doesn't work on aarch64. Rather
add #ifdef's around it, let's just use unistd.h which should do the
right thing on all architectures.

Additionally remove the duplicate #include's from the .cpp files
2020-09-05 16:50:28 -04:00
Teddy Reed
e9f9fc5611
Remove prototype database implementations (#6622) 2020-09-05 10:53:49 -04:00
Teddy Reed
fc63cb6e31
bug: Set thread names correctly on macOS and Linux (#6627) 2020-09-05 10:53:35 -04:00
Teddy Reed
cb428e105e
Apply scheduler_timeout correctly (#6618) 2020-09-03 23:56:16 -04:00
Stefano Bonicatti
d0b4e327a2
Fix Windows build removing non existing C11 conformance (#6629)
thirdparty_librdkafka_c was failing to compile
due to the C11 keyword _Thread_local not being recognized.
2020-09-03 19:02:00 -04:00
Breakwell
6d57dc8066
Windows 32 bit Support (#6543) 2020-09-01 23:29:26 -04:00
Teddy Reed
bee63a6c06
Add check for character_frequencies size (#6625) 2020-09-01 13:35:33 -04:00
Kelechi Precious Nwachukwu
3060f54392
Improve cpu_type and cpu_subtype descriptions for processes table (#6596) 2020-08-31 22:52:07 -04:00
Teddy Reed
19b91bb2b1
bug: Fix race in removing external TablePlugins (#6623) 2020-08-31 22:49:47 -04:00
Teddy Reed
ef3b5b5af7
bug: Force shell to disable watchdog and logger (#6621) 2020-08-31 22:47:54 -04:00
Teddy Reed
b36678d707
refactor: Rename database APIs to not use DatabasePlugin class (#6620) 2020-08-31 22:45:43 -04:00
Teddy Reed
160ac6c906
refactor: Change the include path for osquery/core/plugins (#6619) 2020-08-29 20:24:39 -04:00
Teddy Reed
0d3bd8d476
database: Change reset interval from 5m to 1hr (#6614) 2020-08-29 20:22:53 -04:00
Eugene Sidorov
c799afbf91
linux: add apparmor_events table (#4982) 2020-08-29 20:22:03 -04:00
kumarak
d86e90c146
Add sigrules to pass YARA signature with query (#6568) 2020-08-29 11:41:57 -04:00
Teddy Reed
066e01c16b
docs: Replace slackin with Slack shared invite (#6617) 2020-08-29 01:57:16 -04:00
Stefano Bonicatti
d3f394026e
Restore PIE support being dropped on Linux (#6611)
CMake ignores the sysroot when testing the support of PIE,
so the link test fails when it tries to check for PIE support
and decides that it's not supported.
Therefore we tell CMake that PIE is supported when using the
osquery-toolchain and leave the automatic test for other toolchains.

Temporarily disable PIE on executables built with the
osquery-toolchain libFuzzer, since it has not been compiled with PIE/PIC
support.
2020-08-28 17:14:37 -04:00
Teddy Reed
37fd74c2f4
bug: Fix buildup of RocksDB SST files (#6606) 2020-08-28 16:19:42 -04:00
Teddy Reed
452c7e66da
shell: Return early if relative flags are used (#6605) 2020-08-28 16:15:31 -04:00
Teddy Reed
05b6c69acf
bug: Apply watcher delay each time the worker is started (#6604) 2020-08-28 16:12:58 -04:00
kumarak
c7e37c2a05
Add non-evented table for querying Windows Events Log (#6563)
The PR adds an on-demand version of the Windows events log table that can return the WEL entries from an arbitrary event provider. It supports selective filtering based on additional query parameters.  An example query:

```
osquery>  select * from windows_events_vtable where channel = 'Application' and eventid = 1000;
+-------------+--------------------------------+------+-------+----------------------------+----------------------------------------+---------+----------+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+------+------+
| channel     | datetime                       | task | level | provider_name              | provider_guid                          | eventid | recordid | keywords           | data                                            | pid  | tid  |
+-------------+--------------------------------+------+-------+----------------------------+----------------------------------------+---------+----------+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+------+------+
| Application | 2020-07-22T03:19:32.617052900Z | 0    | 4     | Microsoft-Windows-LoadPerf | {122EE297-BB47-41AE-B265-1CA8D1886D40} | 1000    | -1       | 0x8000000000000000 | {"UserData":{"EventXML":"","binaryData":"EC2C0000BC2D0000ED2C0000BD2D0000","binaryDataSize":"16","param1":"WmiApRpl","param2":"WmiApRpl"}} | 5824 | 5828 |
+-------------+--------------------------------+------+-------+----------------------------+----------------------------------------+---------+----------+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+------+------+
```
2020-08-26 14:17:29 -07:00
Ateeq Sharfuddin
a19d910d21
bug: Improve chassis_types and security_breach columns within chassis_info (#6608) 2020-08-25 22:25:21 -04:00
James Alseth
b39b1ba709
Remove ExecStartPre from systemd service unit -- do not create empty config file (#6586)
osquery does not need the config file to start. Do not create one if not already present.
2020-08-18 23:42:12 -04:00
kumarak
224423fb75
Set global output function for Thrift (#6592) 2020-08-13 13:53:13 -04:00
seph
c63709894b
Manual copyright changes (#6590) 2020-08-12 11:21:40 -04:00
seph
29f4694df2
Update copyright notices (#6589)
Bulk update copyright notices from Facebook to "The osquery authors"
2020-08-11 16:46:54 -04:00
Teddy Reed
8ee7e3a3b0
refactor: Move osquery/include files to appropriate places (#6557) 2020-08-11 11:54:54 -04:00
Alessandro Gario
6c98ab3ade
powershell_events: Fix bool type usage (#6584) 2020-08-07 23:36:18 -04:00
Ryan Mack
62afdbfdeb
Fix incorrect readFile params in createPidFile (#6578) 2020-08-07 23:34:50 -04:00
Ryan Mack
c1b210cfa5
Fix call to LocalFree() on uninit ptr (#6579) 2020-08-07 23:34:00 -04:00
kumarak
8389f8804e
Move the Windows Events Log parser methods (#6575) 2020-08-06 19:09:47 +02:00
Teddy Reed
c08322b764
ci: Fix pip upgrade warning (#6576) 2020-08-03 10:40:03 -04:00
AE1020
7a148eea0b
CMake detect MAJOR_IN_SYSMACROS/MKDEV for librpm (#6554)
Starting in glibc 2.25, the macros `major` and `minor` were moved
from `<sys/types.h>` to `<sys/sysmacros.h>`, to stop leaking these
common words into the global namespace of those including <stdlib.h>

https://sourceware.org/bugzilla/show_bug.cgi?format=multiple&id=19239

The macros MAJOR_IN_MKDEV and MAJOR_IN_SYSMACROS would be defined if
necessary by autoconfig, and put in `config.h`. But osquery build
uses CMake instead of autotools, with a git-committed `config.h`.
This generally is all right across Ubuntu variations, as an automake
for one will likely make a config.h that works on others. However
the glibc change makes a "one-size-fits-all-Ubuntu" config impossible.

This mirrors detection done by autoconf/headers.m4 as CMake code.
It is a relatively simple patch, which unblocks building of librpm
on (K)ubuntu 20 while still working on Ubuntu 18.
2020-08-02 12:00:33 -04:00
Teddy Reed
ffdd5763a8
events: Memoize EventFactory::getType (#6555) 2020-08-02 11:51:06 -04:00
Ryan Mack
4be11919c1
Fix readFile to observe requested read size (#6569) 2020-08-02 11:26:41 -04:00
Ahsan Athallah
1cf5b5da13
Update check array column descriptions in md_devices (#6572) 2020-07-31 23:27:38 -04:00
Animesh Tewari
dcf72523f7
curl_certificate test (#5281) 2020-07-26 16:38:59 -04:00
Animesh Tewari
6101a0aee5
Fix #5737: Add FileVersionRaw column to file table for windows (#5771) 2020-07-26 16:37:49 -04:00
Jonathan Nogueira
865078a560
Update schedule counter behavior (#6223)
Change the counter behavior so only when a differential results is
calculated the counter increments. With this new behavior the counter
represents the order in which differentials results should be replayed
to recreate state at a point in time.
2020-07-25 17:23:40 -04:00
Ateeq Sharfuddin
f79d7e32ee
Define UNICODE and _UNICODE preprocessors for windows (#6338) 2020-07-23 21:23:23 -04:00
kumarak
2aa313db40
Enable yara table on windows (#6564) 2020-07-23 21:16:10 -04:00
seph
32cafe518c
Light refactor on users & groups (#5686)
This does a little refactoring on the users and groups tables, and adds test cases for more those tables.
2020-07-23 01:38:19 -04:00
nmeocisco
b8e71d949f
Add dns_cache table for Windows (#6505) 2020-07-22 10:51:12 -04:00
Omer Katz
d70417270a
Scheduler code clean up (#4633)
Co-authored-by: Teddy Reed <teddy@casualhacking.io>
2020-07-21 23:02:36 -04:00
prateeknischal
cd11220b7a
Add support for processing KILL syscall (#6435)
Add support for processing KILL, TKILL and TGKILL syscalls. The first
message of the SYSCALL message type is handled in a similar way as
EXECVE as the structure is more or less the same.

Three additional fields are parsed from the message which are "ses"
(session of the process), "comm" (the command that was executed, eg: the
script name in case of a /bin/bash invoke) and "tty" (the controlling
terminal for the process). These fields will not be published though
since the table schema doesn't support it at the moment.

The above feature is activated using the
    --audit_allow_kill_process_events=true

Sample columns:
```
"columns": {
  "atime": "1589007635",
  "auid": "4294967295",
  "btime": "0",
  "cmdline": "",
  "ctime": "1587237608",
  "cwd": "",
  "egid": "1000",
  "euid": "1000",
  "fsgid": "1000",
  "fsuid": "1000",
  "gid": "1000",
  "mode": "0755",
  "mtime": "1586904788",
  "owner_gid": "",
  "owner_uid": "",
  "parent": "4781",
  "path": "/home/USERNAME/code-server-3.1.1-linux-x86_64/node",
  "pid": "4795",
  "sgid": "1000",
  "suid": "1000",
  "syscall": "kill",
  "time": "1589052835",
  "uid": "1000",
  "uptime": "26902"
}
```

Note that the TGKILL syscall is recommended to not be used from the
linux manpages.
2020-07-20 22:02:43 -04:00
Rachel Cipkins
6096347c6b
Add startup_items table for linux (#6502) 2020-07-20 21:52:43 -04:00
kumarak
e915047bc4
Update YARA library to 4.0.2 (#6559) 2020-07-20 21:50:16 -04:00
Teddy Reed
1f5645f7f1
tables: Refactor shell_history to use generators (#6541) 2020-07-13 22:21:39 -04:00
Teddy Reed
3022689572
syslog: Replace fstream with custom non-blocking getline (#6539) 2020-07-13 22:20:37 -04:00
puffyCid
336e6b075f
Shimcache Table (#6463) 2020-07-12 21:54:37 -04:00