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

x-pack/filebeat/input/entityanalytics/provider/internal/activedirectory: relax base DN constraint #40054

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ https:/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
- Add Jamf entity analytics provider. {pull}39996[39996]
- Add ability to remove request trace logs from http_endpoint input. {pull}40005[40005]
- Add ability to remove request trace logs from entityanalytics input. {pull}40004[40004]
- Relax constraint on Base DN in entity analytics Active Directory provider. {pull}40054[40054]

*Auditbeat*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
ErrUsers = errors.New("failed to get user details")
)

var cnUsers = &ldap.RelativeDN{Attributes: []*ldap.AttributeTypeAndValue{{Type: "CN", Value: "Users"}}}

// Entry is an Active Directory user entry with associated group membership.
type Entry struct {
ID string `json:"id"`
Expand All @@ -45,10 +43,6 @@
if base == nil || len(base.RDNs) == 0 {
return nil, fmt.Errorf("%w: no path", ErrInvalidDistinguishedName)
}
baseDN := base.String()
if !base.RDNs[0].Equal(cnUsers) {
return nil, fmt.Errorf("%w: %s does not have %s", ErrInvalidDistinguishedName, baseDN, cnUsers)
}

var opts []ldap.DialOpt
if dialer != nil {
Expand All @@ -66,7 +60,7 @@
if err != nil {
return nil, err
}
defer conn.Unbind()

Check failure on line 63 in x-pack/filebeat/input/entityanalytics/provider/activedirectory/internal/activedirectory/activedirectory.go

View workflow job for this annotation

GitHub Actions / lint (windows)

Error return value of `conn.Unbind` is not checked (errcheck)

var errs []error

Expand All @@ -77,6 +71,8 @@
sinceFmtd = since.Format(denseTimeLayout)
}

baseDN := base.String()

// Get groups in the directory. Get all groups independent of the
// since parameter as they may not have changed for changed users.
var groups directory
Expand Down
Loading