GitHub
11/08/2026, 8:13 AMEnvManager.UpdateFields already moves name-keyed rows (osquery_nodes, node_posture) when it renames an environment. In the same transaction, it now rewrites distributed_query_targets rows where type = 'environment' and value is the old name.
• Targets stored as the environment UUID are left alone, since a rename doesn't change the UUID.
• Other target types (platform, uuid, host, tag) are not touched.
• No schema change.
Security and operational impact
• Results from queries that existed before a rename are visible again to the users who could see them before.
• The rule is unchanged: results are judged against the caller's lowest tier across the targeted environments.
• osctrl-tls is not changed.
Validation
• New TestUpdateFieldsRenameMovesQueryTargets checks that:
• the old-name environment target moves to the new name;
• the UUID target, a platform target with the same text, and another environment's target are unchanged.
• The test failed before the fix and passes after.
• go test ./... passes.
jmpsec/osctrlGitHub
11/08/2026, 8:25 AM