Edge for Private Cloud версии 4.17.05
В этом разделе объясняется, как получить, установить и настроить компоненты, необходимые для интеграции внешнего сервиса LDAP в Apigee Edge для аутентификации пользователей.
Требования
- У вас должна быть установлена версия Apigee Edge для Private Cloud 4.17.05.
- Для установки у вас должны быть учетные данные глобального системного администратора Apigee Edge для частного облака.
- Вам нужно знать корневой каталог установки Apigee Edge для Private Cloud. Корневой каталог по умолчанию – /opt.
- Вам необходимо добавить учетные данные глобального системного администратора Edge во внешний каталог LDAP. Помните, что по умолчанию учетные данные системного администратора хранятся во внутреннем LDAP Edge. После перехода на внешний LDAP-сервер учетные данные системного администратора будут проходить аутентификацию на нем. Поэтому вы должны предоставить учетные данные внешней системе до включения внешней аутентификации в Edge.
Например, если вы настроили и установили Apigee Edge для частного облака с глобальными учетными данными системного администратора:
имя пользователя: edgeuser@mydomain.com
пароль: Secret123
Тогда пользователь edgeuser@mydomain.com с паролем Secret123 также должен присутствовать во внешнем LDAP. - Если вы используете кластер серверов управления, обратите внимание, что вам необходимо выполнить все шаги, описанные в этом документе, для каждого сервера управления.
Настройка внешней аутентификации
Основное действие, которое вам нужно будет выполнить, – это настройка файла management-server.properties. В частности, вам нужно будет запустить и остановить Edge Management Server, выбрать тип привязки (прямая или косвенная), зашифровать конфиденциальные учетные данные и выполнить другие связанные задачи.
- Важно! Решите, какой способ аутентификации вы будете использовать: прямое или косвенное связывание. От этого решения зависят некоторые аспекты конфигурации. Подробнее о внешней аутентификации…
- Важно! Эти действия необходимо выполнить на каждом сервере управления Apigee Edge (если у вас их несколько).
- Откройте файл /opt/apigee/customer/application/management-server.properties в текстовом редакторе. Если файла нет, создайте его.
- Добавьте следующую строку: Примечание. Убедитесь, что в конце строки нет пробелов.
conf_security_authentication.user.store=externalized.authentication
Эта строка добавляет функцию внешней аутентификации в установку Edge for Private Cloud. - Чтобы упростить этот шаг, мы создали два примера конфигураций с комментариями: один для прямой, а другой для косвенной аутентификации с привязкой. Ознакомьтесь с примерами ниже и завершите настройку.
Пример конфигурации с прямой привязкой
Пример конфигурации с косвенной привязкой - Перезапустите сервер управления:
> /opt/apigee/apigee-service/bin/apigee-service edge-management-server restart - Убедитесь, что сервер работает:
> /opt/apigee/apigee-service/bin/apigee-all status - Важно! Вам необходимо выполнить дополнительную настройку, если: а) пользователи будут входить в систему, используя имена, которые не являются адресами электронной почты; В этом случае системный администратор должен пройти аутентификацию с помощью имени пользователя и/или (б) если пароль для аккаунта системного администратора во внешнем каталоге LDAP отличается от пароля, настроенного при первой установке Apigee Edge для частного облака. Подробнее о настройке разных учетных данных системного администратора…
Пример конфигурации 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}
Пример конфигурации INDIRECT BINDING
## 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 "Indirect binding only: Encrypting the external LDAP user’s password". 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
Проверка установки
- Убедитесь, что сервер работает:
> /opt/apigee/apigee-service/bin/apigee-all status - Выполните эту команду, указав учетные данные глобального системного администратора Apigee Edge. Вызов API, который мы будем тестировать, может быть выполнен только системным администратором Edge.
Важно! В вашем внешнем аккаунте LDAP должны быть такие же учетные данные. Если нет, добавьте их. Обратите внимание, что имя пользователя обычно представляет собой адрес электронной почты, однако это зависит от того, как вы настроили внешнюю аутентификацию, как описано ранее в этом документе.
> curl -v http://<management-server-ip>:8080/v1/o -u <Sysadmin Username>
Пример:
> curl -v http://192.168.52.100:8080/v1/o -u jdoe@mydomain.com - Введите пароль.
Если команда возвращает статус 200 и список организаций, конфигурация верна. Эта команда проверяет, что вызов API к серверу управления Edge был успешно аутентифицирован через внешнюю систему LDAP.