Apigee SSO 설치 및 구성

외부 IDP를 사용하여 Apigee SSO 모듈을 설치하고 구성하려면 다음을 수행해야 합니다.

  1. 키 및 인증서를 만듭니다.
  2. 기본 Apigee SSO 구성 설정: 기본 파일에는 모든 SSO 구성에 공통된 속성이 포함되어야 합니다.
  3. IDP 관련 구성 속성 추가: 구성 파일에서 다음 IDP별 구성 속성 블록 중 하나를 사용합니다.
  4. Apigee SSO 설치: Apigee SSO 모듈을 설치하고 구성 파일을 설치 프로그램에 전달합니다.

다음 섹션에서 각 단계를 설명합니다.

키 및 인증서 만들기

이 섹션에서는 테스트 환경에는 적합하지만 프로덕션 환경에는 인증 기관 (CA)에서 서명한 인증서를 사용해야 하는 자체 서명 인증서를 만드는 방법을 설명합니다.

키 쌍을 만들어 인증을 위해 서명하려면 다음 단계를 따르세요.

  1. sudo 사용자로서 다음과 같은 새 디렉터리를 만듭니다.
    sudo mkdir -p /opt/apigee/customer/application/apigee-sso/jwt-keys
  2. 새 디렉터리로 변경합니다.
    cd /opt/apigee/customer/application/apigee-sso/jwt-keys/
  3. 다음 명령어를 사용하여 비공개 키를 생성합니다.
    sudo openssl genrsa -out privkey.pem 2048
  4. 다음 명령어를 사용하여 비공개 키에서 공개 키를 생성합니다.
    sudo openssl rsa -pubout -in privkey.pem -out pubkey.pem
  5. 출력 PEM 파일의 소유자를 'apigee' 사용자로 변경합니다.
    sudo chown apigee:apigee *.pem

IDP와 통신하기 위해 암호 없이 키와 자체 서명 인증서를 만들려면 다음 단계를 따르세요.

  1. sudo 사용자로서 새 디렉터리를 만듭니다.
    sudo mkdir -p /opt/apigee/customer/application/apigee-sso/idp/
  2. 새 디렉터리로 변경합니다.
    cd /opt/apigee/customer/application/apigee-sso/idp/
  3. 암호로 비공개 키를 생성합니다.
    sudo openssl genrsa -aes256 -out server.key 1024
  4. 키에서 암호를 삭제합니다.
    sudo openssl rsa -in server.key -out server.key
  5. CA용 인증서 서명 요청을 생성합니다.
    sudo openssl req -x509 -sha256 -new -key server.key -out server.csr
  6. 만료 시간이 365일인 자체 서명 인증서를 생성합니다.
    sudo openssl x509 -sha256 -days 365 -in server.csr -signkey server.key -out selfsigned.crt
  7. 키와 crt 파일의 소유자를 'apigee' 소유자로 변경합니다.
    sudo chown apigee:apigee server.key
    sudo chown apigee:apigee selfsigned.crt

Apigee SSO 모듈에서 TLS를 사용 설정하려면 SSO_TOMCAT_PROFILESSL_TERMINATION 또는 SSL_PROXY로 설정하여 자체 서명 인증서를 사용할 수 없습니다. CA에서 인증서를 생성해야 합니다. 자세한 내용은 HTTPS 액세스를 위해 Apigee SSO 구성을 참조하세요.

Apigee SSO 구성 설정

Apigee SSO 모듈을 설치하려면 먼저 구성 파일을 정의해야 합니다. Apigee SSO 모듈을 설치할 때 이 구성 파일을 설치 프로그램에 전달합니다.

구성 파일의 형식은 다음과 같습니다.

IP1=hostname_or_IP_of_apigee_SSO
IP2=hostname_or_IP_of_apigee_SSO

## Management Server configuration.
# Management Server IP address and port
MSIP=$IP1
MGMT_PORT=8080
# Edge sys admin username and password as set when you installed Edge.
ADMIN_EMAIL=opdk@google.com
APIGEE_ADMINPW=Secret123
# Set the protocol for the Edge management API. Default is http.
# Set to https if you enabled TLS on the management API.
MS_SCHEME=http

## Postgres configuration.
# Postgres IP address and port
PG_HOST=$IP1
PG_PORT=5432
# Postgres username and password as set when you installed Edge.
# If these credentials change, they must be updated and setup rerun.
PG_USER=apigee
PG_PWD=postgres

## Apigee SSO module configuration.
# Choose either "saml" or "ldap".
SSO_PROFILE="[saml|ldap]"
# Externally accessible IP or DNS name of apigee-sso.
SSO_PUBLIC_URL_HOSTNAME=$IP2
SSO_PG_DB_NAME=database_name_for_sso

# Default port is 9099. If changing, set both properties to the same value.
SSO_PUBLIC_URL_PORT=9099
SSO_TOMCAT_PORT=9099
# Set Tomcat TLS mode to DEFAULT to use HTTP access to apigee-sso.
SSO_TOMCAT_PROFILE=DEFAULT
SSO_PUBLIC_URL_SCHEME=http

# SSO admin user name. The default is ssoadmin.
SSO_ADMIN_NAME=ssoadmin
# SSO admin password using uppercase, lowercase, number, and special chars.
SSO_ADMIN_SECRET=Secret123

# Enable the ability to sign an authentication request with SAML SSO.
SSO_SAML_SIGN_REQUEST=y

# Path to signing key and secret from Create the TLS keys and certificates above.
SSO_JWT_SIGNING_KEY_FILEPATH=/opt/apigee/customer/application/apigee-sso/jwt-keys/privkey.pem
SSO_JWT_VERIFICATION_KEY_FILEPATH=/opt/apigee/customer/application/apigee-sso/jwt-keys/pubkey.pem

###########################################################
#                 Define External IDP                     #
# Use one of the following configuration blocks to        #
# define your IDP settings:                               #
#  - SAML configuration properties                     #
#  - LDAP Direct Binding configuration properties        #
#  - LDAP Indirect Binding configuration properties       #
###########################################################

INSERT_IDP_CONFIG_BLOCK_HERE (SAML, LDAP direct, or LDAP indirect, below)

# Configure an SMTP server so that the Apigee SSO module can send emails to users
SKIP_SMTP=n
SMTPHOST=smtp.example.com
SMTPUSER=smtp@example.com
# omit for no username
SMTPPASSWORD=smtppwd
# omit for no password
SMTPSSL=n
SMTPPORT=25
# The address from which emails are sent
SMTPMAILFROM="My Company <myco@company.com>"

SAML SSO 구성 속성

IDP에 SAML을 사용하는 경우 위에 정의된 구성 파일에 다음 구성 속성 블록을 사용합니다.

## SAML Configuration Properties
# Insert this section into your base configuration file, as described previously.

# Name of SAML IDP. For example, okta or adfs.
SSO_SAML_IDP_NAME=okta
# Text displayed on the SSO sign-in page after being redirected by either the New or Classic Edge UI for SAML logins.
# Note: Installing SSO does not depend on the Edge UI or which version of the UI you are using.
SSO_SAML_IDP_LOGIN_TEXT="Please log in to your IDP"

# The metadata URL from your IDP.
# If you have a metadata file, and not a URL,
# see "Specifying a metadata file instead of a URL" below.
SSO_SAML_IDP_METADATA_URL=https://dev-343434.oktapreview.com/app/exkar20cl/sso/saml/metadata

# Determines whether to skip TLS validation for the URL specified
# by SSO_SAML_IDP_METADATA_URL.
# This is necessary if the URL uses a self-signed certificate.
# The default value is "n".
SSO_SAML_IDPMETAURL_SKIPSSLVALIDATION=n

# SAML service provider key and cert from Create the TLS keys and certificates above.
SSO_SAML_SERVICE_PROVIDER_KEY=/opt/apigee/customer/application/apigee-sso/saml/server.key
SSO_SAML_SERVICE_PROVIDER_CERTIFICATE=/opt/apigee/customer/application/apigee-sso/saml/selfsigned.crt

# The passphrase used when you created the SAML cert and key.
# The section "Create the TLS keys and certificates" above removes the passphrase,
# but this property is available if you require a passphrase.
# SSO_SAML_SERVICE_PROVIDER_PASSWORD=samlSP123

# Requires that SAML responses be signed by your IDP.
# This property is enabled by default since release 4.50.00.05.
SSO_SAML_SIGNED_ASSERTIONS=y

LDAP 직접 바인딩 구성 속성

IDP에 LDAP 직접 결합을 사용하는 경우 위의 예시와 같이 구성 파일에 다음 구성 속성 블록을 사용합니다.

## LDAP Direct Binding configuration
# Insert this section into your base configuration file, as described previously.

# The type of LDAP profile; in this case, "direct"
SSO_LDAP_PROFILE=direct

# The base URL to which SSO connects; in the form: "ldap://hostname_or_IP:port
SSO_LDAP_BASE_URL=LDAP_base_URL

# Attribute name used by the LDAP server to refer to the user's email address; for example, "mail"
SSO_LDAP_MAIL_ATTRIBUTE=LDAP_email_attribute

# Pattern of the user's DN; for example: =cn={0},ou=people,dc=example,dc=org
# If there is more than one pattern, separate with semicolons (";"); for example:
# =cn={0},ou=people,dc=example,dc=org;=cn={0},ou=people,dc=example,dc=com
SSO_LDAP_USER_DN_PATTERN=LDAP_DN_pattern

LDAP 간접 바인딩 구성 속성

IDP에 LDAP 간접 바인딩을 사용하는 경우 위의 예시와 같이 구성 파일에 다음 구성 속성 블록을 사용합니다.

## LDAP Indirect Binding configuration
# Insert this section into your base configuration file, as described previously.

# Type of LDAP profile; in this case, "indirect"
SSO_LDAP_PROFILE=indirect

# Base URL to which SSO connects; in the form: "ldap://hostname_or_IP:port
SSO_LDAP_BASE_URL=LDAP_base_URL

# DN and password of the LDAP server's admin user
SSO_LDAP_ADMIN_USER_DN=LDAP_admin_DN
SSO_LDAP_ADMIN_PWD=LDAP_admin_password

# LDAP search base; for example, "dc=example,dc=org"
SSO_LDAP_SEARCH_BASE=LDAP_search_base

# LDAP search filter; for example, "cn={0}"
SSO_LDAP_SEARCH_FILTER=LDAP_search_filter

# Attribute name used by the LDAP server to refer to the user's email address; for example, "mail"
SSO_LDAP_MAIL_ATTRIBUTE=LDAP_email_attribute

Apigee SSO 모듈 설치

키를 만들고 구성 파일을 설정한 후에는 Apigee SSO 모듈을 설치할 수 있습니다.

Apigee SSO 모듈을 설치하려면 다음 안내를 따르세요.

  1. 관리 서버 노드에 로그인합니다. Edge Apigee-setup 유틸리티 설치에 설명된 대로 이 노드에는 이미 apigee-service가 설치되어 있어야 합니다.

    또는 다른 노드에 Apigee SSO 모듈을 설치할 수 있습니다. 하지만 이 노드는 포트 8080을 통해 관리 서버에 액세스할 수 있어야 합니다.

  2. 다음 명령어를 실행하여 apigee-sso를 설치하고 구성합니다.
    /opt/apigee/apigee-setup/bin/setup.sh -p sso -f configFile

    여기서 configFile은 위에서 정의한 구성 파일입니다.

  3. apigee-sso 모듈의 관리자 및 머신 사용자를 관리하는 데 사용되는 apigee-ssoadminapi.sh 유틸리티를 설치합니다.
    /opt/apigee/apigee-service/bin/apigee-service apigee-ssoadminapi install
  4. 셸에서 로그아웃한 다음 다시 로그인하여 경로에 apigee-ssoadminapi.sh 유틸리티를 추가합니다.

URL 대신 메타데이터 파일 지정

IDP가 HTTP/HTTPS 메타데이터 URL을 지원하지 않는 경우 메타데이터 XML 파일을 사용하여 Apigee SSO를 구성할 수 있습니다.

URL 대신 메타데이터 파일을 사용하여 Apigee SSO를 구성하려면 다음 안내를 따르세요.

  1. IDP에서 메타데이터 XML의 콘텐츠를 Apigee SSO 노드의 파일로 복사합니다. 예를 들어 XML을 다음 위치에 복사합니다.
    /opt/apigee/customer/application/apigee-sso/saml/metadata.xml
  2. XML 파일의 소유권을 'apigee' 사용자로 변경합니다.
    chown apigee:apigee /opt/apigee/customer/application/apigee-sso/saml/metadata.xml
  3. SSO_SAML_IDP_METADATA_URL의 값을 절대 파일 경로(
    SSO_SAML_IDP_METADATA_URL=file:///opt/apigee/customer/application/apigee-sso/saml/metadata.xml
    )로 설정합니다.

    파일 경로 앞에 'file://'라는 프리픽스를 추가하고 그 뒤에 루트 (/)의 절대 경로를 붙여야 합니다.