Włączanie uwierzytelniania zewnętrznego

Edge for Private Cloud wer. 4.17.09

Ta sekcja wyjaśnia, jak uzyskać, zainstalować i skonfigurować komponenty wymagane do integracji zewnętrznej usługi LDAP z Apigee Edge w celu uwierzytelniania użytkowników.

Wymagania wstępne

  • Musisz mieć instalację Apigee Edge for Private Cloud 4.17.09.
  • Aby przeprowadzić tę instalację, musisz mieć dane logowania globalnego administratora systemu w Apigee Edge for Private Cloud.
  • Musisz znać katalog główny instalacji Apigee Edge dla chmury prywatnej. Domyślnym katalogiem głównym jest /opt.
  • Musisz dodać dane logowania administratora globalnego systemu Edge do zewnętrznego LDAP. Pamiętaj, że domyślnie dane logowania sysadmin są przechowywane w wewnętrznym LDAP Edge. Gdy przełączysz się na zewnętrzny LDAP, dane logowania administratora sysadmin zostaną uwierzytelnione w tym miejscu. Dlatego przed włączeniem uwierzytelniania zewnętrznego w Edge musisz udostępnić dane logowania w systemie zewnętrznym.

    Jeśli na przykład skonfigurowano i zainstalowano Apigee Edge dla Private Cloud z danymi logowania administratora globalnego systemu:

    nazwa użytkownika: edgeuser@mydomain.com
    hasło: Secret123

    W zewnętrznym LDAP musi być też widoczny użytkownik edgeuser@mojadomena.com z hasłem Secret123.
  • Jeśli korzystasz z klastra serwera zarządzania, pamiętaj, że w przypadku każdego serwera zarządzania musisz wykonać wszystkie czynności opisane w tym dokumencie.

Konfigurowanie uwierzytelniania zewnętrznego

Główne zadanie, które wykonasz, to skonfigurowanie pliku management-server.properties. Ta aktywność obejmuje zatrzymanie i uruchomienie serwera zarządzania brzegiem, podjęcie decyzji o tym, czy chcesz używać wiązania bezpośredniego czy pośredniego, szyfrowanie poufnych danych logowania i inne powiązane zadania.

  1. Ważne: zdecyduj teraz, czy chcesz korzystać z metody uwierzytelniania pośredniego czy bezpośredniego wiązania. Ta decyzja wpłynie na niektóre aspekty konfiguracji. Zobacz Uwierzytelnianie zewnętrzne.
  2. Ważne: te kroki konfiguracji musisz wykonać na każdym serwerze Apigee Edge Management (jeśli korzystasz z więcej niż 1 serwera).
  3. Otwórz plik /opt/apigee/customer/application/management-server.properties w edytorze tekstu. Jeśli plik nie istnieje, utwórz go.
  4. Dodaj ten wiersz. Uwaga: upewnij się, że na końcu wiersza nie ma spacji.

    conf_security_authentication.user.store=externalized.authentication

    Ten wiersz dodaje funkcję uwierzytelniania zewnętrznego do instalacji brzegowej chmury prywatnej.
  5. Aby ułatwić ten krok, utworzyliśmy 2 dobrze skomentowane przykładowe konfiguracje – jedną do uwierzytelniania bezpośredniego i drugą do uwierzytelniania pośredniego. Zapoznaj się z przykładami wiązania, których chcesz użyć, i dokończ konfigurację:

    Przykład konfiguracji wiązania BEZPOŚREDNIEGO
    Przykład konfiguracji wiązania POŚREDNIEgo
  6. Ponownie uruchom serwer zarządzania:
    > /opt/apigee/apigee-service/bin/apigee-service Edge-management-server restart
  7. Sprawdź, czy serwer działa:
    > /opt/apigee/apigee-service/bin/apigee-all status
  8. Ważne: musisz przeprowadzić dodatkową konfigurację w jednej lub obu tych sytuacjach: (a) jeśli chcesz, aby użytkownicy logowali się, używając nazw użytkowników, które nie są adresami e-mail. W tym przypadku użytkownik sysadmin musi też uwierzytelnić się przy użyciu nazwy użytkownika i/lub (b) jeśli hasło do konta użytkownika sysadmin w zewnętrznym LDAP jest inne niż hasło skonfigurowane podczas pierwszej instalacji Apigee Edge dla Private Cloud. Zobacz Wymagana konfiguracja dla różnych danych logowania sysadmin.

Przykład konfiguracji DIRECT BINDING

## The first property is always required to enable the external authorization feature. Do not change it.
conf_security_externalized.authentication.implementation.class=com.apigee.rbac.impl.LdapAuthenticatorImpl

## Identify the type of binding:
# Set to "true" for direct binding
# Set to "false" for indirect binding. 
conf_security_externalized.authentication.bind.direct.type=true

## The next seven properties are needed regardless of direct or indirect binding. You need to configure these per your external authentication installation. 
## The IP or domain for your external LDAP instance. 
conf_security_externalized.authentication.server.url=ldap://localhost:389

## Your external LDAP server version.
conf_security_externalized.authentication.server.version=3

## The server timeout in milliseconds. 
conf_security_externalized.authentication.server.conn.timeout=50000

## Change these baseDN values to match your external LDAP service. This attribute value will be provided by your external LDAP administrator, and may have more or fewer dc elements depending on your setup.
conf_security_externalized.authentication.user.store.baseDN=dc=apigee,dc=com

## Do not change this search string. It is used internally. 
conf_security_externalized.authentication.user.store.search.query=(&(${userAttribute}=${userId}))

## Identifies the external LDAP property you want to bind against for Authentication. For example if you are binding against an email address, this would typically be in the userPrincipalName property in your external LDAP instance. Alternatively if you are binding against the user’s ID, this would typically be in the sAMAccountName property:
conf_security_externalized.authentication.user.store.user.attribute=userPrincipalName

## The LDAP attribute where the user email value is stored. For direct binding, set it to userPrincipalName.
conf_security_externalized.authentication.user.store.user.email.attribute=userPrincipalName

## ONLY needed for DIRECT binding.
## The direct.bind.user.directDN property defines the string that is used for the bind against the external authentication service. Ensure it is set as follows:
conf_security_externalized.authentication.direct.bind.user.directDN=${userDN}

Przykład konfiguracji POWIĄZANIA POŚREDNIEgo

## Required to enable the external authorization feature. Do not change it.
conf_security_externalized.authentication.implementation.class=com.apigee.rbac.impl.LdapAuthenticatorImpl

## Identifies the type of binding:
# Set to "true" for direct binding
# Set to "false" for indirect binding. 
conf_security_externalized.authentication.bind.direct.type=false

## The next seven properties are needed regardless of direct or indirect binding. You need to configure these per your external LDAP installation. 
## The IP or domain for your external LDAP instance. 
conf_security_externalized.authentication.server.url=ldap://localhost:389

## Replace with your external LDAP server version.
conf_security_externalized.authentication.server.version=3

## Set the server timeout in milliseconds. 
conf_security_externalized.authentication.server.conn.timeout=50000

## Change these baseDN values to match your external LDAP service. This attribute value will be provided by your external LDAP administrator, and may have more or fewer dc elements depending on your setup.
conf_security_externalized.authentication.user.store.baseDN=dc=apigee,dc=com

## Do not change this search string. It is used internally. 
conf_security_externalized.authentication.user.store.search.query=(&(${userAttribute}=${userId}))

## Identifies the external LDAP property you want to bind against for Authentication. For example if you are binding against an email address, this would typically be in the userPrincipalName property in your external LDAP instance. Alternatively if you are binding against the user’s ID, this would typically be in the sAMAccountName property. See also "Configuration required for different sysadmin credentials".
conf_security_externalized.authentication.user.store.user.attribute=userPrincipalName

## Used by Apigee to perform the Authorization step and currently, Apigee only supports email address for Authorization. Make sure to set it to the attribute in your external LDAP that stores the user’s email address. Typically this will be in the userPrincipalName property. 
conf_security_externalized.authentication.user.store.user.email.attribute=userPrincipalName

## The external LDAP username (for a user with search privileges on the external LDAP) and password and whether the password is encrypted. You must also set the attribute externalized.authentication.bind.direct.type to false.
## The password attribute can be encrypted or in plain text. See "Indirect binding only: Encrypting the external LDAP user’s password" for encryption instructions. Set the password.encrypted attribute to "true" if the password is encrypted. Set it to "false" if the password is in plain text.
conf_security_externalized.authentication.indirect.bind.server.admin.dn=myExtLdapUsername
conf_security_externalized.authentication.indirect.bind.server.admin.password=myExtLdapPassword
conf_security_externalized.authentication.indirect.bind.server.admin.password.encrypted=true

Testowanie instalacji

  1. Sprawdź, czy serwer działa:
    > /opt/apigee/apigee-service/bin/apigee-all status
  2. Wykonaj to polecenie i podaj zestaw danych logowania globalnego administratora systemu do Apigee Edge. Wywołanie interfejsu API, które będziemy testować, może być wykonywane tylko przez administratora sysadmin Edge.

    Ważne: te same dane logowania muszą istnieć na zewnętrznym koncie LDAP. Jeśli nie, musisz dodać je teraz. Pamiętaj, że nazwa użytkownika to zwykle adres e-mail. Zależy to jednak od sposobu skonfigurowania uwierzytelniania zewnętrznego, jak wyjaśniliśmy wcześniej w tym dokumencie.
    > curl -v http://<management-server-ip>:8080/v1/o -u <Nazwa użytkownika Sysadmin>

    Na przykład:
    > curl -v http://192.168.52.100:8080/moja_domena.com
  3. Gdy pojawi się prośba, wpisz hasło.

    Jeśli polecenie zwraca stan 200 i listę organizacji, konfiguracja jest prawidłowa. To polecenie sprawdza, czy wywołanie interfejsu API serwera zarządzania Edge zostało uwierzytelnione przy użyciu zewnętrznego systemu LDAP.