ติดตั้งและกําหนดค่า Edge SSO

Edge for Private Cloud เวอร์ชัน 4.17.09

การติดตั้งและกำหนดค่าโมดูล Edge SSO กำหนดให้คุณต้องสร้างคีย์และใบรับรอง TLS 2 ชุดก่อน โมดูล Edge SSO ใช้ TLS เพื่อรักษาความปลอดภัยในการส่งข้อมูลซึ่งเป็นส่วนหนึ่งของกระบวนการแฮนด์เชค SAML กับ SAML IDP

หมายเหตุ: โดยค่าเริ่มต้น โมดูล Edge SSO จะเข้าถึงได้ผ่าน HTTP ในพอร์ต 9099 ของโหนดที่ติดตั้ง คุณเปิดใช้ TLS ในโมดูล Edge SSO ได้ โดยคุณต้องสร้างคีย์และใบรับรอง TLS ชุดที่ 3 ที่ Tomcat ใช้เพื่อรองรับ TLS ดูข้อมูลเพิ่มเติมได้ที่หัวข้อกำหนดค่า apigee-sso สำหรับการเข้าถึง HTTPS

สร้างคีย์และใบรับรอง 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 IDP มีดังนี้

  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 เซิร์ฟเวอร์.key -out เซิร์ฟเวอร์.key
  5. สร้างคำขอลงชื่อใบรับรองสำหรับ CA:
    > sudo openssl req -x509 -sha256 -new -key server.key -out server.csr
  6. สร้างใบรับรอง Self-signed ซึ่งมีเวลาหมดอายุ 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

หากต้องการติดตั้งโมดูล 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

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

วิธีติดตั้งโมดูล Edge SSO

  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 ไปยังไฟล์ในโหนด Edge SSO ตัวอย่างเช่น คัดลอก 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://" ตามด้วยเส้นทางสัมบูรณ์จากรูท (/)