-
Notifications
You must be signed in to change notification settings - Fork 52
chore: add propertynames enum #234
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
base: v4
Are you sure you want to change the base?
Conversation
per Rohan
WalkthroughA new static class, Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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 (2)
src/CommonLib/Enums/PropertyNames.cs (2)
1-3
: Emit the standard<auto-generated/>
header andGeneratedCode
attributeMany analyzers (StyleCop / Roslyn) automatically skip files that contain the
// <auto-generated/>
marker or are decorated with
[System.CodeDom.Compiler.GeneratedCode]
, preventing style / documentation
warnings on generated sources.
Adding them costs nothing and keeps future CI noise down.-// Code generated by Cuelang code gen. DO NOT EDIT! -// Cuelang source: github.com/specterops/bloodhound/-/tree/main/packages/cue/schemas/ +// <auto-generated/> +// Code generated by Cuelang code gen. DO NOT EDIT! +// Cuelang source: github.com/specterops/bloodhound/-/tree/main/packages/cue/schemas/ + +using System.CodeDom.Compiler; ... -namespace SharpHoundCommon.Enums { -public static class PropertyNames { +namespace SharpHoundCommon.Enums { +[GeneratedCode("cuelang-codegen", "1.0.0")] +public static class PropertyNames {
4-160
: Const vsstatic readonly
– consider binary-compat riskAll fields are declared
const
. Becauseconst
values are inlined at compile
time, any external assembly that references, say,
PropertyNames.SubjectAltRequireUPN
will embed the literal
"subjectaltrequireupn"
in its own IL. If the cUE schema ever changes and this
constant string is updated, every downstream assembly must be re-compiled or it
will silently keep the outdated literal.If the generated class is consumed solely inside the same solution this may be
a non-issue, but for a public package it is safer to use:public static readonly string SubjectAltRequireUPN = "subjectaltrequireupn";You still get inlining by the JIT but avoid cross-assembly versioning pitfalls.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/CommonLib/Enums/PropertyNames.cs
(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: MikeX777
PR: SpecterOps/SharpHoundCommon#223
File: src/CommonLib/OutputTypes/Group.cs:8-8
Timestamp: 2025-07-10T20:04:21.305Z
Learning: In SharpHoundCommonLib, there are two distinct types of classes with different naming patterns:
1. OutputTypes classes (Group, User, Computer) that inherit from OutputBase use "HasSIDHistory" property naming
2. Property classes (GroupProperties, UserProperties, ComputerProperties) used in processors use "SidHistory" property naming
These should not be compared for naming consistency as they serve different purposes.
📚 Learning: in sharphoundcommonlib, there are two distinct types of classes with different naming patterns: 1. o...
Learnt from: MikeX777
PR: SpecterOps/SharpHoundCommon#223
File: src/CommonLib/OutputTypes/Group.cs:8-8
Timestamp: 2025-07-10T20:04:21.305Z
Learning: In SharpHoundCommonLib, there are two distinct types of classes with different naming patterns:
1. OutputTypes classes (Group, User, Computer) that inherit from OutputBase use "HasSIDHistory" property naming
2. Property classes (GroupProperties, UserProperties, ComputerProperties) used in processors use "SidHistory" property naming
These should not be compared for naming consistency as they serve different purposes.
Applied to files:
src/CommonLib/Enums/PropertyNames.cs
📚 Learning: the schemaidguid for the altsecurityidentities attribute in active directory is 00fbf30c-91fe-11d1-a...
Learnt from: JonasBK
PR: SpecterOps/SharpHoundCommon#221
File: src/CommonLib/Processors/ACEGuids.cs:17-18
Timestamp: 2025-07-08T11:07:35.680Z
Learning: The schemaIDGUID for the altSecurityIdentities attribute in Active Directory is 00fbf30c-91fe-11d1-aebc-0000f80367c1, as confirmed by Microsoft documentation.
Applied to files:
src/CommonLib/Enums/PropertyNames.cs
🧬 Code Graph Analysis (1)
src/CommonLib/Enums/PropertyNames.cs (3)
src/CommonLib/SecurityDescriptor.cs (1)
IsInherited
(30-33)src/CommonLib/DirectoryObjects/DirectoryObjectExtensions.cs (2)
IsDeleted
(50-56)HasLAPS
(58-70)src/CommonLib/Processors/DomainTrustProcessor.cs (1)
TrustType
(115-130)
⏰ 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/Enums/PropertyNames.cs (1)
76-78
: Confirm CUE Schema Spelling for SubjectAltRequireDomainDNSWe’ve verified that the code and tests consistently use the key
"subjectaltrequiredomaindns"
(missing the extra “d” after “require”):
- src/CommonLib/Enums/PropertyNames.cs
- src/CommonLib/Processors/LdapPropertyProcessor.cs
- test/unit/LdapPropertyTests.cs (line 819)
Before renaming this to
"subjectaltrequireddomaindns"
, please cross-check the CUE schema to ensure that clients expect the same spelling. If the schema defines the key with two “d”s, update the constant, the processor call, and the unit test to match. Otherwise, no change is needed here.
Description
Add PropertyNames enum which is generated from cue as /packages/csharp/graphschema/PropertyNames.cs
Motivation and Context
per Rohan
How Has This Been Tested?
Ran dotnet tests, built SHC, used that to build SHFOSS, collected with SHFoss and ingested into BHE. All function properly.
Screenshots (if appropriate):
Types of changes
Checklist:
Summary by CodeRabbit