https://github.com/osquery/osquery logo
#fleet
Title
s

SK

03/04/2021, 9:43 AM
Hey guys, I was wondering how do you do automatic backup of the Fleet configs to like Gitlab/Github for versioning?
z

zwass

03/04/2021, 4:12 PM
You can use
fleetctl get packs --with-queries
and
fleetctl get options
to get most of this.
You can also use
fleetctl apply
in a CI pipeline so that all the changes flow from your repo to Fleet.
s

SK

03/04/2021, 4:16 PM
Ow yes that is an option, I was thinking more like if you also want to get the hosts how you could do that and put that in version control.
n

Noah Talerman

03/04/2021, 5:09 PM
@SK you would like to be able to create a config file with your hosts in Fleet so you can commit that to a version control system?
s

SK

03/04/2021, 5:24 PM
I was more like thinking
fleetctl get hosts --json
to have a view of the hosts for like when they go MIA and get removed from fleet you can have a list that you can use later to debug hosts that disappear but are still on and automatically create this and push to like a repo.
z

zwass

03/04/2021, 5:25 PM
You're in luck!
fleetctl get hosts --json
already exists 🙂
s

SK

03/04/2021, 5:28 PM
Yes I know 😉 but was more thinking best practices on how to ship it to a repo
z

zwass

03/05/2021, 12:17 AM
Rather than shipping it to a repo, what about setting the host expiration to a longer duration (or off) and then hitting the API/fleetctl for that list of hosts to look into?
s

SK

03/05/2021, 2:45 PM
Hey @zwass I just started using the expiration to declutter the db 😄 I think probably hitting the API every other day might be enough to get a list indeed and putting it somewhere just to have a list of systems we might be missing
2 Views