NethServer / nethsecurity

NethSecurity image and build environment
https://www.nethsecurity.org/
Other
98 stars 6 forks source link

Enhance LDAP remote database authentication #602

Closed gsanchietti closed 3 months ago

gsanchietti commented 3 months ago

Improve authentication flexibility for Active Directories and other LDAP configurations with unknown distinguished name (DN) setups.

This feature is essential for users who need to authenticate against LDAP directories with unique or unknown DN structures. Ensures that OpenVPN authentication is robust and adaptable to various LDAP configurations.

Purpose of the feature

Proposed solution

Backend required changes:

  1. python3-nethsec user Library: implement logic to handle the custom user_bind_dn field.
  2. OpenVPN Roadwarrior authentication: update authentication mechanisms to use the new user_bind_dn field.
  3. ns.users API: modify API to accept and process the user_bind_dn field.
  4. mgration process: evaluate and implement necessary changes to support existing users during migration.

Frontend required changes:

  1. Remove automatic configuration of LDAP parameters
  2. Add user_bind_dn field: include a new field for custom user bind DN, no validation required for this field to allow maximum flexibility.

Other changes

  1. documentation: document common usage scenarios to guide users in configuring the new field.

Example:

# Allows for custom DN configuration
user_bind_dn: '%u@domain.local'
github-actions[bot] commented 3 months ago

Testing image version: 23.05.3-ns.1.0.1-41-ge07c2589

Testing package for NS7: nethserver-firewall-migration-0.0.18-1.3.g9d1026f.ns7.noarch.rpm

gsanchietti commented 3 months ago

Test case 1

Test case 2

Test case 3

Test case 4

Test case 5

Test case 6

Test case 7

Test case 8

gsanchietti commented 3 months ago

Test cases 1,2,3,4,5,6 verified by Luca D.

gsanchietti commented 3 months ago

Test cases 7 and 8 verified by Luca D. Still, the migration could bring different configuration based on the remote AD type (Samba or Microsoft). After the migration, the user should review the following fields: