Commit Graph

129 Commits

Author SHA1 Message Date
Frank Mogaddedi
0a5b20c452 feature: Active Directory user in nested groups (#7175)
* Active Directory user in nested groups

* Active Directory user in nested groups

* Active Directory user in nested groups

* Use Config in new function
2017-08-25 00:24:43 -05:00
Nick Ramser
2e2e046a81 Remove blank line at the end of the file. 2017-08-02 08:32:43 -04:00
Nick Ramser
4acf4eafd7 Added get_group_list() to ldap-authorization. The function was copied from ldap.inc.php 2017-08-01 16:16:52 -04:00
Tony Murray
431d15aad9 fix: issues with http-auth when the guest user is created before the intended user (#7000) 2017-07-10 21:48:24 +01:00
Tony Murray
50b3ffb3cf feature: add timeout to AD auth, default is 5s (#6967)
* feature: add timeout to AD auth, default is 5s
Can be configured by $config['auth_ad_timeout']

* only set timeout during bind operation
2017-07-07 23:05:40 -05:00
Tony Murray
20b08cf595 refactor: finish logic and definition separation (#6883)
Clean up rewrites to only have function definitions
Move authentication initialization into a function
2017-07-03 15:38:58 -05:00
rzig
1ba6381d61 security: Enable support for secure cookies (#6868)
* Enable secure cookies for authentication

Enables secure cookies for authentication when HTTPS is used.

* Add line with example secure session cookies

* Fix comment line that's too long

* Remove session secure cookie config

* Added secure cookie config to init.php

Commented out because having this enabled will prevent the server from sending cookies over HTTPS.

* Enable secure cookies if config value provided

* Make code formatting consistent

* Remove secure cookie config

* Use $config['secure_cookies'] to set cookies

* Add default option to turn secure cookies on

* Fix formatting issues

* Set secure cookies to default to false

* Add info about secure cookies

* Fix formatting

* Remove trailing whitespace

* move secure cookie default config to defaults.inc.php

* Remove trailing whitespace

* Fix formatting

* Remove empty line by rrd config

* Remove whitespace
2017-06-26 14:21:21 +01:00
Neil Lathwood
14a143a6a7 fix: Fixed http-auth not honouring http_auth_guest (#6699)
* fix: Fixed http-auth not honouring http_auth_guest

* Always fall back to http_auth_guest.
Make sure $username is set, otherwise, we won't try to authenticate.

* reverted elseif to default to http-auth-guest

* Update authenticate.inc.php

simplify logic
2017-05-23 08:40:57 +01:00
Tony Murray
4d0c75343e fix: Two-Factor Authentication (#6672)
* fix: Two-Factor Auth
Moved library to a class to take advantage of namespacing and auto loading.
Update the two factor code to use the AuthenticationException for error messages.
Fix remember me to work with 2fa.

* missing change
2017-05-18 22:08:10 +01:00
Tony Murray
155d9de8dc fix: two-factor auth and restore some auth speed regressions (#6649) 2017-05-15 23:13:07 -05:00
Tony Murray
683a10e723 fix: Improve authentication load time and security (#6615)
* fix: minimize session open time
page/graphs speedup part 2

Write close the session as soon as we no longer need to write to it. Prevents the session from blocking other requests.
Do not run through full authentication functions if the session is already authenticated.
Removes password from the session as well as some items to prevent session fixation from #4608.

WARNING: This will cause issues for ad/ldap users who do not have a bind user configured!

* Do no erase username when using cookie auth.
Properly close the session in ajax_setresolution.php

* write close the session as soon as possible in ajax_setresolution.php

* Remove session regeneration. It is not compatible with the current code and would require more changes.

* Totally refactor authentication.  Extract code to functions for re-use and improved readability

* Use exceptions for authentication and error logging
Tested: mysql, ad_auth with and without bind user

* fix a couple scrutinizer issues

* fix reauthenticate in radius
2017-05-15 22:18:23 -05:00
Olivier Beytrison
472d15a639 fix: Fixed radius debug mode (#6623) 2017-05-10 08:32:35 +01:00
Tony Murray
c5c643f901 fix: AD authentication when auth_ad_base_dn is an OU (#6405)
* fix: AD authentication when auth_ad_base_dn is an OU
OUs don't have SID, so we can't use them to figure out the domain SID

* Only match leading OUs

* Actually, might be best to remove everything except the domain components.
2017-04-12 21:44:09 -05:00
Tony Murray
4b9f3f37d7 fix: move user preferences dashboard and twofactor out of users table (#6286)
* fix: move user preferences dashboard and twofactor out of users table
This allows them to work with any authentication method
Add set_user_pref() and get_user_pref() helper functions

* fix edit users for other users

* Fix updated_at default timestamp

* Update and rename 183.sql to 184.sql

* removed commented out debug
2017-04-01 22:18:00 +01:00
Tony Murray
1ea7af424b feature: bind user for active_directory auth (#6255)
* feature: bind user for active_directory auth
Optional, allows the use of "remember me", API, and alerting.

* missing global (but still may not be working)

* always return a value from reauthenticate()

* Make sure the ldapbind credentials are correct on reauth.
Do not send output if they are incorrect (use d_echo) this breaks ajax calls, etc.
Add scripts/auth_test.php, to make it easier to debug authentication.

* Refine auth_test.php a bit more
A few small cleanups in other places of the auth

* Add auth_test.php to docs
Some more improvements in the auth_test.php output.

* Update Authentication.md
2017-03-29 08:22:02 -05:00
Neil Lathwood
e2962adac8 fix: Updated http-auth to work with nginx http auth #6102 (#6174) 2017-03-12 07:54:59 -05:00
rockyluke
b5a8cb0f5b webui: Minors changes on Edit User page (#5717)
* Order user alphabetically (MySQL)

* Add (admin) or (demo) after login on Edit User page

* Fix missing $user_level

* Complete the switch/case on user level

* Remove redundant case

* Remove blank line
2017-02-01 20:05:50 +00:00
Tony Murray
307e5ae500 fix: mono theme panel headers black (#5705)
Fixes issue where the librenms_logo_mono.svg is now loaded by making the background black to match the logo.
Update twofactor.lib.php.
Remove unused if statement
2017-02-01 08:03:07 +00:00
Tony Murray
afe887d85e webui: New LibreNMS logo assets (#5629) 2017-01-27 18:02:49 +00:00
Neil Lathwood
d5296319fb refactor: MySQL strict and query fixes (#5338)
* refactor: MySQL strict and query fixes

* moved sql file
2017-01-13 06:47:16 -06:00
Tony Murray
e20a242785 refactor: use Composer to manage php dependencies (#5216) 2017-01-01 09:37:15 +00:00
Neil Lathwood
f5ce3c509a Revert "Trust PHP session and remove remember me cookie" (#5252) 2016-12-27 20:37:03 +00:00
Eldon Koyle
3b198243d5 refactor: Trust PHP session and remove remember me cookie (#4608) 2016-12-26 23:11:00 +00:00
Joachim Tingvold
505e6516b0 fix: Fixed setting userlevel for LDAP auth #5090 2016-12-01 19:50:08 +00:00
jonathon-k
65f74215d3 feature: Add an option for ad authentication to have a default level (#4801)
* Add an option for ad authentication to have a default level

* rework as a flag indicating unspecified access is global read

* Fix indentation
2016-10-21 11:22:13 -05:00
Neil Lathwood
a2f2ccfd2c security: Fix some reported security issues (#4807) 2016-10-15 20:45:18 +01:00
jonathon-k
ba9672b986 fix: Prevent accidental anonymous binds (#4784)
* Prevent ldap and Active Directory authentication from allowing anonymous binds

* fix style
2016-10-13 10:19:36 -05:00
Eldon Koyle
5749179cf5 feature: Add the ability to include an LDAP filter for users/groups in AD (#4494)
* Add auth_ad_(group|user)_filter options

* use global

* Fix some AD annoyances

Use the power of the LDAP filter to minimize the number of queries and
hopefully help performance in get_userlist, change semantics of
auth_ad_(user|group)_filter in $config to be anded with
samaccountname=USERNAME.

* remove unused variable

* update documentation

* Update Authentication.md
2016-09-21 14:42:59 -05:00
Tony Murray
36f6338ad6 fix: Clean up errors in the webui (#4438) 2016-09-15 08:46:26 +01:00
Neil Lathwood
a8efda8f30 Revert "Updated to remove passwords from sessions" (#4422) 2016-09-13 09:10:42 -05:00
Neil Lathwood
deb4b74bc9 webui: remove passwords from sessions, 'remember me' works for all auth types (#4134)
* Updated to remove passwords from sessions

* Remove users sessions when user deleted

* Updated when cookies are set

* Updated setcookies to always contain a value

* Added destroy_cookies() to remove users cookies on failed login

* Removed debug line

* Fixed graph issues
2016-09-12 21:41:19 -05:00
Neil Lathwood
9e85f24b00 fix: Make irc bot to use authentication module for user info (#4372) 2016-09-12 11:24:22 -05:00
Tony Murray
956e18ffcd feature: Better error messages for ad_auth (#4385) 2016-09-09 08:04:03 -05:00
Tony Murray
8c639aa5a4 PSR2 Cleanup: /html edition
Travis tests for code conformance. Ignore warnings for now.
Fixed all errors, left most warnings.
2016-08-18 21:29:30 -05:00
Vitali Kari
a175b291c3 reduce regress
still dirty hack, but solves a big problem.
2016-06-15 20:06:36 +02:00
Vitali Kari
0b30ca1071 making CN with a , inside working
a workaround to mask a , sign in a DN before CN is extracted
resolves #3533
2016-06-13 17:25:18 +02:00
Tony Murray
bf471698ef Change the rest of the $ds variables to $ldap_connection 2016-06-03 22:16:10 -05:00
Tony Murray
9b0bd4c15a Rename $ds to $ldap_connection
$ds is a global variable, there are many name collisions in the code.  Rename it to avoid the collisions.
2016-06-03 10:56:42 -05:00
Adam Winberg
1d2a49746d Added authentication module combining http authentication and Active Directory authorization 2016-05-18 10:06:12 +02:00
Ultra2D
12a3b305ed API access when using LDAP authorization 2016-03-10 14:48:01 +01:00
Ultra2D
322053c827 API access when using LDAP authentication 2016-03-07 14:07:51 +01:00
Tony Murray
b9448a61a8 Remove Success output from homepage when using AD Auth. 2016-01-25 13:10:51 -06:00
Maximilian Wilhelm
64ce4f335f Add HTTP Authentication / LDAP Authorization module.
This Authentitation / Authorization module provides the ability to let
  the webserver (e.g. Apache) do the user Authentication (using Kerberos
  f.e.) and let libreNMS do the Authorization of the already known user.
  Authorization and setting of libreNMS user level is done by LDAP group
  names specified in the configuration file. The group configuration is
  basicly copied from the existing ldap Authentication module.

  To save lots of redundant queries to the LDAP server and speed up the
  libreNMS WebUI, all information is cached within the PHP $_SESSION as
  long as specified in $config['auth_ldap_cache_ttl'] (Default: 300s).

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
2016-01-21 21:49:08 +01:00
laf
c6c3858312 Some more scrut fixes 2016-01-19 22:27:04 +00:00
laf
44dc6b652b Fixed scrut issues 2016-01-19 09:04:53 +00:00
laf
57c802cd4e Updated active directory auth to support dashboards 2016-01-17 15:26:35 +00:00
laf
3a299584b0 Added ability to specify default userlevel 2015-12-14 21:52:15 +00:00
laf
af21d4a54a Fix some scrut issues 2015-12-13 16:54:40 +00:00
laf
dcf4d0f378 Added docs and set default users to level 1 2015-12-13 15:51:15 +00:00
laf
b31cbd8dae Code for Radius authentication added 2015-12-13 15:37:55 +00:00