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
- osquery asks on a schedule: the same questions on every host.
- It compares with the last answer: and logs only what appeared or went away.
- The results log keeps the history: so the day before is still there.
- Your forwarder carries it off: syslog on Linux and macOS (Standard).
| Platform | Uses | The part that catches people |
|---|---|---|
| Linux | osquery from a checksummed .deb or .rpm, with a scheduled configuration | Each osquery release is a new package, so neither template has a default URL. |
| macOS | osquery from a checksummed .pkg, run by a launch daemon | Without Full Disk Access some tables return nothing, silently. |
| Windows | osquery from a checksummed .msi, run as the osqueryd service | The 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 machines | ansible all -i inventory.ini -m ping |
| Reach the Macs | ansible all -i inventory.ini -m ping |
| Windows modules, once | ansible-galaxy collection install ansible.windows:==3.3.0 |
| Reach the Windows machines | ansible all -i inventory.ini -m ansible.windows.win_ping |
| Preview | ansible-playbook -i inventory.ini playbook.yml --check --diff |
| Run | ansible-playbook -i inventory.ini playbook.yml |
| Run again, expect changed=0 | ansible-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.