根据《EJBCA部署、使用并发布至LDAP》及《EJBCA发邮件通知》一文,我们可以实现:
1、EJBCA中新建End Entity,自动生成随机的Enrollment Code;
2、邮件通知End Entity对应的用户;
3、用户自行到EJBCA提交CSR进行Enrollment;
4、EJBCA到LDAP中创建对应用户并推送证书;
上述的过程依然缺了一个环节,就是LDAP用户密码的生成。毕竟,我们不能手工给用户指定一个密码。
这时,我们有两个选择:
1、Self Service Password,https://github.com/ltb-project/self-service-password
2、PWM,https://github.com/pwm-project/pwm
对比这两个项目,在功能上基本上都能满足我们的要求。Self Service Password更加陈旧,是用PHP写的;PWM项目更新,功能比Self Service Password更强大,但看上去对LDAP要求进行的配置也更复杂。由于我们只需要实现基本的密码重置、设置等需求,因此选择使用Docker版的Self Service Password(https://github.com/tiredofit/docker-self-service-password)。
这个Github上Docker里的example给的docker-compose配置文件有不少问题,主要包括两点:
1、docker-compose中不应该再加引号,否则在docker中生成的配置文件会多一个引号,会有一堆如下这样的报错:
1 |
Parse error: syntax error, unexpected '""' (T_CONSTANT_ENCAPSED_STRING) in /www/ssp/conf/config.inc.php on line 103 |
2、有一个配置项复制粘贴错了:

Self Service Password的Docker配置文件错误
SSP本身不支持SSL,在前面加了一个反向代理:

Self Service Password Docker的端口

Self Service Password反向代理
Docker容器内部/www/ssp/conf/config.inc.php有个reset_url也需要处理一下,这个reset_url会体现在密码重置的邮件中。可以看到reset_url实际是通过header拼出来的,因此反向代理必须传对应的header,否则就会报错:

SSP的reset-url配置错误

Self Service Password的reset_url
端口直接偷懒写死了。
转载时请保留出处,违法转载追究到底:进城务工人员小梅 » 使用SSP(Self Service Password)管理LDAP中的密码