Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
osquery turns an operating system into a relational database, so analysts can ask SQL questions about running processes, listening ports, users, and file changes across a fleet.

What Is osquery?
osquery lets you ask an operating system questions in SQL. Running processes, listening sockets, installed packages, scheduled tasks, kernel extensions, browser plugins, and hundreds of other pieces of system state appear as tables, so SELECT name, path FROM processes WHERE on_disk = 0 becomes a perfectly ordinary query rather than a bespoke script per platform.
Facebook built it to manage a large and mixed estate and open-sourced it in October 2014. Development moved to the Linux Foundation in 2019, and the tool now runs on Windows, macOS, Linux, and FreeBSD from one codebase with largely the same table set.
Under the bonnet, osquery embeds SQLite and registers virtual tables. Nothing is stored in advance: when a query touches the processes table, osquery walks the process list at that moment and materialises the rows. That design keeps the agent light, and it means results reflect the state of the machine at query time rather than the state of a database that may be hours stale.
Two binaries do the work. osqueryi is an interactive shell for ad-hoc investigation on a single host. osqueryd is the daemon that runs a schedule of queries, writes results to a log, and supports differential output, so a query that returns the same 200 rows every hour only emits the rows that were added or removed. That difference is what makes fleet-wide scheduling affordable.
processes, process_open_sockets, and listening_ports for what is running and what it is talking to.users, logged_in_users, and shadow or windows_security_products for account and host posture.startup_items, services, scheduled_tasks, and launchd for persistence mechanisms.file_events and process_events, which stream from inotify, Endpoint Security on macOS, or the Windows event tracing providers once evented tables are enabled.registry on Windows, which answers questions that otherwise need a remote PowerShell session.Queries are grouped into packs. The project ships packs for incident response, compliance hardening checks, and detection content mapped to adversary behaviour, and teams usually maintain their own alongside them.
A single agent is useful; thousands are a detection capability. osquery speaks to a server over its TLS plugin, which supplies configuration, collects results, and distributes one-off queries to selected hosts. Open-source and commercial fleet managers build on that interface, giving you a console where an analyst can run a query against every laptop in the organisation and have answers in seconds.
That is the appeal during an incident. If threat hunting turns up a suspicious service name, one distributed query tells you how many other machines have it. Teams often pair osquery with a heavier DFIR collector such as Velociraptor, using osquery for continuous posture and the collector for deep forensic acquisition.
osquery is visibility, not protection. It does not block anything, quarantine files, or kill processes, and it has no built-in detection logic beyond the queries you write. Nor is it a replacement for endpoint detection and response: evented tables give decent process and file telemetry, but a dedicated agent sees deeper into memory, injection, and tampering.
It also deserves respect as an attack surface. The agent typically runs with high privileges and reads configuration from a server, so compromise of that server is effectively code execution across the fleet. Pin the agent to a known certificate authority, restrict who can push distributed queries, log every one that is issued, and review packs before deploying them, because an unbounded query across a large table can hurt older hardware.
Three reasons come up repeatedly: one query language across three operating systems, logs that drop straight into a SIEM as JSON, and auditable evidence for frameworks such as Cyber Essentials, where you must show that devices are patched, that unsupported software has gone, and that account controls are applied. A scheduled pack answers all three questions nightly and leaves a record.
At Privia Security, we use osquery telemetry during assessments to show clients exactly what their own agents could have revealed, and our SOC Maturation Services help teams turn that data into working detections.
No. osquery collects and exposes system state, but it cannot block a process, quarantine a file, or roll back a change. Evented tables give it reasonable process and file telemetry, so it covers part of what endpoint detection and response does, yet it offers no response actions and far less insight into memory and tampering. Many teams run both.
Windows, macOS, Linux, and FreeBSD, from a single codebase. Many tables are common to all four, which is the main attraction for mixed estates. Some are platform-specific, such as the Windows registry and services tables or macOS launchd and keychain tables, so queries intended to run everywhere need to account for that.
Well-written queries are cheap, but badly scoped ones are not. Enumerating every file on a disk, hashing large binaries, or scheduling heavy queries at a short interval will be noticed on older hardware. osquery includes a watchdog that restarts the daemon when it exceeds memory or CPU limits, and query performance statistics are available so you can find the expensive ones.
The agent runs with high privileges and trusts its management server, so anyone who controls that server can run privileged queries across the fleet and read sensitive output. Treat the fleet manager as a tier-zero system: restrict administrative access, require multi-factor authentication, pin certificates, and log every distributed query along with the account that issued it.
You May Be Interested In These
Cybersecurity Terms
17 November 2026
What Is the Difference Between Authentication and Authorisation?
Read More
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.