Git Product home page Git Product logo

ltb-project / self-service-password Goto Github PK

View Code? Open in Web Editor NEW
1.1K 40.0 315.0 7.28 MB

Web interface to change and reset password in an LDAP directory

Home Page: https://self-service-password.readthedocs.io/en/latest/

License: GNU General Public License v3.0

Perl 0.15% PHP 89.20% Makefile 0.08% Shell 0.51% CSS 0.19% JavaScript 2.59% Smarty 6.87% Dockerfile 0.41%
ldap password self-service self-service-password

self-service-password's People

Contributors

413j0 avatar armfem avatar berkaycagir avatar bondif avatar campolargo avatar coudot avatar dependabot[bot] avatar dgeo avatar faust64 avatar halkeye avatar jazzl0ver avatar jooooooon avatar maxxer avatar med-amine-21 avatar mirkocomparetti-synesis avatar mkraai-cpts avatar myrho avatar philhaworteks avatar plewin avatar praymann avatar shawnmckinney avatar soisik avatar souhaib22 avatar spike77453 avatar stevleibelt avatar thnilsen avatar tleuxner avatar tuudik avatar tvdijen avatar tweea 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

self-service-password's Issues

LDAP Password Policy - Password History

Dear Team,

I'm having an issue with SSP. I have deployed the SSP on a corporate directory with a lot of people and we love it until we discovered that our users can change their password to basically anything. We have a password history settings which does not seem to be taken into account.

I did some research and it look like in the configuration file there is an interesting parameter :

$who_change_password = "manager";

That can be changed into "user".

Indeed, if the manager (Administrator) is changing the password this is actually not a "change" but a "set" performed by the LDAP Admin, then no history taken into account (even if complexity is still applied).

Then, I decided to change the parameter to "user" which then should become a "change" and no more a "set".

I did it on our test platform but unfortunately, the screen remain blank and nothing appears on it (expected the top banner).

Questions :

  • Is there a way to have SSP a little bit more "chatty" and have some debug logs ?
  • Is the user being setup in the configuration the right way to address my issue ?

Thanks for this very nice product !

Fred.

Apache configuration in RPM package

Suggested by Ludwin Janvier:

The apache configuration did not work out of the box neither. Your documentroot is in /usr and default centos 7 apache configuration does not permit documentroot outside /var/www.
I'd suggest you add this "directory" directive:

<Directory "/usr/share/self-service-password">
    AllowOverride None
    # Allow open access:
    Require all granted
</Directory>

This lines are valid for apache 2.4 and above (centos/redhat 7) and may not work with apache 2.2 (6). If you want the same file, maybe you could just create a symlink.

(you could drop the NameVirtualHost line because it has no effect on apache = 2.4, and "will be removed in the next release")

SHA512 in password encryption

Hi,
In our ldap we want to use SHA512 for security reasons.
I thus modified the source code to add it.
In lib/functions.inc.php

# Create SHA512 password
function make_sha512_password($password) {
    $hash = "{SHA512}" . base64_encode(pack("H*", hash('sha512', $password)));
    return $hash;
}
.
.

if ( $hash == "SHA512" ) {
            $password = make_sha512_password($password);
        }

I would suggest you to implement such a mecanism in future versions.
F.

Reset by mail token lifetime issue

Bonjour,

Nous souhaitons faire évoluer la durée de token de reset de mail de 2 h (par defaut) à 24h.

nous avons modifié dans le fichier config.inc.php

# Token lifetime in seconds
$token_lifetime = "7200";

à

# Token lifetime in seconds
$token_lifetime = "86400";

Mais cela ne fonctionne pas, cela semble resté à 2h.

avez vous une idée du problème ?

Cdt
Frederic Goubelle

Remove dependency on php5 in Debian package

This is not possible to install package on a recent Debian server:

# dpkg -i self-service-password_0.9-1_all.deb 
Selecting previously unselected package self-service-password.
(Reading database ... 90814 files and directories currently installed.)
Preparing to unpack self-service-password_0.9-1_all.deb ...
Unpacking self-service-password (0.9-1) ...
dpkg: dependency problems prevent configuration of self-service-password:
 self-service-password depends on php5; however:
  Package php5 is not installed.
 self-service-password depends on php5-ldap; however:
  Package php5-ldap is not installed.

dpkg: error processing package self-service-password (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 self-service-password

Case in-sensitive lookup e-mail address (When used with ldap/Windows AD)

E-mail address are verified case sensitive, because e-mail is never case sensitive this information should be checked without checking it's case.

Solution could be in sendtoken.php line 116 :

Old:

    # Match with user submitted values
    foreach ($mailValues as $mailValue) {
        if ("$mail" === "$mailValue") {
            $match = 1;
        }
    }

New:

    # Match with user submitted values
    foreach ($mailValues as $mailValue) {
        if (strcasecmp($mail, $mailValue) == 0) {
            $match = 1;
        }
    }

Weak entropy for password generation

Currently, some passwords are generated with mt_rand, which is bad idea. This method is also used to generate sms tokens, making them predictable.

As explained in the php documentation:

This function does not generate cryptographically secure values, and should not be used for cryptographic purposes. If you need a cryptographically secure value, consider using random_int(), random_bytes(), or openssl_random_pseudo_bytes() instead.

Can i use it to change my 2012 ActiveDirectory user pass ?

Hi,
I'm trying to use this to change my AD user password,
But keep bumping to
(i) Cannot access LDAP directory
Can someone point me out where is my mistakes ?

Thanks a bunch

here is my config.inc.php

#==============================================================================
# Configuration
#==============================================================================
# LDAP
$ldap_url = "ldap://10.20.2.1:389";
$ldap_starttls = false;
$ldap_binddn = "cn=manager,dc=example,dc=com";
$ldap_bindpw = "secret";
$ldap_base = "dc=mydomain,dc=com";
$ldap_filter = "(&(objectClass=user)(sAMAccountName={login})(!(userAccountControl:1.2.840.113556.1.4.803:=2)))";

# Active Directory mode
# true: use unicodePwd as password field
# false: LDAPv3 standard behavior
$ad_mode = true;
# Force account unlock when password is changed
$ad_options['force_unlock'] = false;
# Force user change password at next login
$ad_options['force_pwd_change'] = false;
# Allow user with expired password to change password
$ad_options['change_expired_password'] = false;



Password History for SSHA

Hello all,
It is not a issue but a feature which I miss in the project.
In fact, I would like to check if the user use a password in History defined by pwdHistory in LDAP server. (about last 6 passwords for example)
I implement only for my need this patch with SSHA. Perhaps it could be an idea if you think the feature is useful for others persons, you can do a global patch for others encryptions.

Based on Self Service password 1.0 .
pwdHistory.txt

request: disable password change?

In 2012 (reference, a user by the name of Henning suggested a patch that would allow the admin to require sending a reset-link via email in order to actually change the password. I believe the premise was to protect against brute-force attacks and uncertainty about getting "fail2ban" working.

Did that patch ever materialize? Is there a chance the feature can be instituted?

I admit it defeats some of the immediate usability (and perhaps intent) of the application. I'm willing to disable that functionality to provide a little peace-of-mind.

NL language file addition (typos and duplicates removed)

hier uw wachtwoord resetten."; $messages['answerrequired'] = "Geen antwoord gegeven"; $messages['questionrequired'] = "Geen vraag geselecteerd"; $messages['passwordrequired'] = "Het wachtwoord is verplicht"; $messages['answermoderror'] = "Uw antwoord is niet opgeslagen"; $messages['answerchanged'] = "Uw antwoord is opgeslagen"; $messages['answernomatch'] = "Uw antwoord is onjuist"; $messages['resetbyquestionshelp'] = "Kies een vraag en beantwoord deze om het wachtwoord opnieuw in te stellen. Hiervoor moet u al een antwoord hebben geregistreerd."; $messages['changehelp'] = "Voer uw huidige wachtwoord en een nieuw wachtwoord in en klik op versturen om uw wachtwoord te wijzigen"; $messages['changehelpreset'] = "Wachtwoord vergeten?"; $messages['changehelpquestions'] = "Reset uw wachtwoord door een vraag te beantwoorden"; $messages['changehelptoken'] = "Reset uw wachtwoord per email"; $messages['changehelpsms'] = "Reset uw wachtwoord door middel van een SMS bericht"; $messages['resetmessage'] = "Hallo {login},\n\nKlik hier om uw wachtwoord te resetten:\n{url}\n\nAls u geen wachtwoord reset heeft aangevraagd is het verstandig om de helpdesk op de hoogte te stellen. U kunt deze e-mail daarna verwijderen."; $messages['resetsubject'] = "Reset uw wachtwoord"; $messages['sendtokenhelp'] = "Voer uw gebruiksnaam en emailadres in om uw wachtwoord te resetten. Klik daarna op Versturen."; $messages['mail'] = "Privé e-mail"; $messages['mailrequired'] = "Emailadres is verplicht"; $messages['mailnomatch'] = "Het email adres komt niet overeen met de gebruikersnaam"; $messages['tokensent'] = "De bevestigingsmail is verstuurd"; $messages['tokennotsent'] = "Fout bij het versturen van de email"; $messages['tokenrequired'] = "Token is verplicht"; $messages['tokennotvalid'] = "Token is ongeldig"; $messages['resetbytokenhelp'] = "Het token dat per email verstuurd is, stelt u in staat uw wachtwoord te wijzigen. Om een nieuw token te verkrijgen kunt u hier klikken."; $messages['resetbysmshelp'] = "Het token dat per sms verstuurd is, stelt u in staat uw wachtwoord te wijzigen. om een nieuw token te verkrijgen kunt u, hier klikken."; $messages['changemessage'] = "Hallo {login},\n\nuw wachtwoord is aangepast.\n\nindien dit niet uw verzoek was, neem dan onmiddelijk contact op met de helpdesk."; $messages['changesubject'] = "Uw wachtwoord is aangepast"; $messages['badcaptcha'] = "De reCAPTCHA was niet correct ingevuld. Probeer het opnieuw."; $messages['notcomplex'] = "Uw wachtwoord bestaat niet uit genoeg verschillende tekens"; $messages['policycomplex'] = "Minimum aantal verschillende type tekens benodigd:"; $messages['nophpmcrypt'] = "PHP mcrypt moet geinstalleerd zijn om de cryptografische functies te kunnen gebruiken"; $messages['sms'] = "Mobiele telefoon"; $messages['smsresetmessage'] = "Uw wachtwoord reset token is:"; $messages['sendsmshelp'] = "Voer uw login informatie in om uw wachtwoord reset token te ontvangen. Voer vervolgens het token in wat toegestuurd is via SMS."; $messages['smssent'] = "Een bevestigingscode is verzonden via SMS"; $messages['smsnotsent'] = "Fout tijdens het versturen van een SMS"; $messages['smsnonumber'] = "Mobiele nummer niet gevonden"; $messages['userfullname'] = "Volledige naam van gebruiker"; $messages['username'] = "Gebruikersnaam"; $messages['smscrypttokensrequired'] = "Het is onmogelijk om de SMS functie te gebruiken zonder de 'crypt_tokens' instellingen"; $messages['smsuserfound'] = "Controleer of de informatie correct is and druk op 'Verzenden' om een SMS token te versturen"; $messages['smstoken'] = "SMS token"; $messages['smsresetmessage'] = "Uw wachtwoord reset token is:"; $messages['changehelpsms'] = "Reset uw wachtwoord door middel van een SMS"; $messages['nophpmbstring'] = "'PHP mbstring' moet geinstalleerd zijn"; $messages['getuser'] = "Haal gebruiker op"; ?>

Enforce HTTPS link in mail

Hi

I have the self-service-password tool as a docker image which is automatically proxied thru a let's encrypt HTTPS proxy docker, which means that the tool itself is reached via a HTTP url. Still the users accesses it via HTTPS. The URL that is generated in the mail for a password reset, is still using HTTP (because the tool itself sees only the HTTP access). Would it be possible to add a config option to enforce HTTPS urls? or even provide the "base URL"?

Thanks for this great tool!

KoS

request: TOTP (2FA)

I had initially suggested this in http://tools.ltb-project.org/issues/818. For reference:

Provide 2FA (TFA) as an option for verification of the user. There are some 2FA PHP modules (https://github.com/RobThree/TwoFactorAuth, https://github.com/PHPGangsta/GoogleAuthenticator) that provide sufficient access to implement it.

(It appears that the second link hasn't been touched in a couple of years, perhaps RobThree's would be preferred?)

I recognize it is not necessarily a top priority for all (or perhaps many, even), so I was considering how hard it would be to implement. Some questions I had:

  • How to store the shared secret?
    • Can it be stored within an unmodified LDAP structure? Requiring a change to the schema will many (if not most).
    • Ditto for Active Directory? (I believe AD is for the most part LDAP-compatible, but this question begs MS's AD or Samba4's AD.)
    • If neither of the above, I'm not fond of having yet another storage mechanism, whether it be on a SQL server somewhere or in a local-only SQLite database.
  • If it can be stored within LDAP, is it a mechanism that other applications might be able to use? For instance, apps like owncloud, nextcloud, and gitlab have various levels of 2FA support, but I believe they are storing it internally/proprietarily. I think it would be good to be able to use the same shared-secret across multiple clients. (Then, of course, I'd need to convince those apps to get the shared-secret and use it ...)
  • Again, if it can be stored within the LDAP structure, is it "safe enough" to store it there? Are there security considerations I'm not considering?

The current method of using SMS as a reset mechanism is useful but this sort of 2FA is no longer recommended. I'm inferring that this should also apply to email-based OOB reset links, for similar reasons.

Thoughts?

Reset password layout

On the reset password screen (via email), there is a way to modify the user name before entering the new password. This is giving the user impression he can change password for anyone.

Which actually is not true, the code logic is fine. This is only a matter of lay-out, the username field mu reman readonly and changing this input field must be forbidden.

Thanks ;)

SMS token always valid

When using reset by SMS feature, the token sent by SMS is used to create a PHP session. This PHP session is automatically deleted, but the SMS token can be reused to create a new PHP session. This token should be valid only the duration configured in $token_lifetime.

Add a menu

This can be an option. The menu will display links to each enabled actions.

Dependency check for function ldap_modify_batch()

Hi,

After setting up SSP and attempting to change a password, I got a page with the menu, icon, and no messages. The error_log file had the following messages:

[Thu Jan 05 14:38:06.521936 2017] [:error] [pid 8695] [client (me):1257] PHP Notice: Use of undefined constant LDAP_MODIFY_BATCH_REMOVE - assumed 'LDAP_MODIFY_BATCH_REMOVE' in /usr/share/self-service-password/lib/functions.inc.php on line 333, referer: http://ssp.companyname.com/index.php
[Thu Jan 05 14:38:06.522011 2017] [:error] [pid 8695] [client (me):1257] PHP Notice: Use of undefined constant LDAP_MODIFY_BATCH_ADD - assumed 'LDAP_MODIFY_BATCH_ADD' in /usr/share/self-service-password/lib/functions.inc.php on line 338, referer: http://ssp.companyname.com/index.php
[Thu Jan 05 14:38:06.522031 2017] [:error] [pid 8695] [client (me):1257] PHP Fatal error: Call to undefined function ldap_modify_batch() in /usr/share/self-service-password/lib/functions.inc.php on line 343, referer: http://ssp.companyname.com/index.php

CentOS 7's latest version of PHP is 5.4.16. ldap_modify_batch() was introduced in PHP 5.4.26 (in the 5.4 branch). After upgrading my PHP version, it ran successfully.

The dependency checker should look for this function as it's a critical dependency. And hopefully it'll help others who use the PHP version that comes standard in CentOS 7.

Thanks!

request: facilitate by-email when SMTP auth is required

The default PHP mail() is fine when authentication is not required, but this does not work in situations where the client must authenticate before sending. I know there are less-standard methods in PHP to allow authenticating-SMTP, how difficult is it to incorporate one of those methods into your package?

Thanks!

Call to undefined function utf8_decode()

Hi,
in ubuntu server 16.04 with php7 I get this error while changing the password (the error is in the logs, nothing is shown on the UI):

PHP Fatal error: Uncaught Error: Call to undefined function utf8_decode() in [...]/lib/functions.inc.php:178\nStack trace:\n#0 [...]/pages/change.php(176): check_password_strength('...', '...', Array)\n#1 [...]/index.php(173): include('[...]')\n#2 {main}\n thrown in [...]/lib/functions.inc.php on line 178, referer: [...]/index.php

I solved installing php-xml.
Maybe add a check for function_exists('utf8_decode')?

According to Stack Overflow an alternative should also be using mb_convert_encoding from mbstring, but I haven't tried that.

Allow sending SMS through web-based API instead of Email2SMS Gateway

Rather than sending SMS via email it would be great to have the functionality to execute an external script and pass the mobile number and token as arguments. Most SMS providers do not support SMS via email either for reasons of security or lack of demand (see NEXMO for instance).

release tag - it should be just 1.0

Hello,

I'm a port maintainer of SSP at FreeBSD Ports project. I'm trying to update port source so a new 1.0 version could be installed on FreeBSD.

Unfortunatelly you've made a v1.0 release no just 1.0 (as previous 0.9). So ports framework which uses codeload.github.com is not able to download self-service-password-1.0 automatically.

Could you change it?

Thanks a lot for your time.

Greetings,

session token with nginx

Hi,

the ssp is not working on my nginx.

i got this kind of error when i use the link reset via mail :

[error] 12#12: *5 FastCGI sent in stderr: "PHP message: PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/html/index.php:155) in /var/www/html/pages/sendtoken.php on line 147

due to this error, the session file ( like tmp/sess_e06b0cf4dd2e8c95428d09a2bd061211 ) are empty, so the email reset link is not working with this error : " invalid token" (due to session token file empty, due to previous error)

a ugly workarround is to to this line as first line on the /var/www/html/index.php :

Illegal passwords list

It would be great to be able to specify a list of illegal passwords in the config file, or even illegal words in password.

Corrections proposed to index.php and pages/* files

  1. In the top directory, file index.php, line 65, change from:
    $dependency_check_results = [];
    to
    $dependency_check_results = array();

  2. In the /pages subdirectory, files:
    change.php line 68, resetbyquestions.php line 69, resetbytoken.php line 106, sendsms.php line 119, sendtoken.php line 56, setquestions.php line 63, change from:
    $recaptcha = new \ReCaptcha\ReCaptcha($recaptcha_privatekey);
    to
    $recaptcha = new \ReCaptcha($recaptcha_privatekey);

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.