
Linux users could get this information by viewing the contents of the /etc/passwd file and doing some grep, sed, and awk magic. When I pass all parameters with -startupArgs, the service does work.
INSTALL OSQUERY ON WINDOWS INSTALL
Install the osquery service with the manage-osqueryd.ps1 script. Running osquery as user, admin and SYSTEM. Create the flagfile under SYSTEM account.
INSTALL OSQUERY ON WINDOWS FULL
The query below returns the users that are present on the system and each one's user ID, group ID, home directory, and default shell. Relax the permissions to the point that all files had Everyone with full permissions (I had to add -allowunsafe ). Now that you have all the required information from the table, the schema, and the items to query, run your first SQL query to view the information. | cid | name | type | notnull | dflt_value | pk | To drive home the point, use the following command to see the schema for the RPM packages and compare the information with rpm -qa and rpm -qi operating system commands: (I'll use version 4.7.0 in these examples.)ĬREATE TABLE processes ( `pid ` BIGINT, `name ` TEXT, `path ` TEXT, `cmdline ` TEXT, `state ` TEXT, `cwd ` TEXT, `root ` TEXT, `uid ` BIGINT, `gid ` BIGINT, `euid ` BIGINT, `egid ` BIGINT, `suid ` BIGINT, `sgid ` BIGINT, `on_disk ` INTEGER, `wired_size ` BIGINT, `resident_size ` BIGINT, `total_size ` BIGINT, `user_time ` BIGINT, `system_time ` BIGINT, `disk_bytes_read ` BIGINT, `disk_bytes_written ` BIGINT, `start_time ` BIGINT, `parent ` BIGINT, `pgroup ` BIGINT, `threads ` INTEGER, ` nice ` INTEGER, `is_elevated_token ` INTEGER HIDDEN, `elapsed_time ` BIGINT HIDDEN, `handle_count ` BIGINT HIDDEN, `percent_processor_time ` BIGINT HIDDEN, `upid ` BIGINT HIDDEN, `uppid ` BIGINT HIDDEN, `cpu_type ` INTEGER HIDDEN, `cpu_subtype ` INTEGER HIDDEN, `phys_footprint ` BIGINT HIDDEN, PRIMARY KEY ( `pid ` ) ) WITHOUT ROWID Install the latest version for your operating system by following its installation instructions.

Osquery is available for Linux, macOS, Windows, and FreeBSD. Many applications that handle security, DevOps, compliance, and inventory management (to name a few) depend upon the core functionalities provided by Osquery at their heart. Imagine that you could query the output of the ps and rpm commands as if you were querying an SQL database table with similar names.įortunately, there is a tool that does just that and much more: Osquery is an open source "SQL powered operating system instrumentation, monitoring, and analytics framework."

It would be helpful to view all of this information formatted like the output of a database SQL query.
