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

feat(windowsadinvreceiver): Adding the Windows Active Directory inventory receiver to the collector #1273

Merged
merged 10 commits into from
Nov 3, 2023

Conversation

rnishtala-sumo
Copy link
Contributor

@rnishtala-sumo rnishtala-sumo commented Oct 5, 2023

The Windows Active Directory Inventory receiver collects inventory data from Active Directory. This includes information such as computer names, user names, email addresses, and location information

Uses this library to query data from windows ADSI
https://pkg.go.dev/github.com/go-adsi/adsi

Example configuration (consistent with AD attributes in IC)

receivers:
  activedirectoryinv:
    base_dn: "CN=Guest,CN=Users,DC=exampledomain,DC=com"
    attributes: [name, mail, department, manager, memberOf]
    poll_interval: 10h

Example output

2023-10-13T15:16:08.161Z        info    ResourceLog #0
Resource SchemaURL:
ScopeLogs #0
ScopeLogs SchemaURL:
InstrumentationScope
LogRecord #0
ObservedTimestamp: 2023-10-20 18:09:26.2811961 +0000 UTC
Timestamp: 2023-10-20 18:09:26.2811961 +0000 UTC
SeverityText:
SeverityNumber: Unspecified(0)
Body:  Str({"memberOf":["CN=Guests,CN=Builtin,DC=exampledomain,DC=com"],"name":["Guest"]})

The body of the above log records contain data from the Windows AD server.

@github-actions github-actions bot added documentation Improvements or additions to documentation go labels Oct 5, 2023
@rnishtala-sumo rnishtala-sumo changed the title WIP(windowsadinvreceiver): Adding the windowsadinvreceiver to the collector WIP(windowsadinvreceiver): Adding the Windows Active Directory inventory receiver to the collector Oct 5, 2023
@rnishtala-sumo rnishtala-sumo force-pushed the windows-ad-inventory branch 2 times, most recently from ac7b2cb to bbe5c4b Compare October 13, 2023 20:35
@rnishtala-sumo rnishtala-sumo removed the documentation Improvements or additions to documentation label Oct 19, 2023
@rnishtala-sumo rnishtala-sumo self-assigned this Oct 19, 2023
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Oct 20, 2023
@rnishtala-sumo rnishtala-sumo force-pushed the windows-ad-inventory branch 4 times, most recently from 51dae29 to 7071235 Compare October 20, 2023 18:09
@rnishtala-sumo rnishtala-sumo marked this pull request as ready for review October 20, 2023 18:10
@rnishtala-sumo rnishtala-sumo requested a review from a team as a code owner October 20, 2023 18:10
@rnishtala-sumo rnishtala-sumo force-pushed the windows-ad-inventory branch 2 times, most recently from 166670b to c8fa535 Compare October 20, 2023 18:23
@rnishtala-sumo rnishtala-sumo force-pushed the windows-ad-inventory branch 2 times, most recently from 8513199 to a154fe1 Compare October 23, 2023 21:38
@rnishtala-sumo rnishtala-sumo changed the title WIP(windowsadinvreceiver): Adding the Windows Active Directory inventory receiver to the collector feat(windowsadinvreceiver): Adding the Windows Active Directory inventory receiver to the collector Oct 24, 2023
@rnishtala-sumo rnishtala-sumo force-pushed the windows-ad-inventory branch 2 times, most recently from 67e7835 to 1392413 Compare October 24, 2023 15:51
@rnishtala-sumo rnishtala-sumo force-pushed the windows-ad-inventory branch 2 times, most recently from 246194d to 33429dc Compare October 24, 2023 18:13
CHANGELOG.md Outdated Show resolved Hide resolved
pkg/receiver/activedirectoryinvreceiver/README.md Outdated Show resolved Hide resolved
pkg/receiver/activedirectoryinvreceiver/factory.go Outdated Show resolved Hide resolved
pkg/receiver/activedirectoryinvreceiver/config.go Outdated Show resolved Hide resolved
@rnishtala-sumo rnishtala-sumo force-pushed the windows-ad-inventory branch 3 times, most recently from 04583a4 to ccf543c Compare October 25, 2023 19:43
@rnishtala-sumo
Copy link
Contributor Author

rnishtala-sumo commented Oct 25, 2023

@astencel-sumo this last commit has the changes for the changelog, receiver name and the poll interval type. It also has the validation change for an empty DN.

@rnishtala-sumo
Copy link
Contributor Author

@astencel-sumo I think everything that we've discussed so far has been covered. I've also validated the format of the logs with the installed collector. Its just a json log.

@rnishtala-sumo rnishtala-sumo requested review from andrzej-stencel and a team October 30, 2023 16:18
Copy link
Contributor

@andrzej-stencel andrzej-stencel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank Raj, I'm approving this request, although I would like to see two more very minor changes.

  1. The README should make it clear that the base_dn configuration property is required.
  2. (related) When user does not pass a non-empty value for the base_dn property, the error message should be more descriptive:
    • the error message should mention the configuration property name base_dn
    • ideally the error message would say bo more specifc, saying explicitly "base_dn is required" instead of generic "Invalid value of base_dn".

@rnishtala-sumo rnishtala-sumo merged commit 39a3db7 into main Nov 3, 2023
27 checks passed
@rnishtala-sumo rnishtala-sumo deleted the windows-ad-inventory branch November 3, 2023 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation go
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants