Edge for Private Cloud 4.19.01 版
如要安裝及設定 Edge SSO 模組,您必須先產生兩組 TLS 金鑰和憑證。Edge SSO 模組會使用 TLS,在與 SAML IDP 進行 SAML 握手程序時,保護資訊傳輸。
建立 TLS 金鑰和憑證
下列步驟會建立自行簽署的憑證,這可能適用於測試環境,但正式環境通常需要由 CA 簽署的憑證。
如要建立驗證和簽署金鑰,以及自行簽署的憑證,請按照下列步驟操作:
sudo mkdir -p /opt/apigee/customer/application/apigee-sso/jwt-keys
cd /opt/apigee/customer/application/apigee-sso/jwt-keys/
sudo openssl genrsa -out privkey.pem 2048
sudo openssl rsa -pubout -in privkey.pem -out pubkey.pem
sudo chown apigee:apigee *.pem
如要建立金鑰和自行簽署憑證 (不含通關密語),以便與 SAML IDP 通訊,請按照下列步驟操作:
sudo mkdir -p /opt/apigee/customer/application/apigee-sso/saml/
cd /opt/apigee/customer/application/apigee-sso/saml/
- 使用通關密語產生私密金鑰:
sudo openssl genrsa -aes256 -out server.key 1024
- 從金鑰中移除通關密語:
sudo openssl rsa -in server.key -out server.key
- 為 CA 產生憑證簽署要求:
sudo openssl req -x509 -sha256 -new -key server.key -out server.csr
- 產生到期時間為 365 天的自行簽署憑證:
sudo openssl x509 -sha256 -days 365 -in server.csr -signkey server.key -out selfsigned.crt
sudo chown apigee:apigee server.key
sudo chown apigee:apigee selfsigned.crt
如要啟用 Edge SSO 模組的 TLS,請將 SSO_TOMCAT_PROFILE 設為 SSL_TERMINATION 或 SSL_PROXY,但您無法使用自行簽署的憑證。您必須從 CA 產生憑證。詳情請參閱「設定 apigee-sso 的 HTTPS 存取權」。
安裝及設定 Edge SSO 以進行 HTTP 存取
如要安裝 Edge SSO 模組 apigee-sso,您必須使用與安裝 Edge 相同的程序。由於 apigee-sso 是以 RPM 檔案表示,因此執行安裝作業的使用者必須是超級使用者,或具備完整 sudo 存取權的使用者。詳情請參閱「Edge 安裝總覽」。
將設定檔傳遞至安裝程式。設定檔格式如下:
IP1=hostname_or_ip_of_management_server IP2=hostname_or_ip_of_UI_and_apigge_sso ## Management Server configuration. 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. PG_HOST=$IP1 PG_PORT=5432 # Postgres username and password as set when you installed Edge. PG_USER=apigee PG_PWD=postgres # apigee-sso configuration. SSO_PROFILE="saml" # Externally accessible IP or DNS name of apigee-sso. SSO_PUBLIC_URL_HOSTNAME=$IP2 # 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 # Name of SAML IDP. For example, okta or adfs. SSO_SAML_IDP_NAME=okta # Text displayed to user when they attempt to access Edge UI. 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 # Specifies to skip TLS validation for the URL specified # by SSO_SAML_IDP_METADATA_URL. Necessary if URL uses a self-signed cert. # 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. SSO_SAML_SIGNED_ASSERTIONS=y # Must configure an SMTP server so Edge SSO 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 SMTPMAILFROM="My Company <myco@company.com>"
如要安裝 Edge SSO 模組,請按照下列步驟操作:
- 登入管理伺服器節點。如「安裝 Edge apigee-setup 公用程式」一文所述,該節點應已安裝
apigee-service。請注意,您可以在其他節點上安裝 Edge SSO。不過,該節點必須能透過通訊埠 8080 存取管理伺服器。
- 安裝及設定
apigee-sso:/opt/apigee/apigee-setup/bin/setup.sh -p sso -f configFile
其中 configFile 是上述設定檔。
- 安裝
apigee-ssoadminapi.sh公用程式,用於管理apigee-sso模組的管理員和機器使用者:/opt/apigee/apigee-service/bin/apigee-service apigee-ssoadminapi install
- 登出殼層,然後重新登入,將
apigee-ssoadminapi.sh公用程式新增至路徑。
指定中繼資料檔案,而非網址
如果 IDP 不支援 HTTP/HTTPS 中繼資料網址,您可以使用中繼資料 XML 檔案設定 Edge SSO:
- 將 IDP 的中繼資料 XML 內容複製到 Edge SSO 節點上的檔案。舉例來說,將 XML 複製到:
/opt/apigee/customer/application/apigee-sso/saml/metadata.xml
- 將檔案擁有權變更為 apigee:apigee:
chown apigee:apigee /opt/apigee/customer/application/apigee-sso/saml/metadata.xml
- 將
SSO_SAML_IDP_METADATA_URL的值設為絕對檔案路徑:SSO_SAML_IDP_METADATA_URL=file:///opt/apigee/customer/application/apigee-sso/saml/metadata.xml
檔案路徑必須加上「
file://」前置字串,後面接著根目錄 (/) 的絕對路徑。