Giter Club home page Giter Club logo

kanidm's Introduction

Kanidm - Simple and Secure Identity Management

About

Kanidm is a simple and secure identity management platform, allowing other applications and services to offload the challenge of authenticating and storing identities to Kanidm.

The goal of this project is to be a complete identity provider, covering the broadest possible set of requirements and integrations. You should not need any other components (like Keycloak) when you use Kanidm - we already have everything you need!

To achieve this we rely heavily on strict defaults, simple configuration, and self-healing components. This allows Kanidm to run from small home labs, families, small businesses, and all the way to the largest enterprise needs.

If you want to host your own authentication service, then Kanidm is for you!

Supported Features

Kanidm supports:

  • Passkeys (WebAuthn) for secure cryptographic authentication
  • Attested passkeys for high security environments
  • OAuth2/OIDC authentication provider for web SSO
  • Application Portal allowing easy access to linked applications
  • Linux/Unix integration with TPM secured offline authentication
  • SSH key distribution to Linux/Unix systems
  • RADIUS for network and VPN authentication
  • Read-only LDAPs gateway for Legacy Systems
  • Complete CLI tooling for Administration
  • Two node high availability using database replication
  • A WebUI for user self-service

Documentation / Getting Started / Install

If you want to read more about what Kanidm can do, you should read our documentation.

We also have a set of support guidelines for what the project team will support.

Code of Conduct / Ethics

All interactions with the project are covered by our code of conduct.

When we develop features, we follow our project's guidelines on rights and ethics.

Getting in Contact / Questions

We have a Matrix-powered gitter community channel where project members are always happy to chat and answer questions. Alternately you can open a new GitHub discussion.

What does Kanidm mean?

Kanidm is a portmanteau of 'kani' and 'idm'. Kani is Japanese for crab, related to Rust's mascot Ferris the crab. Identity management is often abbreviated to 'idm', and is a common industry term for authentication providers.

Kanidm is pronounced as "kar - nee - dee - em".

Comparison with other services

LLDAP

LLDAP is a similar project aiming for a small and easy to administer LDAP server with a web administration portal. Both projects use the Kanidm LDAP bindings, and have many similar ideas.

The primary benefit of Kanidm over LLDAP is that Kanidm offers a broader set of "built-in" features like OAuth2 and OIDC. To use these from LLDAP you need an external portal like Keycloak. However, that is also a strength of LLDAP is that is offers "less" which may make it easier to administer and deploy for you.

While LLDAP offers a simple WebUI as the primary user management frontend, Kanidm currently only offers administration functionality via its CLI. The Kanidm WebUI is tailored to user interactions.

If Kanidm is too complex for your needs, you should check out LLDAP as a smaller alternative. If you want a project which has a broader feature set out of the box, then Kanidm will be a better fit.

389-ds / OpenLDAP Both 389-ds and OpenLDAP are generic LDAP servers. This means they only provide LDAP and you need to bring your own IDM components - you need your own OIDC portal, a WebUI for self-service, commandline tools to administer and more.

If you need the highest levels of customisation possible from your LDAP deployment, then these are probably better alternatives. If you want a service that is easy to set up and focused on IDM, then Kanidm is a better choice.

Kanidm was originally inspired by many elements of both 389-ds and OpenLDAP. Already Kanidm is as fast as (or faster than) 389-ds for performance and scaling as a directory service while having a richer feature set.

FreeIPA

FreeIPA is another identity management service for Linux/Unix, and ships a huge number of features from LDAP, Kerberos, DNS, Certificate Authority, and more.

FreeIPA however is a complex system, with a huge amount of parts and configuration. This adds a lot of resource overhead and difficulty for administration and upgrades.

Kanidm aims to have the features richness of FreeIPA, but without the resource and administration overheads. If you want a complete IDM package, but in a lighter footprint and easier to manage, then Kanidm is probably for you. In testing with 3000 users + 1500 groups, Kanidm is 3 times faster for search operations and 5 times faster for modification and addition of entries (your results may differ however, but generally Kanidm is much faster than FreeIPA).

Keycloak

Keycloak is an OIDC/OAuth2/SAML provider. It allows you to layer on WebAuthn to existing IDM systems. Keycloak can operate as a stand-alone IDM but generally is a component attached to an existing LDAP server or similar.

Keycloak requires a significant amount of configuration and experience to deploy. It allows high levels of customisation to every detail of its authentication work flows, which makes it harder to start with in many cases.

Kanidm does NOT require Keycloak to provide services such as OAuth2 and integrates many of the elements in a simpler and correct way out of the box in comparison.

Developer Getting Started

If you want to contribute to Kanidm there is a getting started guide for developers. IDM is a diverse topic and we encourage contributions of many kinds in the project, from people of all backgrounds.

When developing the server you should refer to the latest commit documentation instead.

kanidm's People

Contributors

0xc0ncord avatar aplanas avatar cjschroder avatar cuberoot74088 avatar dependabot[bot] avatar discreetdropbear avatar dmulder avatar dvv avatar euank avatar firstyear avatar flakebi avatar greizgh avatar jceb avatar jinnatar avatar kellinm avatar leoleoasd avatar micolous avatar minhphan8803 avatar mweinelt avatar oddlama avatar pando85 avatar pdostal avatar pi-cla avatar qnnokabayashi avatar scabrero avatar seba-t avatar thesuess avatar victorcwai avatar water261 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

kanidm's Issues

Create try_audit macro

create a new macro with a form similar to try_audit!(audit, result, "message, <format args ...>);
This will help save code reuse instead of using a match statement every time we need to check if a result from a function call that is just going to return Ok(()) or log the error and return Err()

Refactor queryserver and backend

The current design is an actix web front end that transform proto -> requests. These requests go to the query server threads that then dispatch them to a "backend", which then accesses the (incorrectly named) backend of the idl layer.

The query server actors should choose the backend, and we should move the current query server logic to "backend". Then after that, we should move the current 'backend" for idl parts to a proper idl component.

The idea is to allow re-use of the backend in other applications (such as the client tools which may need a cache type), and to then have the front end actix-web + requests layer able to use a different backend such as ldap via a translation layer.

uid/gid generation from uuid

After the uuid is generated, if the class supports uidnumber/gidnumber, we should template these based on the uuid that was generated.

RADIUS integration

Support mschapv2 for radius, along with an rlm module for freeradius to operate with.

Indexing

Support idlset indexing for eq/pres/sub on all attributes.

Add DB Entry Type

Today we serialise the server Entry struct to the DB, but this serialises some extra fields as part of the state machine for Entry correctness. To avoid this, we should have a seperate DBEntry type which has into/from Entry, and means we avoid the generics being serialised when they shouldn't be.

This is probably a good chance to switch to cbor in the db records, and to add entry versioning to the db records, given the desire to add value labels. Another possible improvement here is to have uuid from proto-entry split to a real field on the entry/db-entry, but still indexed.

Improve COW behaviours

Some places use cowcell, when they should use the concread tree type. This relies on concread's tree being developed, but after that we should check all uses of cowcell, and ensure they match our expectations, potentially opting to cowtree instead. An example is schema which is current a cowcell hashmap, which means the hashmap is cloned every write.

Add support for API-application passwords

It's common that applications (like email, imap etc), need passwords and can't supply 2fa. Allow generation of passwords for these services, and allow them to have constrained rights related to their operations and interactions.

Clean up todo's in code

There are a number of todo's in the code, as well as some unwraps and other code hygiene issues. Make sure these are resolved. The only acceptable place for unwrap is is tests, and really, that should be .expect anyway to help test failure diagnosis

Shadow entry items

There are a number of use cases for a "shadow" entry type. For example, in webauthn, we need to store and search based on credentials. We could have ssh-keys that only apply to certain tagged types such as an admin-group (and the admin group references the shadow object as the member, but the shadow inherits the parents other attributes).

This is an alternate to the "tagging" value api option.

This should be considered along with auth use cases.

It's likely a shadow entry api would need references types to split to weak and hard, where hard references are deleted on the referent deletion where a weak reference would just remove the reference. Consider shadow -> item, and you delete item, we want to remove shadow, but group -> item, on delete of item we don't want to delete group.

Add CLI configuration options

For production deployments we need more config options setup and available, like timeouts and thread options. These should be cli options or autodetected if possible.

Stress testing tools

Create an integration test that does stress and load testing of the implementation (that is optionally run)

Add tagged attribute values

Allow the ability to tag values in an attribute. This will have many future uses, such as seeing which memberOf is direct/indirect, allowing ssh-keys to have security labels assigned (IE a host may only want certain key labels), passwords to have metadata attached.

Some decisions about the correct way to do the labeling, and structure are needed, probably based on use cases. At the moment my current thinking is:

struct AVA {
    attr: String,
    value: Vec<Value>
}

struct Value{
    data: String
    label: Vec<String>
}

Some other considerations are how we manage security of tags/labels and this will depend on the use cases we come up with.

Handle create where reference is to object in same operation

At the moment, in a create references are resolved in isolation as we do the protoEntry -> Entry translation. However, one can easily imagine situations where we create a user and a group containing the user in the same operation, which would fail in this case.

Recycle bin

Delete should be re-worked to actually mark objects as "deleted" rather than actually deleting them. This would allow "recovery" of accidentally deleted objects. A major consideration to this is that filters should default inject a "AndNot(class=deleted)" into all searches (unless we are specifically requesting recycled objects).

Support session claims

Claims are an important modern security concept, allowing ephemeral, or scoped privileges for each session of authentication or token. Examples are that you may have a claim for interactive logins that allows changing your own displayname, but your "email" token does not have this claim so can not change your name. Another example is the github style "sudo" mode which is a time limited claim allowing modification of passwords or 2fa tokens.

This means claims should:

  • Be inherited from groups to "allow" access of the claim
  • The claim is "associated" to a credential, IE interactive pw + mfa, or a api password type.
  • The claim is added to the userAuthToken
  • The claim is processed into the current Entry during an operation for auth filters to be applied.
  • The claim associated on the credential must be indexed/searchable to allow memberof style removal if you are removed from the group.

Event auditing

In some cases we want to record audit events on objects for transparency. For example, on failed authentication we want to write to the object about the failed authentication. We want to audit account impersonations, password changes, etc.

For some events, these should imply a write to the object itself that allows the object to self-read it's audit information about what has happened and who is using the account.

Dynamic schema

Currently schema is generated from internal objects. We should leave this as the "minimal", and then have the ability to load schema from the backend at startup to allow custom schema to be created and referenced. We likely need to use migrations to ensure the schema in the db (at least system schema) is "as we expect".

Add filter type for "self".

We should support a filter type of "self", which from protoFilter -> Filter translates to eq(uuid, uuid_value).

Additionally, consider how this value could work with acp, because that will require the self type to exist in the future.

Memberof effeciency improvements

There are a number of places in memberof that could be more effecient, avoiding clones and detecting more precisely when MO items change to avoid resolutions. These should be implemented to save cycles on the write path.

Auth session cleanup (gc) process

We have a concurrently readable structure for in progress authentications. However, we should clean up expired sessions after a period of time. This requires an associated heap that can show us the "next" expiring structure for GC.

Property based testing

We should support proptesting on certain parts of the interface, especially the lower level concepts like filter.

Inner Entry types should have proper Value type over String

We currently have all attr-values as (String, Vec), however we need to support more complex data types - for example, credentials for IDM will require a complex struct type containing a set of claims, time limits, the credentials themself and more.

However, decoding this from string all the time via b64 cbor would be costly - instead, we should have AVA's support proper "Value" type with an enum, that can return the correct types, and allow encoding more information, doing value-aware operations in replication and more. We can also use this to encode things like CSNs and more.

Finally, this also means we would reduce the need to access schema on compare operations, and we can have more complex indexing outputs IE 1 ava -> many index outputs.

This will be a huge change but it's critical for credential storage and more to support this.

Implement TOTP

Implement support for TOTP in the authentication system

Refactor and clean up protocol layering an messages

The server is designed to have a http protocol, an actor protocol, and a query server event system. Each of these are related, but subtely different. However, I have allowed some types to leak between all three. This should be cleaned up.

Ability to scan email-pw lists for compromised accounts

We should allow a folder of "email: pw" from online account compromises to be read and scanned over the server to check for account compromises. In the same function, we should store a permanent list of passwords that have been compromised so they can never be set by that account, and return a specific error in this case.

Add ephemeral TLS support

By adding ephemeral TLS support, we can have our config use the proper security options in development, not just in production.

Automated/Scheduled backups

It would be beneficial to deployments to have an automated/scheduled backup system in the server, to avoid the need to trigger a db backup before you perform a filesystem backup.

MemberOf

MemberOf adds reverse group membership data to objects. This needs to likely have a way to resolve uuid -> name (to store uuid on the target), group members probably need to store uuid too.

We'll need a way to translate "reference" fields to names in searches, and potentially have derference available. MemberOf should be able to generate and change these reverse-references on updates.

Implement client tools

We should create at least a base framework of client tools. This should be:

  • pam client
  • nsswitch client
  • create/modify/delete/search admin tool for users/groups etc
  • generic object modification tool
  • whoami
  • ssh-key tool for ssh key reading

Backup/Restore

We need to provide backup/restore tooling so that we cane import/export data and give a proper admin experience around this topic.

Investigate and change from sqlite to sled

The sled db project plans to add mvcc as an option. We require this style of transactions so if they support mvcc, we should change from sqlite to sled in our idl layer.

Dockerfile

Support a docker deployment, with proper documentation and examples of how to perform tasks (like backups!).

Referential integrity

Due to the design of reference types, referential integrity is required as part of the server core to make sure we don't have dangling references.

Seperate IDM migrations from QS

The server could be built in such a way as to allow a "generic" DB to be built (with some work to split out plugins). To help, the IDM specific migrations should be moved to the IDMServer component, rather than in the QS component, to properly seperate these intents.

Implement account policy and lockouts

Implement account and credential policy, as well as soft lockouts for credentials. This includes potentially auditing logins and credential usages.

Seperate read and write actors

At the moment, the query server uses actors as a simple thread pool, but it should be split so that there is a single write actor, multiple read actors, and split idm actors.

Implement access profiles

Implement access control profiles that can limit creation, modification and delete actions. It's likely a design document should be produced as part of this.

Filter state machine

Similar to the entry state machine that is type enforced, we should do the same to filter to distinguish a schema validated filter from a non-validated filter.

Make UUID a proper type on the Entry struct

There is a large amount of special handling related to the value of UUID: IT would make more sense to make this in protoentry an Option on the struct, and in Entry, on Valid state an Option or String type. This way we avoid many of the get_ava and asserts around checking there is trurly a single value. By using Rust's type system here, we make the code simpler, losing no robust-ness around uuid handling. It would change the entry serialisation format, so this is better to do sooner.

Support labelling system protected objects

We should have a label or class that prevents (some) modifications, deletions of objects. It should also not be used during creates. This is so that we can mark types as protected to prevent accidental damage.

A consideration is with dynamic schema, we need uses to be able to edit must/may, but not the schema elements themself, so this could be achieved with a system protected access profile, then use that access profile over the schema types.

Perhaps an approach is a self-referring access control that prevents this kind of change?

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.