netbox icon indicating copy to clipboard operation
netbox copied to clipboard

Implement two factor authentication

Open mdlayher opened this issue 10 years ago • 14 comments

It would be a great added security measure to allow two factor authentication using a smartphone application like Google Authenticator.

mdlayher avatar Jun 29 '16 18:06 mdlayher

Can I request U2F FIDO?

https://www.yubico.com/about/background/fido/

bellwood avatar Jun 29 '16 19:06 bellwood

Google Auth for us would be a great addition as well :)

starlokii avatar Jun 29 '16 23:06 starlokii

Adding some notes if this enhancement is put on the roadmap: https://developers.google.com/api-client-library/python/guide/django

ryanmerolle avatar Jun 30 '16 19:06 ryanmerolle

Note for U2F:

https://developers.yubico.com/U2F/Plugins.html

https://github.com/gavinwahl/django-u2f

bellwood avatar Jul 05 '16 23:07 bellwood

There should be no reason why the user cannot select which type of extra level of authentication they wish to use.

This could be set enabled in the python script, which means you could have them tiered where you could use all three if you have some military grade requirements.

For the normal NetBox user, one of the two above listed solutions would be fine.

Some people will want to use Google Authenticator, some people will want to use U2F FIDO and some people will want to use alternatives, such as SoundLogin, HDE ODP and Authenticator Plus to name the good few in a range of underwhelming authenticators - gimmicks are everywhere.

MaXFalstein avatar Jul 11 '16 09:07 MaXFalstein

I would suggest this as a way to implement one-time-passwords: https://django-two-factor-auth.readthedocs.io/en/stable/

jsenecal avatar Sep 15 '16 16:09 jsenecal

Perhaps some SAML integration?

specialcircumstances avatar Nov 21 '16 21:11 specialcircumstances

SAML integration and/or radius integration would work very well.

Radius integration could also enforce twofactor authentication on it's own if the radius client in the Django framework works well (no experience with that).

ack-martijng avatar Dec 15 '16 11:12 ack-martijng

Wouldn't it make more sense to do this in the HTTP server fronting netbox?

Whether you have a F5 LTM in front of your web servers, or you have Apache/Nginx, then a server host like uwsgi or whatever - they can all authenticate clients and pass through (and better still, block before annoying the application (netbox) with an unauthorised connection).

Auth modules are already invented for these layers; Jeremy reinventing the wheel for every auth type just wastes his time.

hawko2600 avatar Dec 15 '16 23:12 hawko2600

@darthmdh To be honest, i am not so much a developer or a experienced server operator. I tend to find my way through systems, but i lack sometimes the knowledge to connect two things to each other.

I agree that if this could be done within the webserver, this does not need to be implemented within Netbox. However i would appreciate if Netbox would trust the username passed from the webserver to the cgi for administrative access. So people still do not need to log in again.

Implementing the two factor (or any other) authentication method would mean (from my point of view) it will become almost impossible to maintain a list of every 'edit' page. This is available within Netbox that does enforce the login requirement. For example adding a addon in the future would not add new edit pages to the list of pages required authorisation within the webserver. Also i believe we (Jeremy) should not be reinventing the process for every type of authorisation-system. There are a few good standards that are used by large authentication providers. Radius, SAML en LDAP are three of them from my perspective. And there are already Django/Python modules for these available. If i was able to write those implementations myself i would be happy to collaborate on this, unfortunatly i am not.

ack-martijng avatar Dec 16 '16 08:12 ack-martijng

Hi there,

i've read through this thread because i was looking for an adfs integration for netbox. I also searched for adfs/saml addons for nginx and uwsgi but at the end i added the adfs support into netbox, because there are good libs already for django to get this working.

If you want i can create a merge request for this. The code can be found here: https://github.com/inovex/netbox/commit/795d3971dd527bdb4ae48bd392cd7750555a1a37

krimdomu avatar Apr 12 '17 18:04 krimdomu

Would be nice if netbox played nice with something like Okta which is basicallum SAML2 - i see someone has already built a plugin for Django/SAML

https://github.com/fangli/django-saml2-auth

How hard would that be to integrate?

callumbnz avatar Jul 17 '17 01:07 callumbnz

any progress with the SAML2 integration?

rhys-intelliflo avatar Oct 05 '17 14:10 rhys-intelliflo

This feature request hasn't gone anywhere since it was opened, and I think part of the problem is that it's not well-defined. Thus, I'm going to close out this issue, and anyone who wants to commit to implementing a specific new form of authentication can raise a new FR detailing their proposal. However, please do so only if you are willing to contribute the necessary effort; unfortunately this is not something to which I can commit development time myself.

jeremystretch avatar Oct 20 '17 13:10 jeremystretch