chonta
Goto Top

OTRS LDAP Gruppen Sync

Hallo zusammen,

miene OTRS Fragen nehmen kein ende.
Die Frage steht auch schon im OTRS Forum aber hier habe ich bisher immer schneller Antworten bekomme und es ist ja nicht jeder auch im OTRS Forum unterwegs der OTRS nutzt.

Zum Problem.
Ich habe OTRS mir dem AD verbunden und die Agenten werden beim ersten einloggen auch angelegt.
Das Problem ist ich will nun auch Gruppen oder Rollen zugehöhrigkeit anhand von AD Gruppenzugehöhrigkeit vergeben.
Das klappt leider nicht....
Es funktioniert nur das hinzufügen der Initialgruppe, aber ein Mapping zwischen mitgleidschaft in einer AD-Gruppe zu einer OTRS-Gruppe geht nicht.
Hier meine Konfig, ich hoffe ihr könnt mir sagen wo der Fehler ist.

# This is an example configuration for using an MS AD backend
    $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';  
    $Self->{'AuthModule::LDAP::Host'} = 'FQDN-DC';  
    $Self->{'AuthModule::LDAP::BaseDN'} = 'dc=domäne,dc=tdl';  
    $Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';  

    # Check if the user is allowed to auth in a posixGroup
    # (e. g. user needs to be in a group OTRS_Agents to use otrs)
    $Self->{'AuthModule::LDAP::GroupDN'} = 'CN=sec_OTRS_users,OU=Sicherheitsgruppen,OU=Groups,DC=domäne,DC=tdl';  
    $Self->{'AuthModule::LDAP::AccessAttr'} = 'member';  
    $Self->{'AuthModule::LDAP::UserAttr'} = 'DN';  

    # Bind credentials to log into AD
    $Self->{'AuthModule::LDAP::SearchUserDN'} = 'CN=otrs user,OU=Dienst-Konten,OU=Users,DC=domäne,DC=tdl';  
    $Self->{'AuthModule::LDAP::SearchUserPw'} = 'passwort';  

    # in case you want to add always one filter to each ldap query, use
    # this option. e. g. AlwaysFilter => '(mail=*)' or AlwaysFilter => '(objectclass=user)' 
    $Self->{'AuthModule::LDAP::AlwaysFilter'} = '';  

    # Net::LDAP new params (if needed - for more info see perldoc Net::LDAP)
    $Self->{'AuthModule::LDAP::Params'} = {  
        port => 389,
        timeout => 120,
        async => 0,
        version => 3,
    };

# Now sync data with OTRS DB
    $Self->{'AuthSyncModule'} = 'Kernel::System::Auth::Sync::LDAP';  
    $Self->{'AuthSyncModule::LDAP::Host'} = 'fqdn-dc';  
    $Self->{'AuthSyncModule::LDAP::BaseDN'} = 'dc=domäne,dc=tdl';  
    $Self->{'AuthSyncModule::LDAP::UID'} = 'sAMAccountName';  
    $Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'CN=otrs user,OU=Dienst-Konten,OU=Users,DC=domäne,DC=tdl';  
    $Self->{'AuthSyncModule::LDAP::SearchUserPw'} = 'passwort';  

    $Self->{'AuthSyncModule::LDAP::UserSyncMap'} = {  
        # DB -> LDAP
        UserFirstname => 'givenName',  
        UserLastname  => 'sn',  
        UserEmail     => 'mail',  
    };

    # AuthSyncModule::LDAP::UserSyncInitialGroups
    # (sync following group with rw permission after initial create of first agent
    # login)
    $Self->{'AuthSyncModule::LDAP::UserSyncInitialGroups'} = [  
        'users',  
    ];
        # AuthSyncModule::LDAP::UserSyncGroupsDefinition
    # (If "LDAP" was selected for AuthModule and you want to sync LDAP 
    # groups to otrs groups, define the following.)
    $Self->{'AuthSyncModule::LDAP::UserSyncGroupsDefinition'} = {  
        # ldap group
        'CN=sec_OTRS_Verwaltung_Berlin,OU=Sicherheitsgruppen,OU=Groups,DC=domäne,DC=tdl' => {  
            # otrs group
            'gr_Verwaltung' => {  
                # permission
                rw => 1,
                ro => 1,
            },
        'CN=sec_OTRS_move_into_Verwaltung,OU=Sicherheitsgruppen,OU=Groups,DC=domäne,DC=tdl' => {  
            'gr_Verwaltung' => {  
                move_into => 1,
            },
        },

        }
    };

Content-Key: 340185

Url: https://administrator.de/contentid/340185

Printed on: April 23, 2024 at 13:04 o'clock

Member: Chonta
Chonta Jun 13, 2017 at 10:15:58 (UTC)
Goto Top
So habe den Fehler gefunden:
$Self->{'AuthSyncModule::LDAP::AccessAttr'} = 'member';
$Self->{'AuthSyncModule::LDAP::UserAttr'} = 'DN';

Diese beiden Zeilen mussten noch im Syncblock angegeben werden, ohne diese wird ein falscher Filter verwendet. Wenn das Loglevel auf nitiz gestellt wird, kann man das sehen.
Es ist kein Fehler, Die Gruppe wird richtig durchsucht, aber halt nach dem Falschen Inhalt, der dann nicht gefunden wird und damit erfolgt auch keine Zuordnung.
Hier die Angepasste Config (ein Klammerfehler ist auch korrigiert)

# This is an example configuration for using an MS AD backend
    $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';  
    $Self->{'AuthModule::LDAP::Host'} = 'FQDN-DC';  
    $Self->{'AuthModule::LDAP::BaseDN'} = 'dc=domäne,dc=tdl';  
    $Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';  

    # Check if the user is allowed to auth in a posixGroup
    # (e. g. user needs to be in a group OTRS_Agents to use otrs)
    $Self->{'AuthModule::LDAP::GroupDN'} = 'CN=sec_OTRS_users,OU=Sicherheitsgruppen,OU=Groups,DC=domäne,DC=tdl';  
    $Self->{'AuthModule::LDAP::AccessAttr'} = 'member';  
    $Self->{'AuthModule::LDAP::UserAttr'} = 'DN';  

    # Bind credentials to log into AD
    $Self->{'AuthModule::LDAP::SearchUserDN'} = 'CN=otrs user,OU=Dienst-Konten,OU=Users,DC=domäne,DC=tdl';  
    $Self->{'AuthModule::LDAP::SearchUserPw'} = 'passwort';  

    # in case you want to add always one filter to each ldap query, use
    # this option. e. g. AlwaysFilter => '(mail=*)' or AlwaysFilter => '(objectclass=user)' 
    $Self->{'AuthModule::LDAP::AlwaysFilter'} = '';  

    # Net::LDAP new params (if needed - for more info see perldoc Net::LDAP)
    $Self->{'AuthModule::LDAP::Params'} = {  
        port => 389,
        timeout => 120,
        async => 0,
        version => 3,
    };

# Now sync data with OTRS DB
    $Self->{'AuthSyncModule'} = 'Kernel::System::Auth::Sync::LDAP';  
    $Self->{'AuthSyncModule::LDAP::Host'} = 'fqdn-dc';  
    $Self->{'AuthSyncModule::LDAP::BaseDN'} = 'dc=domäne,dc=tdl';  
    $Self->{'AuthSyncModule::LDAP::UID'} = 'sAMAccountName';  
    $Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'CN=otrs user,OU=Dienst-Konten,OU=Users,DC=domäne,DC=tdl';  
    $Self->{'AuthSyncModule::LDAP::SearchUserPw'} = 'passwort';  
    $Self->{'AuthSyncModule::LDAP::AccessAttr'} = 'member';  
    $Self->{'AuthSyncModule::LDAP::UserAttr'} = 'DN';  

    $Self->{'AuthSyncModule::LDAP::UserSyncMap'} = {  
        # DB -> LDAP
        UserFirstname => 'givenName',  
        UserLastname  => 'sn',  
        UserEmail     => 'mail',  
    };

    # AuthSyncModule::LDAP::UserSyncInitialGroups
    # (sync following group with rw permission after initial create of first agent
    # login)
    $Self->{'AuthSyncModule::LDAP::UserSyncInitialGroups'} = [  
        'users',  
    ];
        # AuthSyncModule::LDAP::UserSyncGroupsDefinition
    # (If "LDAP" was selected for AuthModule and you want to sync LDAP 
    # groups to otrs groups, define the following.)
    $Self->{'AuthSyncModule::LDAP::UserSyncGroupsDefinition'} = {  
        # ldap group
        'CN=sec_OTRS_Verwaltung_Berlin,OU=Sicherheitsgruppen,OU=Groups,DC=domäne,DC=tdl' => {  
            # otrs group
            'gr_Verwaltung' => {  
                # permission
                rw => 1,
                ro => 1,
            },
        },
        'CN=sec_OTRS_move_into_Verwaltung,OU=Sicherheitsgruppen,OU=Groups,DC=domäne,DC=tdl' => {  
            'gr_Verwaltung' => {  
                move_into => 1,
            },
        }
    };
Member: BeatYa
BeatYa Jul 13, 2017 updated at 10:26:21 (UTC)
Goto Top
Wow, astrein! Danke!
Ich habe auf otterhub oÄ einmal wieder nur schlecht erklärte Auszüge des ganzen gefunden.
Es ist das erste mal, dass ich auf Administrator.de eine umfassende Erklärung zu einem Thema finde, in welcher noch nicht einmal etwas vergessen wurde.

Danke! Weiter so!

->
    # AuthSyncModule::LDAP::UserSyncInitialGroups
    # (sync following group with rw permission after initial create of first agent
    # login)
    $Self->{'AuthSyncModule::LDAP::UserSyncInitialGroups'} = [  
        'users',  
    ];
        # AuthSyncModule::LDAP::UserSyncGroupsDefinition
    # (If "LDAP" was selected for AuthModule and you want to sync LDAP 
    # groups to otrs groups, define the following.)
    $Self->{'AuthSyncModule::LDAP::UserSyncGroupsDefinition'} = {  
        # ldap group
        'CN=sec_OTRS_Verwaltung_Berlin,OU=Sicherheitsgruppen,OU=Groups,DC=domäne,DC=tdl' => {  
            # otrs group
            'gr_Verwaltung' => {  
                # permission
                rw => 1,
                ro => 1,
            },
        },
        'CN=sec_OTRS_move_into_Verwaltung,OU=Sicherheitsgruppen,OU=Groups,DC=domäne,DC=tdl' => {  
            'gr_Verwaltung' => {  
                move_into => 1,
            },
        }
    };

ich musste jedoch den ersten Punkt
            'gr_Verwaltung' => {  
                # permission
                rw => 1,
                ro => 1,
            },
        },

durch den zweiten Punkt

 
       'CN=sec_OTRS_move_into_Verwaltung,OU=Sicherheitsgruppen,OU=Groups,DC=domäne,DC=tdl' => {  
            'gr_Verwaltung' => {  
                move_into => 1,
            },
        }
    };


ersetzen, da gesetzte Einstellungen beim ersten Punkt nicht gegriffen haben.
Da stört sich OTRS wohl an dem Komma hinter der Klammer.


Wenn das Ganze nun auch noch für die Kundenbenutzer-Gruppen funktionieren würde ....^^
Member: Chonta
Chonta Aug 03, 2017 at 11:33:13 (UTC)
Goto Top
Hallo,

freut mich dass ich helfen konnte.
Das einbinden der LDAP Backends für Kunden sollte genauso funktionieren und es müssten sogar verschiedene LDAP angebunden werden könen.
Hast Du das schon gelößt?

Gruß

Chonta