Git Product home page Git Product logo

ldap-search-api's Introduction

CircleCI Version Coverage Status Quality Gate Docker Pulls Lines of Code Docker Image Size

ldap-search-api

Simple REST API to query a LDAP server

Usage

Sample command

docker run --rm \
  -p 8080:8080 \
  -e LDAP_HOST=ldaps://ldap.jumpcloud.com:636 \
  -e LDAP_USERNAME=devatherock \
  -e LDAP_PASSWORD=dummy \
  devatherock/ldap-search-api:latest

Configurable properties

Environment Variable Name YAML Variable Name Required Default Description
LDAP_HOST ldap.host true (None) The full host name of the LDAP server. Example: ldaps://ldap.jumpcloud.com:636
LDAP_USERNAME ldap.username true (None) The LDAP bind username. Could be a simple username like devatherock or a DN like uid=devatherock,ou=Users,dc=jumpcloud,dc=com depending on how the LDAP server is configured
LDAP_PASSWORD ldap.password true (None) The LDAP bind password
LDAP_BASE_DN ldap.base-dn false (None) The default base DN to search against
LDAP_BINARY_ATTRIBUTES ldap.binary-attributes false (None) Attributes in the search result that have binary values
LDAP_READ_TIMEOUT_MILLIS ldap.read-timeout-millis false 10000 Read timeout for the search, in milliseconds. Defaults to 10 seconds
LDAP_CONNECTION_POOL_ENABLED ldap.connection-pool.enabled false true Indicates if a connection pool should be used
LDAP_CONNECTION_POOL_CORE_SIZE ldap.connection-pool.core-size false 8 Initial size of the connection pool
LDAP_CONNECTION_POOL_MAX_SIZE ldap.connection-pool.max-size false 8 Maximum size of the connection pool
LDAP_CONNECTION_POOL_TIME_TO_LIVE_MILLIS ldap.connection-pool.timeToLiveMillis false 1,800,000 The total time a connection in the pool will be kept open, in milliseconds. Defaults to 30 minutes
LOGGER_LEVELS_ROOT (None) false INFO SLF4J log level, for all(framework and custom) code
LOGGER_LEVELS_IO_GITHUB_DEVATHEROCK (None) false INFO SLF4J log level, for custom code
MICRONAUT_SERVER_PORT micronaut.server.port false 8080 Port in which the app listens on
MICRONAUT_CONFIG_FILES (None) false (None) Path to YAML config files. The YAML files can be used to specify complex, object and array properties
JACKSON_SERIALIZATION_INDENT_OUTPUT jackson.serialization.indent-output false (None) Set to true to enable JSON pretty-print of response
LOGBACK_CONFIGURATION_FILE (None) false (None) Path to logback configuration file

API spec

When the app is running, detailed API documentation can be accessed at {host}/swagger-ui or {host}/swagger/ldap-search-api-{version}.yml. The available endpoints are listed below for reference:

  • /search?filter=<an ldap query>&limit=<number of results> - Searches LDAP under the given base DN with the supplied filter criteria

Sample response

[
    {
        "loginShell": "/bin/bash",
        "uid": "testdummy",
        "homeDirectory": "/home/test",
        "mail": "[email protected]",
        "uidNumber": "1234",
        "givenName": "Test",
        "objectClass": [
            "top",
            "person",
            "organizationalPerson",
            "inetOrgPerson",
            "shadowAccount",
            "posixAccount",
            "jumpcloudUser"
        ],
        "sn": "User",
        "gidNumber": "1234",
        "cn": "Test User"
    }
]

Troubleshooting

Enabling debug logs

  • Set the environment variable LOGGER_LEVELS_ROOT to DEBUG to enable all debug logs - custom and framework
  • Set the environment variable LOGGER_LEVELS_IO_GITHUB_DEVATHEROCK to DEBUG to enable debug logs only in custom code
  • For fine-grained logging control, supply a custom logback.xml file and set the environment variable LOGBACK_CONFIGURATION_FILE to /path/to/custom/logback.xml

JSON logs

Refer logstash-logback-encoder documentation to customize the field names and formats in the log. To output logs as JSON, set the environment variable LOGBACK_CONFIGURATION_FILE to logback-json.xml

ldap-search-api's People

Contributors

devatherock avatar mend-bolt-for-github[bot] avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ldap-search-api's Issues

CVE-2023-6378 (High) detected in logback-classic-1.4.11.jar - autoclosed

CVE-2023-6378 - High Severity Vulnerability

Vulnerable Library - logback-classic-1.4.11.jar

logback-classic module

Library home page: http://logback.qos.ch

Path to dependency file: /build.gradle

Path to vulnerable library: /home/wss-scanner/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.4.11/54450c0c783e896a1a6d88c043bd2f1daba1c382/logback-classic-1.4.11.jar

Dependency Hierarchy:

  • โŒ logback-classic-1.4.11.jar (Vulnerable Library)

Found in HEAD commit: 6ca17decff6b34d651dfd0b1c675b25a37059468

Found in base branch: master

Vulnerability Details

A serialization vulnerability in logback receiver component part of
logback version 1.4.11 allows an attacker to mount a Denial-Of-Service
attack by sending poisoned data.

Publish Date: 2023-11-29

URL: CVE-2023-6378

CVSS 3 Score Details (7.1)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Local
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Changed
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://logback.qos.ch/news.html#1.3.12

Release Date: 2023-11-29

Fix Resolution: ch.qos.logback:logback-classic:1.3.12,1.4.12


Step up your Open Source Security Game with Mend here

CVE-2023-44487 (High) detected in netty-codec-http2-4.1.91.Final.jar - autoclosed

CVE-2023-44487 - High Severity Vulnerability

Vulnerable Library - netty-codec-http2-4.1.91.Final.jar

Library home page: https://netty.io/

Path to dependency file: /build.gradle

Path to vulnerable library: /home/wss-scanner/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec-http2/4.1.91.Final/4ee7027e1653c6ee3f843191e0d932f29e8e14e1/netty-codec-http2-4.1.91.Final.jar

Dependency Hierarchy:

  • micronaut-bom-3.9.1.pom (Root Library)
    • โŒ netty-codec-http2-4.1.91.Final.jar (Vulnerable Library)

Found in HEAD commit: 6ca17decff6b34d651dfd0b1c675b25a37059468

Found in base branch: master

Vulnerability Details

The HTTP/2 protocol allows a denial of service (server resource consumption) because request cancellation can reset many streams quickly, as exploited in the wild in August through October 2023.

Publish Date: 2023-10-10

URL: CVE-2023-44487

CVSS 3 Score Details (7.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://www.cve.org/CVERecord?id=CVE-2023-44487

Release Date: 2023-10-10

Fix Resolution: org.eclipse.jetty.http2:http2-server:9.4.53.v20231009,10.0.17,11.0.17, org.eclipse.jetty.http2:jetty-http2-server:12.0.2, org.eclipse.jetty.http2:http2-common:9.4.53.v20231009,10.0.17,11.0.17, org.eclipse.jetty.http2:jetty-http2-common:12.0.2, nghttp - v1.57.0, swift-nio-http2 - 1.28.0, io.netty:netty-codec-http2:4.1.100.Final, trafficserver - 9.2.3, org.apache.tomcat:tomcat-coyote:8.5.94,9.0.81,10.1.14, org.apache.tomcat.embed:tomcat-embed-core:8.5.94,9.0.81,10.1.14, Microsoft.AspNetCore.App - 6.0.23,7.0.12, contour - v1.26.1, proxygen - v2023.10.16.00, grpc-go - v1.56.3, v1.57.1, v1.58.3


Step up your Open Source Security Game with Mend here

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.