-
Notifications
You must be signed in to change notification settings - Fork 836
macOS SE | Create LAA Backend: ADE enrollment flow #42943
Copy link
Copy link
Open
Labels
#g-softwareSoftware product groupSoftware product group:releaseReady to write code. Scheduled in a release. See "Making changes" in handbook.Ready to write code. Scheduled in a release. See "Making changes" in handbook.~backendBackend-related issue.Backend-related issue.~sub-taskA technical sub-task that is part of a story. (Not QA'd. Not estimated.)A technical sub-task that is part of a story. (Not QA'd. Not estimated.)
Milestone
Metadata
Metadata
Assignees
Labels
#g-softwareSoftware product groupSoftware product group:releaseReady to write code. Scheduled in a release. See "Making changes" in handbook.Ready to write code. Scheduled in a release. See "Making changes" in handbook.~backendBackend-related issue.Backend-related issue.~sub-taskA technical sub-task that is part of a story. (Not QA'd. Not estimated.)A technical sub-task that is part of a story. (Not QA'd. Not estimated.)
Type
Projects
Status
🐣 In progress
Related user story
Parent: #37141
Depends on: #42942
Task
Wire the foundational primitives into the ADE enrollment flow, MDM command result processing, enterprise settings toggle, password retrieval API, and host detail response. This is one PR because the pieces are tightly coupled: the datastore interface is driven by the enrollment flow's needs, the ack handler and API endpoint share service-layer context, and the end-to-end integration test (enrollment → ack → view password → host detail) spans all of them.
Key implementation details:
AccountConfigurationplist usespasswordHash(SALTED-SHA512-PBKDF2), not plaintext. The PBKDF2 hash is computed at command creation time and embedded directly in the plist. NoExpandHostSecrets/ placeholder expansion is needed.AccountConfigurationcommand, not sent as two separate commands.AccountConfigurationis sent withAutoSetupAdminAccountsonly. This is a new code path. TodayAccountConfigurationis only sent when SSO is enabled.SaveHostManagedLocalAccount, which encrypts internally usingds.serverPrivateKey(same pattern asSetHostsRecoveryLockPasswords). Only the PBKDF2 hash goes to Apple.Conditions of satisfaction
Enrollment + ack:
host_managed_local_account_passwordsrow withstatus = NULLafter worker,status = 'verified'after MDM ack;created_managed_local_accountactivity loggedpasswordHashwith valid SALTED-SHA512-PBKDF2 data (not plaintext)PrimaryAccountFullName/UserNameANDAutoSetupAdminAccountsAutoSetupAdminAccountsonlycommand_uuidrow): no-op, no errorSettings:
PATCH /api/v1/fleet/setup_experiencewithenable_managed_local_account: truelogsenabled_managed_local_account;falselogsdisabled_managed_local_accountAPI + host response:
GET /hosts/:id/managed_local_accountreturns{ host_id, managed_local_account: { username, password, updated_at } }whenstatus = 'verified'viewed_managed_local_accountactivity logged on successmdm.os_settings.managed_local_account.{status, password_available}for darwin hostspassword_availableistrueonly whenstatus = 'verified',falsewhen pending or failedEnd-to-end integration test:
GET /hosts/:id/managed_local_accountreturns password → host detail showsstatus: "verified", password_available: trueMYSQL_TEST=1 REDIS_TEST=1 go test ./server/service/... ./server/worker/...passes