-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add func to exclude launcher db from time machine #1531
add func to exclude launcher db from time machine #1531
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
// darwin and is noop for other oses | ||
func ExcludeLauncherDB(ctx context.Context, k types.Knapsack) { | ||
dbPath := k.BboltDB().Path() | ||
cmd, err := allowedcmd.Tmutil(ctx, "addexclusion", dbPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should exclude the whole root directory. Maybe the secret too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually keep the secret. But probably ignore the whole root directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about that, but if I understand correctly, that would mean we would also not bring along all the updates. So after a time machine restore / backup the user would be back on the very first version of launcher they downloaded and would need to update again. Maybe that's okay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grabbing the updates, and the TUF db, is a great counterpoint. I think you're right, it's good to carry those.
Maybe we should drop some more stuff though. Can we go by wildcard? Or do we need to do own globbing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can wild card, you thinking *.db
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ ls /var/kolide-k2/k2device-preprod.kolide.com/
augeas-lenses menu.json
debug-2023-12-31T20-27-14.599.json.gz menu_template.json
debug-2024-01-03T05-30-26.256.json.gz metadata.json
debug-2024-01-06T19-20-54.029.json.gz metadata.plist
debug-2024-01-09T01-44-56.485.json.gz osquery.autoload
debug-2024-01-10T20-30-07.640.json.gz osquery.db
debug.json osquery.pid
desktop_501 osquery.sock
kolide.png osquery.sock.34719
kv.sqlite osquery.sock.3513
launcher-staging osqueryd-staging
launcher-tuf osqueryd-tuf
launcher-tuf-dev osqueryd-tuf-dev
launcher-version-1.4.1-3-ge21cebc tuf
launcher.db tuf-dev
launcher.pid updates
json, json.gz, the metadata, the menu, most of the osquery files, desktop, the pid files, sockets...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wildcards did not work as expected, ended up globbing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love how simple this is
|
||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if err != nil { | |
if err != nil { |
No description provided.