Graylog2 / Graylog2/graylog2-server

Graylog4 - valid ldap filter does not work

Open
#9,818 3 comments 0 reactions 0 assignees View on GitHub
bug triaged
Dominant language
Java
Stars
8.1k
Forks
1.1k
Avg merge
1d 20h
Merged PRs (30d)
217

Description

## Expected Behavior
User search in Authentication Service should work with defined filter, and find the user based on the filter.

## Current Behavior
Fails with

```
There was an error
cannot POST https://log.uniscomp.cz/api/system/authentication/services/test/backend/login (400)
{"errors":{"user_search_pattern":["User search pattern cannot be parsed. It must be a valid LDAP filter."]},"error_context":{},"failed":true}

```

## Possible Solution

## Steps to Reproduce (for bugs)

Use search pattern:

```
(&(objectCategory=person)(objectClass=user)(|(mail=*@acme1.cz)(mail=*@acme2.cz))(!(memberOf=CN=some_name,OU=System,OU=Groups,OU=acme1,DC=AD,DC=acme1,DC=CZ)) (!(userAccountControl:1.2.840.113556.1.4.803:=2))(|(mail={0})(sAMAccountName={0})(userPrincipalName={0})(cn={0})(mail={0}@acme1.cz)))
```

1. Create authentication service
2. in User Synchronization define Search Pattern as ldap filter above

## Context

I have just upgraded from 3.x-> 4.0.1 and the connection to our LDAP stopped working and no user can login. After investigating, I found out, that the LDAP filter is not used correctly by graylog and fails with error above.

The filter works fine in ldapsearch, apache directory studio and also was used in version 3.x with no issues.

## Your Environment

* Graylog Version: graylog-server-4.0.1-1.noarch
* Java Version: openjdk version "1.8.0_272"
* Elasticsearch Version:
* MongoDB Version:
* Operating System: CentOS Linux release 7.9.2009 (Core)
* Browser version:

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.