התקנה והגדרה של SSO ב-Edge

Edge for Private Cloud v4.18.05

כדי להתקין ולהגדיר את מודול ה-SSO של Edge, קודם צריך ליצור שתי קבוצות של מפתחות ואישורי TLS. מודול ה-SSO של Edge משתמש ב-TLS כדי לאבטח את העברת המידע כחלק מתהליך לחיצת היד של SAML עם ה-IDP של SAML.

יצירת מפתחות ואישורים של TLS

בשלבים הבאים יוצרים אישורים חתומים באופן עצמי, שיכולים להתאים לסביבת הבדיקה, אבל בדרך כלל צריך אישורים חתומים על ידי רשות אישורים (CA) לסביבת ייצור.

כדי ליצור את מפתח האימות והחתימה ואת האישור בחתימה עצמית:

  1. 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. sudo chown apigee:apigee *.pem

כדי ליצור את המפתח והאישור עם החתימה העצמית, ללא ביטוי סיסמה, לתקשורת עם ספק הזהויות ב-SAML:

  1. sudo mkdir -p /opt/apigee/customer/application/apigee-sso/saml/
  2. cd /opt/apigee/customer/application/apigee-sso/saml/
  3. יוצרים את המפתח הפרטי באמצעות ביטוי סיסמה:
    sudo openssl genrsa -aes256 -out server.key 1024
  4. מסירים את ביטוי הסיסמה מהמפתח:
    sudo openssl rsa -in server.key -out server.key
  5. יצירת בקשה לחתימה על אישור (CSR) לרשות אישורים (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. sudo chown apigee:apigee server.key
  8. sudo chown apigee:apigee selfsigned.crt

אם רוצים להפעיל TLS במודול Edge SSO, על ידי הגדרת SSO_TOMCAT_PROFILE ל-SSL_TERMINATION או ל-SSL_PROXY, אי אפשר להשתמש באישור בחתימה עצמית. צריך ליצור אישור מרשות אישורים (CA). מידע נוסף זמין במאמר הגדרת apigee-sso לגישה באמצעות HTTPS.

התקנה והגדרה של Edge SSO לגישה ל-HTTP

כדי להתקין את מודול ה-SSO של Edge, ‏ apigee-sso, צריך להשתמש באותו תהליך שבו השתמשתם כדי להתקין את Edge. ‫apigee-sso מיוצג על ידי קובץ RPM, ולכן המשתמש שמבצע את ההתקנה חייב להיות משתמש Root או משתמש עם גישת 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

# 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

# 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>"

כדי להתקין את מודול ה-SSO של Edge:

  1. מתחברים לצומת של שרת הניהול. בצומת הזה כבר אמור להיות מותקן apigee-service, כמו שמתואר במאמר התקנת כלי השירות apigee-setup של Edge.

    שימו לב שאפשר להתקין את Edge SSO בצומת אחר. עם זאת, הצומת הזה צריך להיות מסוגל לגשת לשרת הניהול דרך יציאה 8080.

  2. התקנה והגדרה של apigee-sso:
    /opt/apigee/apigee-setup/bin/setup.sh -p sso -f configFile

    כאשר configFile הוא קובץ התצורה שמוצג למעלה.

  3. מתקינים את הכלי apigee-ssoadminapi.sh שמשמש לניהול משתמשי אדמין ומשתמשי מכונה במודול apigee-sso:
    /opt/apigee/apigee-service/bin/apigee-service apigee-ssoadminapi install
  4. יוצאים מה-shell ונכנסים שוב כדי להוסיף את הכלי apigee-ssoadminapi.sh לנתיב.

צריך לציין קובץ מטא-נתונים במקום כתובת URL

אם ה-IdP לא תומך בכתובת URL של מטא-נתונים מסוג HTTP/HTTPS, אפשר להשתמש בקובץ XML של מטא-נתונים כדי להגדיר את Edge SSO:

  1. מעתיקים את התוכן של קובץ ה-XML של המטא-נתונים מה-IDP לקובץ בצומת ה-SSO של Edge. לדוגמה, מעתיקים את ה-XML אל:
    /opt/apigee/customer/application/apigee-sso/saml/metadata.xml
  2. משנים את הבעלות על הקובץ ל-apigee: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://", ואחריה את הנתיב המוחלט מהשורש (/).