OpenLDAP
Overview
OpenLDAP (Lightweight Directory Access Protocol) is an open-source implementation of a directory service protocol. It helps organizations to maintain and manage a centralized directory of user information, such as names, addresses, and other attributes.
Related Built-in Rules
Benefit from SEKOIA.IO built-in rules and upgrade OpenLDAP [BETA] with the following detection capabilities out-of-the-box.
SEKOIA.IO x OpenLDAP [BETA] on ATT&CK Navigator
RYUK Ransomeware - martinstevens Username
Detects user name "martinstevens". Wizard Spider is used to add the user name "martinstevens" to the AD of its victims. It was observed in several campaigns; in 2019 and 2020.
- Effort: elementary
SEKOIA.IO Intelligence Feed
Detect threats based on indicators of compromise (IOCs) collected by SEKOIA's Threat and Detection Research team.
- Effort: elementary
Event Categories
The following table lists the data source offered by this integration.
Data Source | Description |
---|---|
Web logs |
OpenLDAP provide information like the connected client, the requested resource, the user agent or the response status. |
In details, the following table denotes the type of events produced by this integration.
Name | Values |
---|---|
Kind | event |
Category | authentication , configuration , network |
Type | change , connection , end , info , start |
Event Samples
Find below few samples of events and how they are normalized by Sekoia.io.
{
"message": "conn=11 fd=31 ACCEPT from IP=1.2.3.4:45181 (IP=5.6.7.8:389)",
"event": {
"kind": "event",
"category": [
"network"
],
"type": [
"connection",
"info"
],
"action": "accept"
},
"source": {
"port": 45181,
"ip": "1.2.3.4",
"address": "1.2.3.4"
},
"destination": {
"port": 389,
"ip": "5.6.7.8",
"address": "5.6.7.8"
},
"related": {
"ip": [
"1.2.3.4",
"5.6.7.8"
]
}
}
{
"message": "conn=11 op=1 BIND dn=\"uid=user1,ou=people,dc=example,dc=com\" method=128",
"event": {
"kind": "event",
"category": [
"authentication"
],
"type": [
"start"
],
"action": "bind"
},
"user": {
"name": "user1",
"domain": "people.example.com"
},
"related": {
"user": [
"user1"
]
}
}
{
"message": "conn=11 op=1 BIND dn=\"uid=user1,ou=People,dc=example,dc=com\" mech=SIMPLE ssf=0",
"event": {
"kind": "event",
"category": [
"authentication"
],
"type": [
"start"
],
"action": "bind"
},
"user": {
"name": "user1",
"domain": "People.example.com"
},
"related": {
"user": [
"user1"
]
}
}
{
"message": "conn=11 op=0 STARTTLS",
"event": {
"kind": "event",
"category": [
"network"
],
"type": [
"info"
],
"action": "starttls"
}
}
{
"message": "conn=11 op=0 RESULT oid= err=0 text=",
"event": {
"kind": "event",
"category": [
"network"
],
"type": [
"info"
],
"action": "result"
}
}
{
"message": "conn=11 fd=31 TLS established tls_ssf=256 ssf=256",
"event": {
"kind": "event",
"category": [
"network"
],
"type": [
"info"
],
"action": "tls"
}
}
{
"message": "conn=11 op=1 RESULT tag=97 err=0 text=",
"event": {
"kind": "event",
"category": [
"network"
],
"type": [
"info"
],
"action": "result"
}
}
{
"message": "conn=11 op=3 UNBIND",
"event": {
"kind": "event",
"category": [
"authentication"
],
"type": [
"end"
],
"action": "unbind"
}
}
{
"message": "conn=11 fd=31 closed",
"event": {
"kind": "event",
"category": [
"network"
],
"type": [
"info"
],
"action": "closed"
}
}
{
"message": "conn=11 op=2 MOD dn=\"uid=user1,ou=People,dc=example,dc=com\"",
"event": {
"kind": "event",
"category": [
"configuration"
],
"type": [
"change"
],
"action": "mod"
},
"user": {
"name": "user1",
"domain": "People.example.com"
},
"related": {
"user": [
"user1"
]
}
}
{
"message": "conn=11 op=2 MOD attr=mail",
"event": {
"kind": "event",
"category": [
"configuration"
],
"type": [
"change"
],
"action": "mod"
},
"openldap": {
"attribute": "mail"
}
}
{
"message": "\" conn=6521 op=3 SRCH base=\"\"ou=people,ou=IN,o=example\"\" scope=2 deref=0 filter=\"\"(&(exampleRole=example_admin)(uid=mhs))\"\"\"",
"event": {
"kind": "event",
"category": [
"network"
],
"type": [
"info"
],
"action": "srch"
},
"user": {
"domain": "people.IN.example"
}
}
{
"message": "conn=6521 op=3 SRCH attr=uid cn",
"event": {
"kind": "event",
"category": [
"network"
],
"type": [
"info"
],
"action": "srch"
},
"openldap": {
"attribute": "uid cn"
}
}
{
"message": " conn=6521 op=2 SRCH attr=examplerole",
"event": {
"kind": "event",
"category": [
"network"
],
"type": [
"info"
],
"action": "srch"
},
"openldap": {
"attribute": "examplerole"
}
}
{
"message": "\" conn=6521 op=2 SRCH base=\"\"o=example\"\" scope=2 deref=0 filter=\"\"(uid=mhs)\"\"\"",
"event": {
"kind": "event",
"category": [
"network"
],
"type": [
"info"
],
"action": "srch"
},
"user": {
"domain": "example"
}
}
{
"message": " conn=6521 op=1 SRCH attr=mail telephonenumber cn uid l givenname sn title department",
"event": {
"kind": "event",
"category": [
"network"
],
"type": [
"info"
],
"action": "srch"
},
"openldap": {
"attribute": "mail telephonenumber cn uid l givenname sn title department"
}
}
Extracted Fields
The following table lists the fields that are extracted, normalized under the ECS format, analyzed and indexed by the parser. It should be noted that infered fields are not listed.
Name | Type | Description |
---|---|---|
destination.ip |
ip |
IP address of the destination. |
destination.port |
long |
Port of the destination. |
event.action |
keyword |
The action captured by the event. |
event.category |
keyword |
Event category. The second categorization field in the hierarchy. |
event.kind |
keyword |
The kind of the event. The highest categorization field in the hierarchy. |
event.type |
keyword |
Event type. The third categorization field in the hierarchy. |
openldap.attribute |
keyword |
OpenLDAP attribute |
source.ip |
ip |
IP address of the source. |
source.port |
long |
Port of the source. |
user.domain |
keyword |
Name of the directory the user is a member of. |
user.name |
keyword |
Short name or login of the user. |
Configure
As of now, the main solution to collect OpenLDAP logs leverages the Rsyslog recipe. Please share your experiences with other recipes by editing this documentation.
Collect the logs
Below is a couple of suggestions you can follow to configure your system to collect openLDAP logs with rsyslog:
- Local
slapd.conf
orslapd.d/cn=config.ldif
and modify loglvl setting there. For example:loglevel 256
- Modify your
rsyslog.conf
or/etc/rsyslog.d/*.conf
to specify log destination. For example:local4.* /var/log/openldap.log
- Restart
rsyslog
services. For example:sudo systemctl restart slapd sudo systemctl restart rsyslog
- Check that logs are being written to the destination file. For example:
tail -f /var/log/openldap.log
Forward logs to SEKOIA.IO
Please consult the Rsyslog Transport documentation to forward these logs to Sekoia.io.