fleet/server/worker
Jordan Montgomery 78c0b0c651
43885: MLAPR migration + UUID capture (#44244)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #43885

Adds a migration and code to capture the value of the fleet managed
admin account if one exists. Changes file added for entire feature

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements), JS
inline code is prevented especially for url redirects, and untrusted
data interpolated into shell scripts/commands is validated against shell
metacharacters.
- [x] Timeouts are implemented and retries are limited to avoid infinite
loops

## Testing

- [x] Added/updated automated tests
- [x] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)

- [x] QA'd all new/changed functionality manually

## Database migrations

- [x] Checked schema for all modified table for columns that will
auto-update timestamps during migration.
- [x] Confirmed that updating the timestamps is acceptable, and will not
cause unwanted side effects.
- [x] Ensured the correct collation is explicitly set for character
columns (`COLLATE utf8mb4_unicode_ci`).


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Automatic password rotation for managed local admin accounts on macOS,
triggered after viewing activity.
* Provisioning now captures and persists the managed admin account
identifier (UUID) to support rotation and prevents that account from
being stored as a regular user.
* Hosts will request a best-effort recheck when the managed admin
identifier is not yet available.

* **Chores**
* Database schema updated to store rotation scheduling and pending
credential state.

* **Tests**
* Added tests covering UUID capture, conditional updates, migration, and
ingest behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-29 11:14:50 -04:00
..
apple_mdm.go 43885: MLAPR migration + UUID capture (#44244) 2026-04-29 11:14:50 -04:00
apple_mdm_test.go don't send AccountConfiguration for non macs (#44085) 2026-04-24 09:40:52 -06:00
automation_failer.go Support failing policies integrations (#5973) 2022-06-06 10:41:51 -04:00
automation_failer_test.go Dismiss gosec G602 and G115 in test code (#40960) 2026-03-04 13:34:35 -05:00
batch_activities.go Migrating server/worker and related code to slog (#40205) 2026-02-23 13:18:07 -06:00
batch_activities_test.go Batch script cron schedule (#31808) 2025-08-14 14:44:47 -04:00
db_migrations.go Migrating server/worker and related code to slog (#40205) 2026-02-23 13:18:07 -06:00
db_migrations_test.go Final slog migration PR: test infrastructure + tools + remaining standalone files (#40727) 2026-02-28 05:52:21 -06:00
jira.go Update fleetctl client urls and params (#41463) 2026-03-13 08:38:55 -05:00
jira_test.go Update fleetctl client urls and params (#41463) 2026-03-13 08:38:55 -05:00
macos_setup_assistant.go Migrating server/worker and related code to slog (#40205) 2026-02-23 13:18:07 -06:00
macos_setup_assistant_test.go Final slog migration PR: test infrastructure + tools + remaining standalone files (#40727) 2026-02-28 05:52:21 -06:00
software_worker.go Migrating server/worker and related code to slog (#40205) 2026-02-23 13:18:07 -06:00
software_worker_test.go Migrating server/worker and related code to slog (#40205) 2026-02-23 13:18:07 -06:00
vpp_verification.go Migrating server/worker and related code to slog (#40205) 2026-02-23 13:18:07 -06:00
worker.go Migrating server/worker and related code to slog (#40205) 2026-02-23 13:18:07 -06:00
worker_test.go Final slog migration PR: test infrastructure + tools + remaining standalone files (#40727) 2026-02-28 05:52:21 -06:00
zendesk.go Update fleetctl client urls and params (#41463) 2026-03-13 08:38:55 -05:00
zendesk_test.go Update fleetctl client urls and params (#41463) 2026-03-13 08:38:55 -05:00