Repository navigation
Replies: 2 comments
I would love it if we could consolidate, cross-platform support here is a desire, but would like to understand better if it is able to be shipped standalone or if there are outside dependencies.
With an additional documentation page explaining this and the mapping back I don't have any concerns.
I would lean on @merill here, I know my minimal maturity in this area has given us lessons learned on what not to do, but not sure I have a good answer. Overall, I love this addition @agnivesh, tons of stuff planned once we get the core private functions more stable too that can let even more concepts like this come forward like DISA STIGs. I would also defer to @merill though if this is a good candidate for Maester Packs, though I could see it from both sides. |
|
@soulemike Yes, they can ship on their own. The parsers are six plain PS files. They only call each other and a few core .NET types (BitConverter, Guid, List), I've run them on Ubuntu and on Windows with PowerShell 7. The code is in powershell/internal/services/ad/protocol/.
If you want to try it, you can find it on the branch: https://github.com/agnivesh/maester/tree/feat/ad-anssi-checks-3.0 For the checks themselves, the test ID to target is AD-ANSSI-*. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi, I've ported 76 Active Directory checks from ANSSI's AD checklist (CERT-FR) to the 3.0 native format, and I'd like to send them as small PRs. It is a benchmark suite for AD, similar to what the CIS and ORCA suites are for Microsoft 365 on the data Maester's AD collector already gathers. I've attached the reports from my runs against GOAD lab (a forest root, a child domain and a second forest) so you can see the output.
How it fits with the existing code
Get-MtADDomainState. No check talks to LDAP itself. I re-checked this on current main after Fix/ad issues 2282 2322 2323 2324 v3 #2391: the guarded collectors are still there,every category my checks request is still valid, and the ActiveDirectoryOptIn test passes. Since a failed read now leaves a collection
$null, I added a guard so that 13 checks skipinstead of passing on an empty list.
Get-MtLdapComputer,Get-MtLdapDomain,Get-MtLdapGroup,Get-MtLdapUser), only by adding attributes and properties at the end. Where the current collectors don't fetch what ANSSI asks about, I added 13 small read-only files: seven inqueries/(DNS zones, object owner and security descriptor, CA certificates, display specifiers, forest domain count, member-of conversion) and six byte-level parsers inprotocol/(security descriptors, ACEs, SIDs). They reuse the connection from the AD state (New-MtAdProtocolConnection) and cache their results per session.ConvertFrom-MtLdapSecurityDescriptordoes a similar job but returns$nulloff Windows, because it uses the .NET ACL classes. My parsers work on any OS, which I needed for a Linux runner. If you'd rather I fold them into that function, I'm happy to.IDs
The tests are
AD-ANSSI-001toAD-ANSSI-076, to follow the existingAD-<family>-<nn>pattern. ANSSI doesn't number its findings (it uses names such asvuln_adcs_control), so the numbers are mine: grade 1 findings first, then by name. Each test page links to its ANSSI finding. IsAD-ANSSI-fine, or would you prefer a different prefix?Placement of the helpers
About 100 helper files only classify data (for example "is this ACE dangerous?"). Two tests disagree about where they can live:
ActiveDirectoryOptIn.Tests.ps1("Routes every public AD test command through a guarded collector...") scans every*.ps1underpowershell/internal/checks/ad/and fails a file unless it callsGet-MtADDomainState,Get-MtADDaclsorGet-MtADGpoState, directly or through another helper.RepositoryLayout.Tests.ps1("mirrors the test suites in internal/checks") requires every folder underinternal/checks/to be an existing suite. By the layout rule these helpers belong underinternal/checks/ad/, and there the opt-in test fails them because they read no data. For now they sit inpowershell/internal/services/ad/anssi/, which passes both tests but is described as shared data access.Which would you prefer?
internal/checks/ad/.internal/services/ad/<name>/the place for pure helpers.Also a two small notes, only if useful
Severityattribute wins overAdd-MtTestResultDetail -Severity(the order is inInvoke-MtNativePlan.ps1), so a check that reports findings at several levels shows its attribute severity in the headline. A sentence in the writing-tests docs would help authors.NativeTestLintrejects a catch-all that only reports-SkippedBecause Error. A short migration note would help for tests that used it as a fail-closed skip.Attachments: the HTML reports from my latest run against each domain controller (kingslanding.sevenkingdoms.local, winterfell.north.sevenkingdoms.local and meereen.essos.local).
kingslanding.sevenkingdoms.local
meereen.essos.local
winterfell.north.sevenkingdoms.local
All reactions