Repository navigation
feat: device identity templates, per-user state and retire-on-uninstall for virtual desktops - #246
Open
shubham-stepsecurity wants to merge 2 commits into
Conversation
This was referenced Oct 16, 2026
shubham-stepsecurity
force-pushed
the
sm/vdi-device-identity-v2
branch
2 times, most recently
from
October 19, 2026 05:04
533209a to
ab30849
Compare
…ll on top of the configurable device id resolver
shubham-stepsecurity
force-pushed
the
sm/vdi-device-identity-v2
branch
from
October 19, 2026 05:08
ab30849 to
4df8410
Compare
…l dir when uninstalling as SYSTEM
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #243 (one stable device ID across root and user runs), which includes #236 (configurable device IDs). Review those first; this PR contains their commits plus one on top.
What
Makes the agent fit pooled, ephemeral virtual desktop fleets (VDI / Azure Virtual Desktop): hosts rebuilt on a schedule, several logged-in users at once, deleted without notice.
device_id(config.json, MSIDEVICEID, bootstrap file,configure --device-id) now also accepts a template over{serial},{hostname}and{user}, and theSTEPSEC_DEVICE_IDenvironment variable overrides it at run time.{hostname}-{user}gives every user of a shared host their own device while a rebuilt host keeps its record;{user}follows a developer across hosts. Configured ids are sanitized for the backend's key formats; a plain literal and the default serial path are unchanged.serial_numberkeeps the real hardware serial and the payload gainsdevice_id_source.{user}, per-run state (run-gate cache, delta scan state, Node scan cache, run metrics) lives under<install dir>/users/<user>and the single-instance lock is per user, so concurrent sessions scan side by side as separate devices. The Windows scheduled task is registered withMultipleInstancesPolicy=Parallelin that case so a second session's instance is not dropped. A{user}template under a service account (SYSTEM, LOCAL SERVICE, machine accounts) is incomplete: the run is skipped with a log line instead of reporting under a made-up id, and the same predicate now flags Windows service accounts asno_user_logged_in.uninstall --retire, orretire_on_uninstall: truein config (MSIRETIREONUNINSTALL=1, bootstrap key), posts a best-effort retire to the backend before the scheduler job is removed, for every per-user identity the install has state for.--no-retiresuppresses it and the MSI passes it on a major upgrade; a failure (offline, older backend) is a warning that never blocks the uninstall.docs/deploying-on-virtual-desktops.md(template semantics, rebuild and reuse rules, provisioning, retire hooks, troubleshooting); MSI, Intune and SCCM guides updated.Testing
go build,go vet(darwin, windows, linux),go test ./...(51 packages),golangci-lint,gofmt,go mod tidywith no drift.internal/device/testdata/identity_vectors.jsonare shared with the Windows loader's PowerShell resolver in the agent-api branch (Pester, 17 tests).users\dev1andusers\dev2state dirs and the device ids<host>-dev1/<host>-dev2registered on the backend;configure showunder SYSTEM reports the identity as incomplete; the task carries the INTERACTIVE principal with the parallel instance policy.DEVICEID={hostname}and asserts the config andconfigure showoutput.Notes
retiredstatus, auto-retire sweep,device_id_sourceandno_user_logged_iningest). Console: step-security/console#4506.