kolab/kolab_2fa

此包已被废弃且不再维护。未建议替代包。

Kolab 2-Factor Authentication

3.5.5.2 2021-03-06 20:45 UTC

This package is auto-updated.

Last update: 2023-09-07 02:09:12 UTC


README

此为从 https://git.kolab.org/diffusion/RPK/ 克隆而来
有关错误报告和拉取请求,请访问 https://kolab.org/

如何升级此克隆

执行 synchronise_with_source.sh 脚本。

Kolab 多因素认证插件

该插件旨在作为不同第二因素认证机制和存储Roundcube用户账户相关数据的不同方式的通用容器。驱动程序和存储后端都源自定义了公共接口且可配置的抽象类。

驱动程序

可以为用户启用多种第二因素认证方法以供选择。基本实现包括TOTP、HOTP和Yubikey方法。

TOTP (RFC 6238) 和HOTP (RFC 4226) 可以与可免费获取的手机应用程序(如FreeOTP(仅支持TOTP)或Google Authenticator)一起使用。为应用程序配置账户设置时,会显示一个二维码,可以用手机摄像头扫描。

Yubikey驱动程序使用Yubico验证服务,可通过使用公共YubiCloud API或另一个本地托管验证服务器来实现。可用于验证的主机是可配置的。

存储后端

某些认证方法需要在服务器上为每个用户账户存储秘密数据。为此,可以选择不同的存储后端之一。

Roundcube

最简单的方法是将认证秘密和配置存储在Roundcube本身的用户偏好中。

LDAP

对于外部存储选项,可以使用LDAP模块。这会将认证数据与Roundcube用户数据库分开。有关更多信息,请参阅下面的“LDAP存储”。LDAP连接参数通过kolab_2fa_storage_config配置选项定义。

安装

将插件内容放入Roundcube的插件目录后,需要使用Composer安装第三方库

$ composer require "endroid/qrcode" "~1.5.0" --no-update
$ composer require "spomky-labs/otphp" "~5.0.0" --no-update
$ composer require "enygma/yubikey" "~3.2"

有关实际模块名称和版本,请参阅composer.json文件。

配置

将示例config.inc.php.dist文件复制到config.inc.php,并根据您的需求调整设置。所有选项都在示例文件中通过内联注释进行了描述。

当使用LDAP存储与Kolab安装一起时,您可能希望在每次登录时保存额外的LDAP查找以进行身份验证因素,LDAP驱动程序可以在注册身份验证因素时为用户记录分配角色(请参阅user_roles存储配置选项)。通过以下对kolab_auth插件配置的添加,这些角色可以用来确定用户是否启用了多因素身份验证。

// Disable lokkups by default:
$config['kolab_2fa_check'] = false;

// Enable 2nd factor lookup on a role-by-role basis
$config['kolab_auth_role_settings'] = array(
    'cn=totp-user,dc=example,dc=org' => array(
        'kolab_2fa_check' => array(
            'mode' => 'override',
            'value' => true,
        ),
    ),
);

LDAP存储

定义一个DN为ou=Tokens,dc=example,dc=orgorganizationalunit来存储所有身份验证令牌。

对于令牌记录,可以使用[[https://git.fedorahosted.org/cgit/freeipa.git/tree/install/share/70ipaotp.ldif | FreeIPA OTP模式]]。请在您的Kolab LDAP目录中安装此模式。

这是为注册到用户doe@example.org的TOTP令牌的一个示例记录

dn: ipatokenUniqueID=totp:c4a1ced768a0da55df662e73,ou=Tokens,dc=example,dc=org
objectClass: top
objectClass: ipaToken
objectClass: ipatokenTOTP
objectClass: ldapSubEntry
cn: Mobile App (TOTP)
ipatokenUniqueID: totp:c4a1ced768a0da55df662e73
ipatokenOwner: uid=doe,ou=People,dc=example,dc=org
ipatokenNotBefore: 201506110211Z
ipatokenOTPkey: 4T5CI7SOKWYQ5JTM
ipatokenDisabled: TRUE