OTRS 6 - AD 集成 - 域管理员用户映射为代理,而不是 OTRS 管理员

OTRS 6 - AD 集成 - 域管理员用户映射为代理,而不是 OTRS 管理员

我正在使用 ITSM 模块测试 OTRS 6。目前我只在我们的 DEV 环境中测试它,所以如果这是最简单的方法,放弃一切并从头开始也不会有问题。不过,我打算很快将其投入生产。

我按照官方文档“严格按照书上的步骤”安装了它,并且效果非常好!(编辑:安装在 Ubuntu Server 18.04 LTS 上)我让所有用户使用 MySQL 上的用户数据库进行本地身份验证。我让客户、代理和管理员都能够进行身份验证并显示正确的用户面板。

之后,我成功地将 OTRS 与我的 AD 集成,但有一个问题:我的所有 AD 用户都映射为客户,我的所有域管理员(也属于 OTRS_Admins AD 组)都是代理,并且……我没有账户来管理 OTRS。根本没有管理员。

我该怎么办?如何将我的域管理员映射为 OTRS 管理员而不是代理?如何将我的一些域用户映射为代理?我做错了什么吗?我完全迷茫了。

官方文档没有太多帮助,而且我在 Google 上找不到任何有我特定需求的人。

我的(已编辑)Config.pm:

     $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';


        ### OTRS Admin Auth
        ### 
        $Self->{'AuthModule::LDAP::Host'} = '192.168.179.2';     # AD Server
        $Self->{'AuthModule::LDAP::BaseDN'} = 'dc=test,DC=local'; # Domain
        $Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';
        $Self->{'AuthModule::LDAP::GroupDN'} = 'CN=OTRS_Admins,CN=Users,DC=test,DC=local';   #OTRS Admin group
        $Self->{'AuthModule::LDAP::AccessAttr'} = 'member';
        $Self->{'AuthModule::LDAP::UserAttr'} = 'DN';
        $Self->{'AuthModule::LDAP::SearchUserDN'} = 'svc_otrs'; #OTRS service user
        $Self->{'AuthModule::LDAP::SearchUserPw'} = 'Passw0rd'; #And its passwird
        $Self->{'AuthModule::LDAP::AlwaysFilter'} = '';
        $Self->{'AuthModule::LDAP::Params'} = {
                          port => 389,
                          timeout => 120,
                          async => 0,
                          version => 3,
                          sscope => 'sub'
                        };

        ### User Sync
        ### AD <==> DB OTRS (MySQL)
        $Self->{'AuthSyncModule'} = 'Kernel::System::Auth::Sync::LDAP';
        $Self->{'AuthSyncModule::LDAP::Host'} = '192.168.179.2';      # AD SRV
        $Self->{'AuthSyncModule::LDAP::BaseDN'} = 'dc=test,DC=local'; # Domain
        $Self->{'AuthSyncModule::LDAP::UID'} = 'sAMAccountName';
        $Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'svc_otrs';         
        $Self->{'AuthSyncModule::LDAP::SearchUserPw'} = 'Passw0rd';    
        $Self->{'AuthSyncModule::LDAP::UserSyncMap'} = {
        # DB -> LDAP
        UserFirstname => 'givenName',
        UserLastname => 'sn',
        UserEmail => 'mail',
        };

        $Self->{'AuthSyncModule::LDAP::UserSyncInitialGroups'} = [
        'users', 'basic_admin',
        ];
  $Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::LDAP';
    $Self->{'Customer::AuthModule::LDAP::Host'} = '192.168.179.2';
    $Self->{'Customer::AuthModule::LDAP::BaseDN'} = 'dc=test,DC=local';    
    $Self->{'Customer::AuthModule::LDAP::UID'} = 'sAMAccountName';
    $Self->{'Customer::AuthModule::LDAP::SearchUserDN'} = 'svc_otrs';     
    $Self->{'Customer::AuthModule::LDAP::SearchUserPw'} = 'Passw0rd';     
    $Self->{CustomerUser} = {
    Module => 'Kernel::System::CustomerUser::LDAP',
    Params => {
    Host => '192.168.179.2',     # AD Server
    BaseDN => 'dc=test,DC=local',      #Domain
    SSCOPE => 'sub',
    UserDN =>'svc_otrs',     #OTRS Service User
    UserPw => 'Passw0rd',    #its password
    AlwaysFilter => '(&(samAccountType=805306368)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))',
    SourceCharset => 'utf-8',
    DestCharset => 'utf-8',
    },

    CustomerKey => 'sAMAccountName',
    CustomerID => 'mail',
    CustomerUserListFields => ['sAMAccountName', 'cn', 'mail'],
    CustomerUserSearchFields => ['sAMAccountName', 'cn', 'mail'],
    CustomerUserSearchPrefix => '',
    CustomerUserSearchSuffix => '*',
    CustomerUserSearchListLimit => 10000,
    CustomerUserPostMasterSearchFields => ['mail'],
    CustomerUserNameFields => ['givenname', 'sn'],
    Map => [
    # note: Login, Email and CustomerID needed!
    #[ 'UserSalutation', 'Title', 'title', 1, 0, 'var' ],
    [ 'UserFirstname', 'Firstname', 'givenname', 1, 1, 'var' ],
    [ 'UserLastname', 'Lastname', 'sn', 1, 1, 'var' ],
    [ 'UserLogin', 'Login', 'sAMAccountName', 1, 1, 'var' ],
    [ 'UserEmail', 'Email', 'mail', 1, 1, 'var' ],
    [ 'UserCustomerID', 'CustomerID', 'mail', 0, 1, 'var' ],
    [ 'UserPhone', 'Phone', 'telephonenumber', 1, 0, 'var' ],
    #[ 'UserAddress', 'Address', 'postaladdress', 1, 0, 'var' ],
    #[ 'UserComment', 'Comment', 'description', 1, 0, 'var' ],
    ],
    };

答案1

事实上,这是一个由三部分组成的问题:

  1. 当我使用 LDAP 后端时,我丢失了 DB 后端的用户(包括 root@localhost 超级用户)
  2. LDAP 后端的代理用户没有管理员权限
  3. OTRS 文档有些地方有点过时

问题 1:丢失了我的数据库后端 在中Config.pm,我插入了以下行来选择代理后端:

$Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';

嗯,这一行的作用是覆盖系统中其他地方的原始后端选择器。因此,为了拥有 DB 后端管理员用户以及 LDAP 代理用户,您应该使用 OTRS 自己的(和记录的!)方法来拥有多个后端,即在模块实例后附加数字后缀(请注意 de1紧接着AuthModule):

$Self->{'AuthModule1'} = 'Kernel::System::Auth::LDAP';

当然,你必须在所有模块的属性中都输入数字:

$Self->{'AuthModule::LDAP::Host1'} = '192.168.xx.xx';    
$Self->{'AuthModule::LDAP::BaseDN1'} = 'dc=test,DC=local'; 
$Self->{'AuthModule::LDAP::UID1'} = 'sAMAccountName';
$Self->{'AuthModule::LDAP::GroupDN1'} = CN=GS_OTRS_Agents,CN=Users,DC=test,DC=local';
$Self->{'AuthModule::LDAP::AccessAttr1'} = 'member';
$Self->{'AuthModule::LDAP::UserAttr1'} = 'DN';
$Self->{'AuthModule::LDAP::SearchUserDN1'} = 'OTRS';    #OTRS LDAP User
$Self->{'AuthModule::LDAP::SearchUserPw1'} = 'somepass'; #Password for the LDAP User
$Self->{'AuthModule::LDAP::AlwaysFilter1'} = '';
$Self->{'AuthModule::LDAP::Params1'} = {
                  port => 389,
                  timeout => 120,
                  async => 0,
                  version => 3,
                  sscope => 'sub'
                };    

(将其与上面原始问题中发布的代码进行比较。)

公平地说,OTRS 管理手册中有一节解释了如何更改后端以及如何拥有多个后端。但是缺少了有关如果使用$Self->{'AuthModule'}而不是$Self->{'AuthModule1'}将覆盖本机 DB 后端而不是同时运行这两个后端的信息。花了很多脑力才弄清楚这一点。

这解决了失去管理员用户的问题,这些用户都在原始数据库后端。所有 LDAP 代理都不是完全管理员,因此他们可以回答工单,但不能以管理员身份管理 OTRS 系统。这样,我就拥有了两种用户。

这引出了第二个问题。

问题 2:LDAP 后端的代理用户没有管理员权限

我的意思是,我必须能够在我的 AD 上创建代理用户,并且他/她也应该能够成为管理员。而且他们确实是!

`$Self->{'AuthSyncModule::LDAP::UserSyncInitialGroups'} = [
'users',
];`

如果我不仅将“用户”添加到该列表中,还将“basic_admin”添加到该列表中,那么我的所有初始代理也将是管理员。我可以稍后撤销他们的管理员权限,但由于问题 1,我被锁定在 OTRS 之外,没有管理员用户,因此我无法授予或撤销任何人的管理员权限。

毕竟,我选择保持现状,并以用户身份创建我的代理,因为我已经将我的原始 root@localhost 用户设置为管理员(因为我已经解决了问题 1),并且将手动授予我所有未来管理员的管理员权限。但这是 OTRS 管理手册中另一个记录不太好的细节。

问题 3:OTRS 管理手册未完全更新

我理解,对于所有开源项目来说,这种情况时有发生。但是,到处都存在一些陷阱,这是由于从未更新的 OTRS 的先前版本继承而来的误导性信息造成的。例如,有些属性在手册中提到,但对版本 6 无效。

我偶然发现了一个适用于版本 5 并且未从版本 6 中清除的版本。我的意思是,指向属性的 QuickRef 页面的链接已被删除,因为该页面 - 以及属性 - 不再存在,但它仍然在手册的其他地方的重要配置部分中被提及。

相关内容