Giter VIP home page Giter VIP logo

ldap3's Introduction

Ldap3 Protocol Bindings and Async Client

This is a work-in-progress of LDAP3 protocol bindings and an async client library.

This is not an LDAP3 server - it is the required parts to allow you to build one using a TCP/TLS server. You will and should develop your own state machine, and should consider the many security risks of LDAP3 such as filter stack limits, request sizelimits, number of entries limited in results, binds and how you check access controls, and more.

Structure

Proto

This library contains all the needed protocol bindings, mapped to their BER structures in proto, as well as a set of simple wrappers of common operations required for a server, discarding many of the esoteric options that are generally not required.

Client

The client is a tokio based async client library. It is still in development, so not all features are supported.

Cli

This is a thin wrapper over the async client for minimal usage and testing.

Protocol Support ScoreCard

name from rfc implemented?
bind rfc4511 ✅ (Support Both Simple and SASL bind (Security Providers Not included), see below)
unbind rfc4511
search rfc4511
filter rfc4511
modify rfc4511
add rfc4511
delete rfc4511
modRDN rfc4511
compare rfc4511
abandon rfc4511
extended rfc4511 ✅ (may need extension)
whoami rfc4532
disconnection notice rfc4511
content sync rfc4533

Things we won't add

StartTLS has a number of security issues compared to LDAPS, and should not be used, or developed as it is not only more complex, but also worse than LDAPS. Use LDAPS.

SASL is highly complex, and only a few clients require it over a simple bind. Our support is limited to the SASL binding authentication interface, for which an example is available under the './proto' crate. Users are free to choose any security provider they prefer. However, we do not support the SASL transport encryption layer or any implementations of security providers, as these are overly complicated and do not align with our crate's objectives. If encryption is a necessity, we recommend using LDAPS instead.

Notes:

LDAP - the trashfire we have, not the trashfire we want.

ldap3's People

Contributors

firstyear avatar fooker avatar irvingoujatdevolution avatar jiegec avatar kolapapa avatar nitnelave avatar wadahiro avatar yaleman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ldap3's Issues

Attribute options are badly parsed

See lldap/lldap#846 (comment) :
Attribute options (e.g. "uuid;text" or "uuid;binary") are parsed as an extra attribute (so you'd get ["uuid", "text"] as attributes) in a search request.

Even if we don't represent the options, we at least should correctly ignore them.

Add support for PasswordPolicy control

Hey,

I got a user receiving a good old "ldapmsg invalid" when parsing a bind query with a "controlType: 1.3.6.1.4.1.42.2.27.8.5.1 (passwordPolicy)".

Obviously, I don't support the response for that control, but I'd like it if it didn't crash :)

In general, it would be great to be able to parse while receiving the unsupported/unparsed controls on the side.

Add support for unsupported controls

We've run into an issue with a client sending extra controls with their request, that we don't care about but fail the query parsing: lldap/lldap#301
The error is Unsupported control oid | o: 2.16.840.1.113730.3.4.2, and then Failed to parse ldapcontrol

Would there be a way to either add support for the controls, or add a "parse with unsupported controls as an extra return" method?

Add support for non-UTF8 attributes

Currently, LdapPartialAttributes require the values to be String, i.e. a valid UTF-8 attribute.

However, a fairly common LDAP attribute is JpegPhoto where the raw bytes of the JpegPhoto are sent. It's not representable as a String. It should instead be a OsString or Vec<u8>.

WDYT? If you want this (it would be a breaking change, I understand) I can try to work on a PR, but otherwise I'll just have my own fork.

Feature request: support for modify

Hi!

First of all, thanks a lot for your crate, it's been very useful to create my own tiny LDAP server for user management: https://github.com/nitnelave/lldap

However, something that's missing for transparent integration with e.g. Authelia is the ability to reset the user's password from the LDAP interface. That would require the LdapModify message from this crate.

I haven't tested it, but the README says that it's not supported. However, in the code I still see some implementation of LdapModify. Is it complete? Do you need help with it?

Cheers,

How to represent integer attributes?

Let's say I want to create a LdapPartialAttribute with a numerical value.

LdapPartialAttribute {
  atype: "uid".to_owned(),
  vals: vec![123],
}

How do I represent that 123 as bytes? Is there a special encoding necessary? Or do I convert it to i64 then do a cast to 8 raw bytes?

Web-based Active Directory Console

We are currently looking at this project as a potential starting point for a web-based Active Directory console, compiling Rust to WebAssembly, and building a Web UI on top. This crate is interesting because it doesn't have a dependency on tokio for the reusable parts, which is a common problem for in-browser WASM.

There are various improvements and changes we'd need to make, beginning with SPNEGO authentication (NTLM/Kerberos) using sspi-rs. As for other improvements, it would likely be to implement the Microsoft Active Directory LDAP variant and custom extensions.

For our use case, we only care about Active Directory, which may not be the goal of this project. Would you be interested in such contributions, even if they would be focused solely on Active Directory? We're unsure if we'd be better off trying to get all of our changes merged upstream, or if we should create something something solely meant for Active Directory using this project as a basis.

Either way, let us know your preference!

Dependency warning

Hello kanidm, thank you very much for your repository, which helped me a lot, but I have a question, is there any plan to upgrade lber to version 0.4.0? Because I received a warning like this when compiling: warning: the following packages contain code that will be rejected by a future version of Rust: nom v2.2.1.

An error occurred writing to the transport

I recently encountered an issue while using ldap_client:
After storing two LdapClient instances, I automatically select which LdapClient to use for processing based on the content of the search request. However, I often encounter the error "An error occurred writing to the transport". This error seems to indicate that the TCP stream has been disconnected. I would like to know how to optimize this issue.

Compare support

I see it is explicitly listed as not implemented in the readme but I'm curious as to what is the sentiment towards the compare ldap feature. Is is just not implemented because of a lack of time or has it been explicitly left out for some other reason?

I'm using LLDAP which is based on this library and any Django service apparently uses this LDAP call during sing-on, so a wide range of web applications supporting LDAP authentication are being left unsupported this way.

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.