2015-06-04 15:53:04 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Kolab 2-Factor-Authentication plugin configuration
|
|
|
|
*
|
|
|
|
* Copyright (C) 2015, Kolab Systems AG <contact@kolabsys.com>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2015-06-04 16:18:56 +02:00
|
|
|
// available methods/providers. Supported methods are: 'totp','hotp','yubikey'
|
2015-06-09 09:58:32 +02:00
|
|
|
$config['kolab_2fa_drivers'] = array('totp');
|
2015-06-04 15:53:04 +02:00
|
|
|
|
|
|
|
// backend for storing 2-factor-auth related per-user settings
|
|
|
|
// available backends are: 'roundcube', 'ldap', 'sql'
|
|
|
|
$config['kolab_2fa_storage'] = 'roundcube';
|
|
|
|
|
|
|
|
// additional config options for the above storage backend
|
|
|
|
// here an example for the LDAP backend:
|
|
|
|
$config['kolab_2fa_storage_config'] = array(
|
2015-06-11 16:38:47 +02:00
|
|
|
'debug' => false,
|
2015-06-04 15:53:04 +02:00
|
|
|
'hosts' => array('localhost'),
|
|
|
|
'port' => 389,
|
2015-06-11 16:38:47 +02:00
|
|
|
'bind_dn' => 'uid=kolab-auth-service,ou=Special Users,dc=example,dc=org',
|
2015-06-04 15:53:04 +02:00
|
|
|
'bind_pass' => 'Welcome2KolabSystems',
|
2015-06-11 16:38:47 +02:00
|
|
|
'base_dn' => 'ou=Tokens,dc=example,dc=org',
|
|
|
|
// filter used to list stored factors for a user
|
|
|
|
'filter' => '(&(objectClass=ipaToken)(objectclass=ldapSubEntry)(ipatokenOwner=%fu))',
|
2015-06-04 15:53:04 +02:00
|
|
|
'scope' => 'sub',
|
2015-06-11 16:38:47 +02:00
|
|
|
// translates driver properties to LDAP attributes
|
2015-06-04 15:53:04 +02:00
|
|
|
'fieldmap' => array(
|
2015-06-11 16:38:47 +02:00
|
|
|
'label' => 'cn',
|
|
|
|
'id' => 'ipatokenUniqueID',
|
|
|
|
'active' => 'ipatokenDisabled',
|
|
|
|
'created' => 'ipatokenNotBefore',
|
|
|
|
'userdn' => 'ipatokenOwner',
|
|
|
|
'secret' => 'ipatokenOTPkey',
|
|
|
|
// HOTP attributes
|
|
|
|
'counter' => 'ipatokenHOTPcounter',
|
|
|
|
'digest' => 'ipatokenOTPalgorithm',
|
|
|
|
'digits' => 'ipatokenOTPdigits',
|
2015-06-09 09:58:32 +02:00
|
|
|
),
|
2015-06-11 16:38:47 +02:00
|
|
|
// LDAP object classes derived from factor IDs (prefix)
|
|
|
|
// will be translated into the %c placeholder
|
|
|
|
'classmap' => array(
|
|
|
|
'totp:' => 'ipatokenTOTP',
|
|
|
|
'hotp:' => 'ipatokenHOTP',
|
|
|
|
'*' => 'ipaToken',
|
|
|
|
),
|
|
|
|
// translates property values into LDAP attribute values and vice versa
|
2015-06-09 09:58:32 +02:00
|
|
|
'valuemap' => array(
|
2015-06-11 16:38:47 +02:00
|
|
|
'active' => array(
|
|
|
|
false => 'TRUE',
|
|
|
|
true => 'FALSE',
|
2015-06-09 09:58:32 +02:00
|
|
|
),
|
2015-06-04 15:53:04 +02:00
|
|
|
),
|
2015-06-11 16:38:47 +02:00
|
|
|
// specify non-string data types for properties for implicit conversion
|
|
|
|
'attrtypes' => array(
|
|
|
|
'created' => 'datetime',
|
|
|
|
'counter' => 'integer',
|
|
|
|
'digits' => 'integer',
|
|
|
|
),
|
|
|
|
// apply these default values to factor records if not specified by the drivers
|
|
|
|
'defaults' => array(
|
|
|
|
'active' => false,
|
|
|
|
// these are required for ipatokenHOTP records and should match the kolab_2fa_hotp parameters
|
|
|
|
'digest' => 'sha1',
|
|
|
|
'digits' => 6,
|
|
|
|
),
|
|
|
|
// use this LDAP attribute to compose DN values for factor entries
|
|
|
|
'rdn' => 'ipatokenUniqueID',
|
|
|
|
// assign these object classes to new factor entries
|
|
|
|
'objectclass' => array(
|
|
|
|
'top',
|
|
|
|
'ipaToken',
|
|
|
|
'%c',
|
|
|
|
'ldapSubEntry',
|
|
|
|
),
|
|
|
|
// add these roles to the user's LDAP record if key prefix-matches a factor entry
|
|
|
|
'user_roles' => array(
|
|
|
|
'totp:' => 'cn=totp-user,dc=example,dc=org',
|
|
|
|
'hotp:' => 'cn=hotp-user,dc=example,dc=org',
|
|
|
|
),
|
2015-06-04 15:53:04 +02:00
|
|
|
);
|
|
|
|
|
2015-06-11 16:38:47 +02:00
|
|
|
// force a lookup for active authentication factors for this user.
|
2015-06-04 16:18:56 +02:00
|
|
|
// to be set by another plugin (e.g. kolab_auth based on LDAP roles)
|
2015-06-11 16:38:47 +02:00
|
|
|
// $config['kolab_2fa_check'] = true;
|
2015-06-04 15:53:04 +02:00
|
|
|
|
|
|
|
// timeout for 2nd factor auth submission (in seconds)
|
2017-09-29 12:06:49 +02:00
|
|
|
$config['kolab_2fa_timeout'] = 120;
|
2015-06-04 15:53:04 +02:00
|
|
|
|
|
|
|
// configuration parameters for TOTP (uncomment to adjust)
|
|
|
|
$config['kolab_2fa_totp'] = array(
|
|
|
|
// 'digits' => 6,
|
|
|
|
// 'interval' => 30,
|
|
|
|
// 'digest' => 'sha1',
|
|
|
|
// 'issuer' => 'Roundcube',
|
|
|
|
);
|
|
|
|
|
|
|
|
// configuration parameters for HOTP (uncomment to adjust)
|
|
|
|
$config['kolab_2fa_hotp'] = array(
|
|
|
|
// 'digits' => 6,
|
|
|
|
// 'window' => 4,
|
|
|
|
// 'digest' => 'sha1',
|
|
|
|
);
|
|
|
|
|
|
|
|
// configuration parameters for Yubikey (uncomment to adjust)
|
|
|
|
$config['kolab_2fa_yubikey'] = array(
|
|
|
|
'clientid' => '123456',
|
|
|
|
'apikey' => '<your-server-api-key>',
|
|
|
|
// 'hosts' => array('api.myhost1.com','api2.myhost.com'),
|
2016-11-09 09:55:34 +01:00
|
|
|
'use_https' => true, // connect via https if set to true
|
2015-06-04 15:53:04 +02:00
|
|
|
);
|