Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is osquery?

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.

Illustration for the cybersecurity term osquery
Home / Blog / Cybersecurity Terms / What Is osquery?
17 November 2026

What Is osquery?

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.

How It Works

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.

Tables Worth Knowing

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.

Running It Across a Fleet

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.

What It Is Not

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.

Why Security Teams Adopt It

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.

FAQ – Frequently Asked Questions

Is osquery an EDR Product?

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.

Which Operating Systems Does osquery Support?

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.

Does osquery Slow Machines Down?

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.

Can Attackers Abuse osquery?

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.

Related Terms

You May Be Interested In These

What Is Credential Stuffing?

Cybersecurity Terms

17 November 2026

What Is Credential Stuffing?

Read More
What Is Post-Quantum Migration Planning?

Cybersecurity Terms

17 November 2026

What Is Post-Quantum Migration Planning?

Read More