iac.htora.dev · security templates

Home/Refreshers/Ask every host the same questions: refresher

Ask every host the same questions

osquery on Linux, macOS, and Windows, logging changes to accounts, keys, persistence, listening ports, and drivers.

Remember

  1. osquery asks on a schedule: the same questions on every host.
  2. It compares with the last answer: and logs only what appeared or went away.
  3. The results log keeps the history: so the day before is still there.
  4. Your forwarder carries it off: syslog on Linux and macOS (Standard).
PlatformUsesThe part that catches people
Linuxosquery from a checksummed .deb or .rpm, with a scheduled configurationEach osquery release is a new package, so neither template has a default URL.
macOSosquery from a checksummed .pkg, run by a launch daemonWithout Full Disk Access some tables return nothing, silently.
Windowsosquery from a checksummed .msi, run as the osqueryd serviceThe templates set the service's command line to read their flag file, so the flags in use do not depend on how the installer set it up.

Run the quick start

Reach the Linux machinesansible all -i inventory.ini -m ping
Reach the Macsansible all -i inventory.ini -m ping
Windows modules, onceansible-galaxy collection install ansible.windows:==3.3.0
Reach the Windows machinesansible all -i inventory.ini -m ansible.windows.win_ping
Previewansible-playbook -i inventory.ini playbook.yml --check --diff
Runansible-playbook -i inventory.ini playbook.yml
Run again, expect changed=0ansible-playbook -i inventory.ini playbook.yml

Watch out

  • Results are differences.
  • osqueryi on the host answers the same questions on demand, which is how a responder checks one machine during triage.
Check it worked

Add a local user on a test host. Within an hour the results log shows the user as added.

Read the full pageDownload PDF

Registry 0.23.0. Built 2026-11-17.

Made by Habibullah Tora. Source on GitHub. Code under the MIT licence, writing under CC BY 4.0.