Włączanie uwierzytelniania zewnętrznego

Edge for Private Cloud w wersji 4.18.05

W tej sekcji wyjaśniono, jak uzyskać, zainstalować i skonfigurować komponenty wymagane do integracji usługi LDAP z Apigee Edge w celu uwierzytelniania użytkowników.

Wymagania wstępne

  • Musisz mieć instalację Apigee Edge for Private Cloud 4.18.05.
  • 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 skonfigurujesz i zainstalujesz Apigee Edge dla Private Cloud z danymi logowania administratora globalnego systemu jako:

    username: edgeuser@mydomain.com
    password: Secret123

    Następnie użytkownik edgeuser@mydomain.com z hasłem Secret123 musi być też obecny w zewnętrznym katalogu LDAP.

  • 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

Wykonasz główne działanie 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:
    conf_security_authentication.user.store=externalized.authentication

    Ten wiersz dodaje funkcję uwierzytelniania zewnętrznego do instalacji Edge dla Private Cloud.

  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. Przejrzyj poniższe przykłady powiązania, którego chcesz użyć, i dokończ konfigurację:
  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: dodatkową konfigurację musisz utworzyć w jednej lub obu tych sytuacjach:
    1. Jeśli chcesz, aby użytkownicy logowali się za pomocą nazw użytkowników, które nie są adresami e-mail. W tym przypadku użytkownik sysadmin musi się uwierzytelnić przy użyciu nazwy użytkownika.

      ORAZ/LUB

    2. Jeśli hasło do konta użytkownika sysadmin w zewnętrznym katalogu 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 in Microsoft Active Directory, this would be
## 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 with AD, 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.
    curl -v http://management-server-IP:8080/v1/o -u sysadmin_username

    Na przykład:

    curl -v http://192.168.52.100:8080/v1/o -u jdoe@mydomain.com
  3. Gdy pojawi się prośba, wpisz hasło.

    Jeśli polecenie zwróci 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.