From edbed08fbade74ae7eaa45873c8fcbf1a902c491 Mon Sep 17 00:00:00 2001 From: Stephen Hinck Date: Thu, 12 Feb 2026 09:26:38 -0800 Subject: [PATCH 1/6] fix: Process objectguid as common property - BED-7397 --- .../Processors/LdapPropertyProcessor.cs | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/CommonLib/Processors/LdapPropertyProcessor.cs b/src/CommonLib/Processors/LdapPropertyProcessor.cs index 5e1d7ed8..87ad4041 100644 --- a/src/CommonLib/Processors/LdapPropertyProcessor.cs +++ b/src/CommonLib/Processors/LdapPropertyProcessor.cs @@ -53,6 +53,21 @@ private static Dictionary GetCommonProps(IDirectoryObject entry) ret["whencreated"] = Helpers.ConvertTimestampToUnixEpoch(wc); } + if (entry.TryGetByteProperty(LDAPProperties.objectguid, out var objectguid)) { + if (objectguid != null && objectguid.Length == 16) + { + try + { + Guid guid = new Guid(objectguid); + ret["objectguid"](LDAPProperties.ObjectGUID, guid.ToString().ToUpper()); + } + catch + { + // Skip malformed GUID bytes + } + } + } + return ret; } @@ -441,20 +456,6 @@ await SendComputerStatus(new CSVComputerStatus { } } - var objectGuidBytes = entry.GetByteProperty(LDAPProperties.ObjectGUID); - if (objectGuidBytes != null && objectGuidBytes.Length == 16) - { - try - { - Guid guid = new Guid(objectGuidBytes); - props.Add(LDAPProperties.ObjectGUID, guid.ToString().ToUpper()); - } - catch - { - // Skip malformed GUID bytes - } - } - compProps.DumpSMSAPassword = smsaPrincipals.ToArray(); compProps.Props = props; From c81bf2ab436a7df53e3a077c6a07885d664c0bd1 Mon Sep 17 00:00:00 2001 From: Stephen Hinck Date: Thu, 12 Feb 2026 09:34:18 -0800 Subject: [PATCH 2/6] wip --- src/CommonLib/Processors/LdapPropertyProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CommonLib/Processors/LdapPropertyProcessor.cs b/src/CommonLib/Processors/LdapPropertyProcessor.cs index 87ad4041..cdc6e1f0 100644 --- a/src/CommonLib/Processors/LdapPropertyProcessor.cs +++ b/src/CommonLib/Processors/LdapPropertyProcessor.cs @@ -53,7 +53,7 @@ private static Dictionary GetCommonProps(IDirectoryObject entry) ret["whencreated"] = Helpers.ConvertTimestampToUnixEpoch(wc); } - if (entry.TryGetByteProperty(LDAPProperties.objectguid, out var objectguid)) { + if (entry.TryGetByteProperty(LDAPProperties.ObjectGUID, out var objectguid)) { if (objectguid != null && objectguid.Length == 16) { try From 21ae19a60c86190cb83494e362bcfaaec54a7cf3 Mon Sep 17 00:00:00 2001 From: Stephen Hinck Date: Thu, 12 Feb 2026 09:45:15 -0800 Subject: [PATCH 3/6] wip --- src/CommonLib/Processors/LdapPropertyProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CommonLib/Processors/LdapPropertyProcessor.cs b/src/CommonLib/Processors/LdapPropertyProcessor.cs index cdc6e1f0..eabcfe0b 100644 --- a/src/CommonLib/Processors/LdapPropertyProcessor.cs +++ b/src/CommonLib/Processors/LdapPropertyProcessor.cs @@ -58,7 +58,7 @@ private static Dictionary GetCommonProps(IDirectoryObject entry) { try { - Guid guid = new Guid(objectguid); + var guid = new Guid(objectguid); ret["objectguid"](LDAPProperties.ObjectGUID, guid.ToString().ToUpper()); } catch From e633e10db8a9cede0d7720f0e55846e87494027c Mon Sep 17 00:00:00 2001 From: Stephen Hinck Date: Thu, 12 Feb 2026 09:46:21 -0800 Subject: [PATCH 4/6] CR --- src/CommonLib/Processors/LdapPropertyProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CommonLib/Processors/LdapPropertyProcessor.cs b/src/CommonLib/Processors/LdapPropertyProcessor.cs index eabcfe0b..5814ddcd 100644 --- a/src/CommonLib/Processors/LdapPropertyProcessor.cs +++ b/src/CommonLib/Processors/LdapPropertyProcessor.cs @@ -59,7 +59,7 @@ private static Dictionary GetCommonProps(IDirectoryObject entry) try { var guid = new Guid(objectguid); - ret["objectguid"](LDAPProperties.ObjectGUID, guid.ToString().ToUpper()); + ret["objectguid"] = guid.ToString().ToUpperInvariant(); } catch { From 8039a7b3797d8c63b3ebcb6b110a33bdd16dbd41 Mon Sep 17 00:00:00 2001 From: Stephen Hinck Date: Thu, 12 Feb 2026 09:48:21 -0800 Subject: [PATCH 5/6] wip --- src/CommonLib/Processors/LdapPropertyProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CommonLib/Processors/LdapPropertyProcessor.cs b/src/CommonLib/Processors/LdapPropertyProcessor.cs index 5814ddcd..1fed2768 100644 --- a/src/CommonLib/Processors/LdapPropertyProcessor.cs +++ b/src/CommonLib/Processors/LdapPropertyProcessor.cs @@ -58,7 +58,7 @@ private static Dictionary GetCommonProps(IDirectoryObject entry) { try { - var guid = new Guid(objectguid); + Guid guid = new Guid(objectguid); ret["objectguid"] = guid.ToString().ToUpperInvariant(); } catch From 7b81b2663c7c4fd883d680d17ce7f04333b488c7 Mon Sep 17 00:00:00 2001 From: Michael Cuomo Date: Thu, 12 Feb 2026 13:38:56 -0500 Subject: [PATCH 6/6] chore: add WindowsOnly to Security Identifier Tests --- test/unit/CommonLibHelperTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/CommonLibHelperTests.cs b/test/unit/CommonLibHelperTests.cs index 0cad80e1..f2e4c0c1 100644 --- a/test/unit/CommonLibHelperTests.cs +++ b/test/unit/CommonLibHelperTests.cs @@ -302,7 +302,7 @@ public void DomainNameToDistinguishedName_DotsBecomeDcComponents() Assert.Equal("DC=test,DC=local", result); } - [Theory] + [WindowsOnlyTheory] [InlineData("S-1-5-32-544", "\\01\\02\\00\\00\\00\\00\\00\\05\\20\\00\\00\\00\\20\\02\\00\\00")] public void ConvertSidToHexSid_ValidSid_MatchesSecurityIdentifierBinaryForm(string sid, string expectedHexSid) { @@ -322,7 +322,7 @@ static string BuildExpectedHexSid(string sid) } } - [Fact] + [WindowsOnlyFact] public void ConvertSidToHexSid_InvalidSid_Throws() { Assert.ThrowsAny(() => Helpers.ConvertSidToHexSid("NOT-A-SID"));