Skip to content
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 Domain to types.Host #212

Open
andrewkroh opened this issue Mar 25, 2024 · 2 comments
Open

Add Domain to types.Host #212

andrewkroh opened this issue Mar 25, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@andrewkroh
Copy link
Member

andrewkroh commented Mar 25, 2024

Add a Domain Field to the types.Host struct. For Windows this should be populated with the host's Active Directory (AD) or Entra ID domain name. This value should satisfy the definition of the host.domain field in ECS.

Windows registry data sources

  • For Active Directory - HKLM:SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Group Policy\\State\\Machine and read Distinguished-Name
    • This is the distinguished name (DN) of the Active Directory that the local computer is associated with for the purposes of Group Policy. It typically follows a format like CN=ComputerName,OU=Computers,DC=domain,DC=com. I think we would join together the DC components to form the domain name.
  • For Entra ID - HKLM:SYSTEM\\CurrentControlSet\\Control\\CloudDomainJoin\\JoinInfo\\
    • Iff JoinInfo contains one entry then get the UserEmail value from within that entry and then parse the domain from the email address. If JoinInfo contains more than one entry then the computer is joined to more than one domain so do nothing.

References

@andrewkroh andrewkroh added the enhancement New feature or request label Mar 25, 2024
@jrmolin
Copy link

jrmolin commented Mar 26, 2024

Is that Iff an If-and-only-if or just a mistype? From context, it looks like if-and-only-if. I love seeing the maths in here!

@andrewkroh
Copy link
Member Author

That's the problem with iff outside of math/logic contexts, you never know if it is intentional or a typo 😆 . I did lazily mean if and only if. I probably should have written "if JoinInfo contains exactly one subkey then read the UserEmail value from that subkey...".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants