-
Notifications
You must be signed in to change notification settings - Fork 53
Add netlogon reg key #244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add netlogon reg key #244
Conversation
WalkthroughAdds a new string-based API result type, exposes it on DCRegistryData, and implements a DCRegistryProcessor method to read the Netlogon VulnerableChannelAllowList registry value and return it as a StrRegistryAPIResult. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant Proc as DCRegistryProcessor
participant Reg as Registry
Caller->>Proc: GetVulnerableNetlogonSecurityDescriptor(target)
note right of Proc: create StrRegistryAPIResult
Proc->>Reg: Read HKLM\\SYSTEM\\...\\Netlogon\\Parameters\\VulnerableChannelAllowList
Reg-->>Proc: { Collected, Value?, FailureReason? }
alt Collected = false
Proc-->>Caller: StrRegistryAPIResult { Collected=false, FailureReason }
else Collected = true and Value = null
Proc-->>Caller: StrRegistryAPIResult { Collected=true, Value=null }
else Collected = true and Value present
Proc-->>Caller: StrRegistryAPIResult { Collected=true, Value=string }
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
src/CommonLib/OutputTypes/Computer.cs (1)
65-69: Document intent and consider initializing the new fieldThis holds the SDDL from HKLM\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters:VulnerableChannelAllowList (the allow-list backing the “Allow vulnerable Netlogon secure channel connections” policy). A short XML doc comment would prevent ambiguity, and initializing avoids null consumers. (calcomsoftware.com, support.microsoft.com)
Apply:
public class DCRegistryData { public IntRegistryAPIResult CertificateMappingMethods { get; set; } public IntRegistryAPIResult StrongCertificateBindingEnforcement { get; set; } - public StrRegistryAPIResult VulnerableNetlogonSecurityDescriptor { get; set; } + /// <summary> + /// SDDL from HKLM\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters\VulnerableChannelAllowList, + /// which controls exceptions for vulnerable Netlogon secure channel connections. + /// </summary> + public StrRegistryAPIResult VulnerableNetlogonSecurityDescriptor { get; set; } = new(); }src/CommonLib/OutputTypes/APIResults/StrRegistryAPIResult.cs (1)
1-7: Make Value non-null by default (aligns with typical APIResult consumers)Calls may return “collected but not present”; returning empty avoids null-handling churn and matches how int results use a sentinel.
namespace SharpHoundCommonLib.OutputTypes { public class StrRegistryAPIResult : APIResult { - public string Value { get; set; } + public string Value { get; set; } = string.Empty; } }src/CommonLib/Processors/DCRegistryProcessor.cs (2)
106-114: Harden against unexpected registry data typesOn some systems the value might be stored or returned differently; handle string[] defensively and surface an explicit FailureReason on type mismatch. (learn.microsoft.com)
- if (data.Value == null) - { - return ret; - } - - ret.Value = (string)data.Value; + if (data.Value == null) + { + return ret; + } + if (data.Value is string s) + { + ret.Value = s; + return ret; + } + if (data.Value is string[] arr) + { + ret.Value = string.Join(";", arr); + return ret; + } + ret.FailureReason = $"Unexpected registry value type for {subValue}: {data.Value.GetType().Name}";
95-97: Minor: add a short inline comment with the policy name for future readersReduces context-switching when scanning code later. (support.microsoft.com)
- const string subValue = "VulnerableChannelAllowList"; + const string subValue = "VulnerableChannelAllowList"; // GPO: "Domain controller: Allow vulnerable Netlogon secure channel connections"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
src/CommonLib/OutputTypes/APIResults/StrRegistryAPIResult.cs(1 hunks)src/CommonLib/OutputTypes/Computer.cs(1 hunks)src/CommonLib/Processors/DCRegistryProcessor.cs(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/CommonLib/Processors/DCRegistryProcessor.cs (2)
src/CommonLib/OutputTypes/APIResults/StrRegistryAPIResult.cs (1)
StrRegistryAPIResult(3-6)src/CommonLib/Helpers.cs (1)
Helpers(17-343)
src/CommonLib/OutputTypes/Computer.cs (1)
src/CommonLib/OutputTypes/APIResults/StrRegistryAPIResult.cs (1)
StrRegistryAPIResult(3-6)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (1)
src/CommonLib/Processors/DCRegistryProcessor.cs (1)
85-114: LGTM: Reads Netlogon allow-list SDDL safely and follows existing patternsName, path, and behavior match Microsoft guidance and prior methods; null returns are handled. (support.microsoft.com, learn.microsoft.com)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/CommonLib/OutputTypes/APIResults/StrRegistryAPIResult.cs(1 hunks)src/CommonLib/OutputTypes/Computer.cs(1 hunks)src/CommonLib/Processors/DCRegistryProcessor.cs(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- src/CommonLib/OutputTypes/Computer.cs
- src/CommonLib/OutputTypes/APIResults/StrRegistryAPIResult.cs
🧰 Additional context used
🧬 Code graph analysis (1)
src/CommonLib/Processors/DCRegistryProcessor.cs (2)
src/CommonLib/OutputTypes/APIResults/StrRegistryAPIResult.cs (1)
StrRegistryAPIResult(3-6)src/CommonLib/Helpers.cs (1)
Helpers(17-343)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
Description
Collect the registry key that holds the security descriptor that determines who can perform the vulnerable version of netlogon
Motivation and Context
Ticket: BED-6429
How Has This Been Tested?
Locally in GOAD lab.
Screenshots (if appropriate):
From corresponding BloodHound PR:

Types of changes
Checklist:
Summary by CodeRabbit