Jira (FACT-1467) Add Windows computer_sid fact

5 views
Skip to first unread message

Ethan Brown (JIRA)

unread,
Jul 22, 2016, 6:45:08 PM7/22/16
to puppe...@googlegroups.com
Ethan Brown created an issue
 
Facter / Improvement FACT-1467
Add Windows computer_sid fact
Issue Type: Improvement Improvement
Affects Versions: FACT 3.1.8
Assignee: Unassigned
Components: Windows
Created: 2016/07/22 3:44 PM
Labels: windows
Priority: Normal Normal
Reporter: Ethan Brown

When referring to the Administrator account or Guest account on Windows, those well-known and commonly used names cannot be referred to with well-known SIDs - see https://msdn.microsoft.com/en-us/library/windows/desktop/aa379649(v=vs.85).aspx

Because these account names may also be localized on international versions of Windows, such as French and German - it can be difficult to write a manifest that doesn't need to vary based on the current OS language.

Administrator and Guest build on the computer's SID, which varies on an individual computer basis, like:

  • -500 is appended to the computer SID for the Administrator account
  • -501 is appended to the computer SID for the Guest account

To make it easier to refer to these accounts universally, regardless of which computer they're run on, whether the accounts have been localized or renamed, a first step would to be produce a Fact value containing the computers SID.

An easy way to do this is to call the LookupAccountName Windows API, passing in the computers name.

This value is also stored in the registry at HKLM\security\sam\domains\account, if the user has permission to access that key.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.13#64028-sha1:b7939e9)
Atlassian logo

Ethan Brown (JIRA)

unread,
Jul 22, 2016, 6:55:11 PM7/22/16
to puppe...@googlegroups.com
Ethan Brown updated an issue
Change By: Ethan Brown
When referring to the {{Administrator}} account or {{Guest}} account on Windows, those well-known and commonly used names cannot be referred to with well-known SIDs - see https://msdn.microsoft.com/en-us/library/windows/desktop/aa379649(v=vs.85).aspx

Because these account names may also be localized on international versions of Windows, such as French and German - it can be difficult to write a manifest that doesn't need to vary based on the current OS language.

{{Administrator}} and {{Guest}} build on the computer's SID, which varies on an individual computer basis, like:

* {{-500}} is appended to the computer SID for the {{Administrator}} account
* {{-501}} is appended to the computer SID for the {{Guest}} account


To make it easier to refer to these accounts universally, regardless of which computer they're run on, whether the accounts have been localized or renamed, a first step would to be produce a Fact value containing the computers SID.

An easy way to do this is to call the [LookupAccountName|https://msdn.microsoft.com/en-us/library/windows/desktop/aa379159(v=vs.85).aspx] Windows API, passing in the computers name.

This value is also stored in the registry at {{HKLM\security\sam\domains\account}}
 (particularly in the 24 byte span between 272 and 295 in the byte array) , if the user has permission to access that key  - see http://powershellers . blogspot.com/2009/06/how-to-get-computer-sid-using.html for more details

Craig Gomes (JIRA)

unread,
Jul 25, 2016, 5:26:07 PM7/25/16
to puppe...@googlegroups.com
Craig Gomes updated an issue
Change By: Craig Gomes
Fix Version/s: FACT 3.y

Geoff Nichols (JIRA)

unread,
Sep 15, 2016, 1:18:21 PM9/15/16
to puppe...@googlegroups.com
Geoff Nichols updated an issue
Change By: Geoff Nichols
Sprint: Windows APS  Triage
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Geoff Nichols (JIRA)

unread,
Sep 20, 2016, 7:24:04 PM9/20/16
to puppe...@googlegroups.com
Geoff Nichols updated an issue
Change By: Geoff Nichols
Sprint: AP Triage

Ethan Brown (JIRA)

unread,
Oct 16, 2016, 6:32:02 PM10/16/16
to puppe...@googlegroups.com
Ethan Brown commented on Improvement FACT-1467
 
Re: Add Windows computer_sid fact

Note that our internal management module at https://github.com/puppetlabs/puppetlabs-modules/blob/f969898d4337b80b983a0f654fc41dc8f2934f32/site/profile/manifests/jenkins/slave/windows.pp#L55 harcodes the value Administrator, which suffers from the problem described in this ticket.

Maggie Dreyer (JIRA)

unread,
May 17, 2017, 2:58:03 PM5/17/17
to puppe...@googlegroups.com
Maggie Dreyer updated an issue
Change By: Maggie Dreyer
Labels: triaged windows

Moses Mendoza (JIRA)

unread,
May 18, 2017, 1:49:32 PM5/18/17
to puppe...@googlegroups.com
Moses Mendoza updated an issue
Change By: Moses Mendoza
Labels: triaged  windows

Ethan Brown (JIRA)

unread,
May 31, 2017, 2:15:02 PM5/31/17
to puppe...@googlegroups.com
Ethan Brown updated an issue
Change By: Ethan Brown
When referring to the {{Administrator}} account or {{Guest}} account on Windows, those well-known and commonly used names cannot be referred to with well-known SIDs - see https://msdn.microsoft.com/en-us/library/windows/desktop/aa379649(v=vs.85).aspx

Because these account names may also be localized on international versions of Windows, such as French and German - it can be difficult to write a manifest that doesn't need to vary based on the current OS language.

{{Administrator}} and {{Guest}} build on the computer's SID, which varies on an individual computer basis, like:

* {{-500}} is appended to the computer SID for the {{Administrator}} account
* {{-501}} is appended to the computer SID for the {{Guest}} account

To make it easier to refer to these accounts universally, regardless of which computer they're run on, whether the accounts have been localized or renamed, a first step would to be produce a Fact value containing the computers SID.   There are a number of other SID structures that might be useful to surface as facts based on https://msdn.microsoft.com/en-us/library/cc980032.aspx

An easy way to do this is to call the [LookupAccountName|https://msdn.microsoft.com/en-us/library/windows/desktop/aa379159(v=vs.85).aspx] Windows API, passing in the computers name.

This value is also stored in the registry at {{HKLM\security\sam\domains\account}} (particularly in the 24 byte span between 272 and 295 in the byte array), if the user has permission to access that key - see http://powershellers.blogspot.com/2009/06/how-to-get-computer-sid-using.html for more details

Branan Riley (JIRA)

unread,
Mar 21, 2018, 6:28:03 PM3/21/18
to puppe...@googlegroups.com
Branan Riley updated an issue
Change By: Branan Riley
Labels: triaged windows
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Branan Riley (JIRA)

unread,
Mar 21, 2018, 6:28:03 PM3/21/18
to puppe...@googlegroups.com
Branan Riley updated an issue
Change By: Branan Riley
Labels: i18n triaged windows

Branan Riley (JIRA)

unread,
Mar 21, 2018, 6:28:04 PM3/21/18
to puppe...@googlegroups.com
Branan Riley updated an issue
Change By: Branan Riley
Fix Version/s: FACT 3.y

Branan Riley (JIRA)

unread,
May 14, 2018, 8:08:02 PM5/14/18
to puppe...@googlegroups.com
Branan Riley updated an issue
Change By: Branan Riley
Team: Platform Core OS

Josh Cooper (Jira)

unread,
Jun 6, 2020, 7:59:03 PM6/6/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Team: Platform OS Night's Watch
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Josh Cooper (Jira)

unread,
Jun 17, 2021, 11:57:02 AM6/17/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Epic Link: PUP-6719
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages