Conversation
| for gpo in self.ntds.group_policies(): | ||
| yield NtdsGPORecord( | ||
| cn=gpo.cn, | ||
| distinguished_name=gpo.distinguishedName, |
There was a problem hiding this comment.
Could you use either the "typed"/"defined" properties for these attributes on the objects' class, or the .get method for the attributes that don't yet have a property defined on their Python classes?
There was a problem hiding this comment.
So you mean defining them as property in dissect.database or using .get. Currently there are no properties defined, but we could add them. I can do both, what would be the prefered method, as I see computer/user is using a mix of those two options.
There was a problem hiding this comment.
Some of these exist in the base Object class already:
The intention is to have most of the attributes added as Python properties over time in their classes, but for some it's fine to just use .get() for now. If you're willing to add the proper attributes to the proper classes, that's of course appreciated!
My point is more, while "magic attributes" exist on these objects (e.g. doing .whenCreated works), I'd prefer to use properly typed/available properties and methods in library code, such as .when_created or .get("whenCreated"). The magic attributes are more nice for interactive use.
There was a problem hiding this comment.
Okay that makes sense. I created a PR to add 2 more fields within dissect.database, than all needed attributes of GPO are actually there.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1559 +/- ##
=======================================
Coverage 80.99% 81.00%
=======================================
Files 399 399
Lines 34848 34853 +5
=======================================
+ Hits 28226 28231 +5
Misses 6622 6622
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Merging this PR will not alter performance
Comparing Footnotes
|
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
This PR adds a method that exports all Group Policies which can be fetched from the NTDS.
We might have to consider how this relates to adpolicy plugin. They are kinda related, but depend on completly different artifacts.
Depends on fox-it/dissect.database#38
Depends on: fox-it/dissect.database#41