-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't expire iOS devices prematurely (#25436)
#25406 The `last_seen_times` table is only updates when osquery hits one of its authenticated endpoints, meaning it isn't updated when devices without osquery, like iphones, are enrolled. I've left a [comment](#25406 (comment)) on the original issue explaining how this happens. Originally, if there was no `last_seen_time`, the fallback value would be the `created_at` value on the `hosts` table, so ios devices would always get deleted once they were added X number of days ago. In its place, I've added the `detail_updated_at` column on the `hosts` table as the fallback value, and only use `created_at` if that is also empty. `detail_updated_at` is updated every time a full detail refetch completes. In the case of ios/ipados, [this is done using MDM](https://github.com/fleetdm/fleet/blob/cd5c0e8aed10664458f597b5d9600dd20bf3fdac/server/service/apple_mdm.go#L3101). `detail_updated_at` is updated less frequently than `last_seen_times`, only once every hour or so instead of every 30 seconds, but since expiration policies are set on the scale of days instead of hours, this should be fine. The way I've QA'd this is by adding an iOS device to my fleet instance, waited 24 hours, and set the expiration policy to 24 hours.
- Loading branch information
1 parent
d3ea62a
commit 3a2a689
Showing
3 changed files
with
94 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Fixed bug where iOS devices were being removed prematurely by expiration policy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters