Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDAP authentication #65

Closed
Luc1f3rUK opened this issue Jun 28, 2016 · 13 comments
Closed

LDAP authentication #65

Luc1f3rUK opened this issue Jun 28, 2016 · 13 comments
Milestone

Comments

@Luc1f3rUK
Copy link

This project is looking so good!

I'd love the option for LDAP authentication built in (With permissions etc). I'm sure many others will too.
This would make it more appealing for larger organisations.

Thanks,

@aoyawale
Copy link
Contributor

1+

@troxil
Copy link

troxil commented Jun 28, 2016

+1

@MrDragon
Copy link

/AOL (me too), please.
Mostly username/password, if need be, access could be set in netbox. Would be awesome, though, if we could say "if member of group X, then they may edit" or some such thing :)

@dinoocch
Copy link
Contributor

If you don't need a gui, django-auth-ldap is not too hard to set up, and provides the features you seem to be looking for.

@grigorov
Copy link

grigorov commented Jul 4, 2016

+1

dinoocch added a commit to dinoocch/netbox that referenced this issue Jul 6, 2016
Addresses netbox-community#65

This commit adds documentation for installing and configuring ldap
authentication for netbox.

It may be beneficial to add settings to the configuration.py instead of
editing settings.py if this is an important feature.
dinoocch added a commit to dinoocch/netbox that referenced this issue Jul 6, 2016
Addresses netbox-community#65

This commit adds documentation for installing and configuring ldap
authentication for netbox.

It may be beneficial to add settings to the configuration.py instead of
editing settings.py if this is an important feature.
@jeremystretch
Copy link
Member

Awesome work by @dinoocch! Can we get some folks to test and report back? I'd like to soon as well, just need to figure out our LDAP arrangement internally.

I'd like to avoid having users make any changes to settings.py. All end-user config should be done in configuration.py and copied into Django's settings construct at runtime. This helps cleanly enforce required settings while avoiding errors from typos and whatnot. Given the amount of interest in supporting LDAP authentication, I think it makes sense to bake this into NetBox (along with declaring django-auth-ldap as a required dependency. Thoughts?

@MrDragon
Copy link

MrDragon commented Jul 7, 2016

+1 Beer for @dinoocch - works against our Winblows AD server. I'll have to play more with group-and-or combinations because our AD structure is ahem "unique".

  • to install, can python-django-auth-ldap be used (1.1.8-1 on Ubuntu), or does it need to be "pip...", which is a newer version?
  • in the documentation, perhaps a hint for people like me (who don't really know python/django, but can read code and muck around), that the ldap logs can be found in /var/log/supervisor/netbox... ?

I'd love to see this in netbox!

@dinoocch
Copy link
Contributor

dinoocch commented Jul 7, 2016

@MrDragon - Glad to be of assistance,

  • The ubuntu package is probably fine (The most recent version is 1.2.8, and I'd recommend using the latest stable version from pip if that is possible however)
  • The logging code will tie add the ldap logs to the django logger. See Django Docs By configuring the Django logger, you can redirect the logs to anywhere you like!

I'm working on a commit to add the settings to configuration.py, I'm trying to figure out the best structure for this, however...

@jeremystretch jeremystretch added this to the v1.2 milestone Jul 7, 2016
@Zanthras
Copy link
Contributor

Zanthras commented Jul 8, 2016

I can confirm running ldap auth as described against a FreeIPA auth server.

@jeremystretch
Copy link
Member

#203 has been merged, but altered a good deal to avoid having users modify settings.py directly. The documentation has been moved to installation/ldap.md. It would be awesome if we could get a few people to try the new directions on a fresh install and report back with any issues.

@MrDragon
Copy link

Remember, I'm just an awful hack who's weak on AD/LDAP and worse on python, but:

  • would it make sense to add "email": "mail" to AUTH_LDAP_USER_ATTR_MAP ?
  • As we have groups in groups, esp. for the 'required group' (p.ex. staff, readers, admins, in group "netbox-access"), would it make more sense to use AUTH_LDAP_GROUP_TYPE = NestedGroupOfNamesType()? I think it still works if you have individual users in the "netbox-access" group. (Which also means you may need from django_auth_ldap.config import LDAPSearch, NestedGroupOfNamesType)

@jeremystretch
Copy link
Member

Basic LDAP support has been implemented in the v1.2.0 release. I'm going to mark this issue closed, but I encourage people to open new issues for any specific LDAP changes they'd like to see.

@SignalDistress
Copy link

I don't know if its at all helpful but for anyone else that Django LDAP is completely new for, you just add users with the same user as AD and then some dummy password. If your LDAP is setup correctly then you'll just log in with your LDAP username and password. It worked on the first time for me which was great.

If I'm dropping this comment in the wrong place just lemme know. Happy to help with any docs.

if-fi pushed a commit to if-fi/netbox that referenced this issue Oct 1, 2016
Addresses netbox-community#65

This commit adds documentation for installing and configuring ldap
authentication for netbox.

It may be beneficial to add settings to the configuration.py instead of
editing settings.py if this is an important feature.
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants