Open ddribeiro opened 2 months ago
cc: @mikermcneil @noahtalerman
Linked to Unthread ticket:
Interested in this ticket, I'd definitely prefer option (1) and am not sure I would use option (2):
Fleet already has a queueing system that is uses for script execution. If an admin runs a script on a host that is offline, Fleet will queue that script and run it when the host comes online. The same functionality could be extended to live queries. This option would allow customer-figali to generally use their same workflow and move it to Fleet.
The advantage of this is to be able to leverage native osquery live querying functionality, which already provides a way to run scoped queries. I would like it to be easy for customers to leverage the full capabilities built in to osquery, without having to enable Fleet to run arbitrary code on devices (through scripts) at all.
If Fleet is going to offer the live query capability at all (which I think it should and appreciate!), it makes sense to me to fold it into Fleet's queuing system as a new type of scheduled action -- the idea being that not all scheduled actions on a host need to be expressed as a Bash script.
Generally nervous about increasing reliance on Bash scripts overall, which seem harder to write robustly and correctly than SQL queries to osquery (or native osquery extension code which can be written in Go, for example).
Gong snippet: https://us-65885.app.gong.io/call?id=7283736297840441495&highlights=%5B%7B%22type%22%3A%22SHARE%22%2C%22from%22%3A1126%2C%22to%22%3A3694%7D%5D
Goals
Problem
customer-figali
currently has a workflow using vanilla osquery in which they perform remediation actions on their hosts using osquery extensions. This workflow is depending on targeting a host with a query and knowing that if the host is offline, it will eventually run the query when it comes back online.They would like to use Fleet's live queries to trigger this workflow, but if a host is offline when the live query is run, it will not run that query when it comes back online.
What have you tried?
customer-figali
would like to use Fleet to run the queries but are running into the following issues:Potential solutions
There could be 2 potential paths to a solution:
Fleet already has a queueing system that is uses for script execution. If an admin runs a script on a host that is offline, Fleet will queue that script and run it when the host comes online. The same functionality could be extended to live queries. This option would allow
customer-figali
to generally use their same workflow and move it to Fleet.customer-figali
would migrate their workflow to use scripts and take advantage of the queuing system for scripts that exists in Fleet today.osqueryi
in the script, which would run the query and trigger the remediation extension.customer-figali
has about allowing their tools to run arbitrary code on their hosts.Note: This method is dependent on
customer-figali
testing to make sure invokingosqueryi
using scripts works as expectedWhat is the expected workflow as a result of your proposal?
As a result of this proposal, `customer-figali` would either: 1. Use live queries to trigger a query on a host (and have assurance that it will eventually run if the host is currently offline) and adopt their existing workflow to Fleet. 2. Modify their existing workflow to be scripts based and take advantage of the queuing capability that already exists in Fleet. - The customer would have a set list of allowed scripts that can be customized with parameters. - The scripts would be triggered with an account that only has permissions to run those trusted scripts.