Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Deploys and configures osquery for real-time endpoint monitoring using SQL-based queries to inspect running processes, open ports, installed software, and system configuration. Use when building visibility into endpoint state, threat hunting across fleet, or implementing compliance monitoring. Activates for requests involving osquery deployment, endpoint visibility, fleet management, or SQL-based endpoint querying.
.claude/skills/deploying-osquery-for-endpoint-monitoring/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-23 | ✗→✓ | ▲ Improved | — | — |
| case-22 | ✗→✓ | ▲ Improved | — | — |
| case-19 | ✗→✓ | ▲ Improved | — | — |
| case-01 | ✗→✓ | ▲ Improved | — | — |
| case-18 | ✗→✓ | ▲ Improved | — | — |
Use this skill when:
Do not use for real-time alerting (osquery is periodic/on-demand; use EDR for real-time).
bash# Ubuntu/Debian export OSQUERY_KEY=1484120AC4E9F8A1A577AEEE97A80C63C9D8B80B apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys $OSQUERY_KEY add-apt-repository 'deb [arch=amd64] https://pkg.osquery.io/deb deb main' apt-get update && apt-get install osquery -y # Windows (MSI) # Download from https://osquery.io/downloads/official msiexec /i osquery-5.12.1.msi /quiet # macOS brew install osquery
json// /etc/osquery/osquery.conf (Linux/macOS) or C:\ProgramData\osquery\osquery.conf { "options": { "config_plugin": "filesystem", "logger_plugin": "filesystem", "logger_path": "/var/log/osquery", "disable_logging": "false", "schedule_splay_percent": "10", "events_expiry": "3600", "verbose": "false", "worker_threads": "2", "enable_monitor": "true", "disable_events": "false", "disable_audit": "false", "audit_allow_config": "true", "host_identifier": "hostname", "enable_syslog": "true" }, "schedule": { "process_monitor": { "query": "SELECT pid, name, path, cmdline, uid, parent FROM processes WHERE on_disk = 0;", "interval": 300, "description": "Detect processes running without on-disk binary (fileless)" }, "listening_ports": { "query": "SELECT DISTINCT p.name, p.path, lp.port, lp.protocol, lp.address FROM listening_ports lp JOIN processes p ON lp.pid = p.pid WHERE lp.port != 0;", "interval": 600, "description": "Monitor listening network ports" }, "persistence_check": { "query": "SELECT name, path, source FROM startup_items;", "interval": 3600, "description": "Monitor persistence mechanisms" }, "installed_packages": { "query": "SELECT name, version, source FROM deb_packages;", "interval": 86400, "description": "Daily software inventory" }, "users_and_groups": { "query": "SELECT u.username, u.uid, u.gid, u.shell, u.directory FROM users u WHERE u.uid >= 1000;", "interval": 3600 }, "crontab_monitor": { "query": "SELECT * FROM crontab;", "interval": 3600, "description": "Monitor scheduled tasks" }, "suid_binaries": { "query": "SELECT path, username, permissions FROM suid_bin;", "interval": 86400, "description": "Detect SUID binaries" } }, "packs": { "incident-response": "/usr/share/osquery/packs/incident-response.conf", "ossec-rootkit": "/usr/share/osquery/packs/ossec-rootkit.conf", "vuln-management": "/usr/share/osquery/packs/vuln-management.conf" } }
sql-- Detect processes with no on-disk binary (potential fileless malware) SELECT pid, name, path, cmdline FROM processes WHERE on_disk = 0; -- Find listening ports not associated with known services SELECT lp.port, lp.protocol, p.name, p.path FROM listening_ports lp JOIN processes p ON lp.pid = p.pid WHERE lp.port NOT IN (22, 80, 443, 3306, 5432); -- Detect unauthorized SSH keys SELECT * FROM authorized_keys WHERE NOT key LIKE '%admin-team%'; -- Find recently modified system binaries SELECT path, mtime, size FROM file WHERE path LIKE '/usr/bin/%' AND mtime > (strftime('%s', 'now') - 86400); -- Detect processes connecting to external IPs SELECT DISTINCT p.name, p.path, pn.remote_address, pn.remote_port FROM process_open_sockets pn JOIN processes p ON pn.pid = p.pid WHERE pn.remote_address NOT LIKE '10.%' AND pn.remote_address NOT LIKE '172.16.%' AND pn.remote_address NOT LIKE '192.168.%' AND pn.remote_address != '127.0.0.1' AND pn.remote_address != '0.0.0.0'; -- Windows: Detect unsigned running executables SELECT p.name, p.path, a.result AS signature_status FROM processes p JOIN authenticode a ON p.path = a.path WHERE a.result != 'trusted';
bash# FleetDM provides centralized osquery management # Deploy FleetDM server, configure agents to report to it # Agents use TLS enrollment and config from Fleet # Agent configuration for Fleet: # --tls_hostname=fleet.corp.com # --tls_server_certs=/etc/osquery/fleet.pem # --enroll_secret_path=/etc/osquery/enroll_secret
| Term | Definition | |------|-----------| | Osquery | Open-source endpoint agent that exposes OS state as SQL tables for querying | | Schedule | Periodic queries that run at defined intervals and log results | | Pack | Collection of related queries grouped for specific use cases (IR, compliance) | | FleetDM | Open-source osquery fleet management platform | | Differential Results | Osquery logs only changes between query executions, reducing data volume |
EXPLAIN.--disable_events=false.| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-25 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-23 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-24 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 25 cases were attempted. The headline lift of +36 percentage points is the difference between those two pass rates over the 25 comparable cases.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.