2014-07-31 00:35:19 +00:00
osquery
=======
2014-11-21 01:26:11 +00:00
Platform | Build status
---------|-------------
2014-11-24 16:56:28 +00:00
OS X 10.10 | [![Build Status ](http://jenkins.osquery.io/job/osqueryMasterBuildOSX/badge/icon )](http://jenkins.osquery.io/job/osqueryMasterBuildOSX/)
2014-11-24 16:56:56 +00:00
CentOS 6.6 | [![Build Status ](http://jenkins.osquery.io/job/osqueryMasterBuildCentOS/badge/icon )](http://jenkins.osquery.io/job/osqueryMasterBuildCentOS/)
2014-11-24 16:56:28 +00:00
Ubuntu 12.04 LTS | [![Build Status ](http://jenkins.osquery.io/job/osqueryMasterBuildUbuntu12/badge/icon )](http://jenkins.osquery.io/job/osqueryMasterBuildUbuntu12/)
Ubuntu 14.04 LTS | [![Build Status ](http://jenkins.osquery.io/job/osqueryMasterBuildUbuntu14/badge/icon )](http://jenkins.osquery.io/job/osqueryMasterBuildUbuntu14/)
2014-11-20 23:02:27 +00:00
2014-08-12 00:51:30 +00:00
2014-10-29 00:35:57 +00:00
osquery is an operating system instrumentation framework for OSX and Linux. osquery makes low-level operating system analytics and monitoring both performant and intuitive.
2014-09-03 08:42:15 +00:00
osquery exposes an operating system as a high-performance relational database. This allows you to write SQL-based queries to explore operating system data. With osquery, SQL tables represent abstract concepts such as
- running processes
- loaded kernel modules
- open network connections
2014-10-29 00:36:22 +00:00
SQL tables are implemented via an easily extendable API. A variety of tables already exist and more are being written.
To best understand the expressiveness that is afforded to you by osquery, consider the following SQL queries:
2014-09-03 08:42:15 +00:00
```sql
--------------------------------------------------------
2014-11-04 16:59:46 +00:00
-- get the name, pid and attached port of all processes
2014-09-03 08:42:15 +00:00
-- which are listening on all interfaces
--------------------------------------------------------
2014-11-04 16:59:46 +00:00
SELECT DISTINCT
process.name,
listening.port,
2014-09-03 08:42:15 +00:00
process.pid
FROM processes AS process
JOIN listening_ports AS listening
ON process.pid = listening.pid
WHERE listening.address = '0.0.0.0';
```
2014-11-04 16:59:46 +00:00
2014-09-03 08:42:15 +00:00
```sql
--------------------------------------------------------
2014-11-04 16:59:46 +00:00
-- find every launchdaemon on an OS X host which
-- * launches an executable when the operating
2014-09-03 08:42:15 +00:00
-- system starts
2014-11-04 16:59:46 +00:00
-- * keeps the executable running
-- return the name of the launchdaemon and the full
2014-09-03 08:42:15 +00:00
-- path (with arguments) of the executable to be ran.
--------------------------------------------------------
2014-11-04 16:59:46 +00:00
SELECT
name,
program || program_arguments AS executable
FROM launchd
WHERE
(run_at_load = 'true' AND keep_alive = 'true')
AND
2014-09-03 08:42:15 +00:00
(program != '' OR program_arguments != '');
```
These queries can be:
- performed on an ad-hoc basis to explore operating system state
- executed via a scheduler to monitor operating system state across a distributed set of hosts over time
- launched from custom applications using osquery APIs
2014-10-30 02:24:20 +00:00
## Install
2014-11-03 09:41:30 +00:00
### OS X
2014-11-04 16:59:46 +00:00
The easiest way to install osquery on OS X is via Homebrew. Check the [Homebrew ](http://brew.sh/ ) homepage for installation instructions.
2014-11-03 09:41:30 +00:00
Run the following:
```
brew update
brew install osquery
```
To update osquery:
```
brew update
brew upgrade osquery
```
### Linux
2014-11-03 09:50:31 +00:00
We don't currently supply pre-built osquery packages for Linux. We do, however, provide Vagrant VMs which allow you to easily create packages for Ubuntu 12.04+ and CentOS 6.5. Check out the wiki's [installation guide ](https://github.com/facebook/osquery/wiki/install-linux ) for more information.
2014-11-03 09:50:54 +00:00
If you're trying to build osquery on a different, currently unsupported operating system, please refer to the [building the code guide ](https://github.com/facebook/osquery/wiki/building-the-code ) for help.
2014-10-30 02:24:20 +00:00
2014-09-05 06:29:26 +00:00
## Learn more
2014-08-12 00:51:30 +00:00
2014-10-29 18:18:35 +00:00
Read the [launch blog post ](https://code.facebook.com/posts/844436395567983/introducing-osquery/ ) for background on the project.
2014-09-05 07:44:50 +00:00
If you're interested in learning more about osquery, visit the [wiki ](https://github.com/facebook/osquery/wiki ).
2014-11-19 02:23:46 +00:00