Skip to content

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.

The following Sekoia.io built-in rules match the intake OpenLDAP. This documentation is updated automatically and is based solely on the fields used by the intake which are checked against our rules. This means that some rules will be listed but might not be relevant with the intake.

SEKOIA.IO x OpenLDAP on ATT&CK Navigator

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": {
        "action": "accept",
        "category": [
            "network"
        ],
        "kind": "event",
        "type": [
            "connection",
            "info"
        ]
    },
    "destination": {
        "address": "5.6.7.8",
        "ip": "5.6.7.8",
        "port": 389
    },
    "related": {
        "ip": [
            "1.2.3.4",
            "5.6.7.8"
        ]
    },
    "source": {
        "address": "1.2.3.4",
        "ip": "1.2.3.4",
        "port": 45181
    }
}
{
    "message": "conn=11 op=1 BIND dn=\"uid=user1,ou=people,dc=example,dc=com\" method=128",
    "event": {
        "action": "bind",
        "category": [
            "authentication"
        ],
        "kind": "event",
        "type": [
            "start"
        ]
    },
    "related": {
        "user": [
            "user1"
        ]
    },
    "user": {
        "domain": "people.example.com",
        "name": "user1"
    }
}
{
    "message": "conn=11 op=1 BIND dn=\"uid=user1,ou=People,dc=example,dc=com\" mech=SIMPLE ssf=0",
    "event": {
        "action": "bind",
        "category": [
            "authentication"
        ],
        "kind": "event",
        "type": [
            "start"
        ]
    },
    "related": {
        "user": [
            "user1"
        ]
    },
    "user": {
        "domain": "People.example.com",
        "name": "user1"
    }
}
{
    "message": "conn=11 op=0 STARTTLS",
    "event": {
        "action": "starttls",
        "category": [
            "network"
        ],
        "kind": "event",
        "type": [
            "info"
        ]
    }
}
{
    "message": "conn=11 op=0 RESULT oid= err=0 text=",
    "event": {
        "action": "result",
        "category": [
            "network"
        ],
        "kind": "event",
        "type": [
            "info"
        ]
    }
}
{
    "message": "conn=11 fd=31 TLS established tls_ssf=256 ssf=256",
    "event": {
        "action": "tls",
        "category": [
            "network"
        ],
        "kind": "event",
        "type": [
            "info"
        ]
    }
}
{
    "message": "conn=11 op=1 RESULT tag=97 err=0 text=",
    "event": {
        "action": "result",
        "category": [
            "network"
        ],
        "kind": "event",
        "type": [
            "info"
        ]
    }
}
{
    "message": "conn=11 op=3 UNBIND",
    "event": {
        "action": "unbind",
        "category": [
            "authentication"
        ],
        "kind": "event",
        "type": [
            "end"
        ]
    }
}
{
    "message": "conn=11 fd=31 closed",
    "event": {
        "action": "closed",
        "category": [
            "network"
        ],
        "kind": "event",
        "type": [
            "info"
        ]
    }
}
{
    "message": "conn=11 op=2 MOD dn=\"uid=user1,ou=People,dc=example,dc=com\"",
    "event": {
        "action": "mod",
        "category": [
            "configuration"
        ],
        "kind": "event",
        "type": [
            "change"
        ]
    },
    "related": {
        "user": [
            "user1"
        ]
    },
    "user": {
        "domain": "People.example.com",
        "name": "user1"
    }
}
{
    "message": "conn=11 op=2 MOD attr=mail",
    "event": {
        "action": "mod",
        "category": [
            "configuration"
        ],
        "kind": "event",
        "type": [
            "change"
        ]
    },
    "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": {
        "action": "srch",
        "category": [
            "network"
        ],
        "kind": "event",
        "type": [
            "info"
        ]
    },
    "user": {
        "domain": "people.IN.example"
    }
}
{
    "message": "conn=6521 op=3 SRCH attr=uid cn",
    "event": {
        "action": "srch",
        "category": [
            "network"
        ],
        "kind": "event",
        "type": [
            "info"
        ]
    },
    "openldap": {
        "attribute": "uid cn"
    }
}
{
    "message": " conn=6521 op=2 SRCH attr=examplerole",
    "event": {
        "action": "srch",
        "category": [
            "network"
        ],
        "kind": "event",
        "type": [
            "info"
        ]
    },
    "openldap": {
        "attribute": "examplerole"
    }
}
{
    "message": "\" conn=6521 op=2 SRCH base=\"\"o=example\"\" scope=2 deref=0 filter=\"\"(uid=mhs)\"\"\"",
    "event": {
        "action": "srch",
        "category": [
            "network"
        ],
        "kind": "event",
        "type": [
            "info"
        ]
    },
    "user": {
        "domain": "example"
    }
}
{
    "message": " conn=6521 op=1 SRCH attr=mail telephonenumber cn uid l givenname sn title department",
    "event": {
        "action": "srch",
        "category": [
            "network"
        ],
        "kind": "event",
        "type": [
            "info"
        ]
    },
    "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:

  1. Local slapd.conf or slapd.d/cn=config.ldif and modify loglvl setting there. For example:
    loglevel 256
    
  2. Modify your rsyslog.conf or /etc/rsyslog.d/*.conf to specify log destination. For example:
    local4.* /var/log/openldap.log
    
  3. Restart rsyslog services. For example:
    sudo systemctl restart slapd
    sudo systemctl restart rsyslog
    
  4. 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.

Further Readings