אחרי שמפעילים את SAML או LDAP ב-Edge, אפשר להשבית את האימות הבסיסי. עם זאת, לפני שמשביתים את האימות הבסיסי:
- מוודאים שהוספתם את כל משתמשי Edge, כולל אדמינים של המערכת, לIDP.
- חשוב לוודא שבדקתם היטב את האימות של ספק הזהויות בממשק המשתמש החדש של Edge ובממשק ה-API לניהול של Edge.
הצגת פרופיל האבטחה הנוכחי
אתם יכולים להציג את פרופיל האבטחה של Edge כדי לקבוע את ההגדרות הנוכחיות, ולקבוע אם אימות בסיסי ו-IDP חיצוני מופעלים כרגע. כדי לראות את פרופיל האבטחה הנוכחי שבו משתמש Edge, משתמשים בקריאה הבאה ל-Edge Management API בשרת הניהול של Edge:
curl -H "accept:application/xml" http://localhost:8080/v1/securityprofile -u sysAdminEmail:pWord
אם עדיין לא הגדרתם ספק זהויות חיצוני, התגובה תהיה כמו שמוצג למטה, כלומר אימות בסיסי מופעל:
<SecurityProfile enabled="true" name="securityprofile">
<UserAccessControl enabled="true">
</UserAccessControl>
</SecurityProfile>אם כבר הפעלתם ספק IdP חיצוני, רכיב <ssoserver> אמור להופיע בתגובה:
<SecurityProfile enabled="true" name="securityprofile">
<UserAccessControl enabled="true">
<SSOServer>
<BasicAuthEnabled>true</BasicAuthEnabled>
<PublicKeyEndPoint>/token_key</PublicKeyEndPoint>
<ServerUrl>http://35.197.37.220:9099</ServerUrl>
</SSOServer>
</UserAccessControl>
</SecurityProfile>שימו לב שבגרסה שבה מופעל IDP חיצוני מופיע גם הערך <BasicAuthEnabled>true</BasicAuthEnabled>, כלומר שאימות בסיסי עדיין מופעל.
השבתת האימות הבסיסי
כדי להשבית את האימות הבסיסי, משתמשים בקריאה הבאה ל-Edge Management API ב-Edge Management Server.
כדי להשבית את האימות הבסיסי, מעבירים את אובייקט ה-XML שהוחזר בקטע הקודם בתור המטען הייעודי (payload). ההבדל היחיד הוא שמגדירים את <BasicAuthEnabled> ל-false, כמו בדוגמה הבאה:
curl -H "Content-Type: application/xml"
http://localhost:8080/v1/securityprofile -u sysAdminEmail:pWord -d
'<SecurityProfile enabled="true" name="securityprofile">
<UserAccessControl enabled="true">
<SSOServer>
<BasicAuthEnabled>false</BasicAuthEnabled>
<PublicKeyEndPoint>/token_key</PublicKeyEndPoint>
<ServerUrl>http://35.197.37.220:9099</ServerUrl>
</SSOServer>
</UserAccessControl>
</SecurityProfile>'אחרי שמשביתים את האימות הבסיסי, כל קריאה ל-Edge Management API שמעבירה פרטי כניסה לאימות בסיסי מחזירה את השגיאה הבאה:
<Error>
<Code>security.SecurityProfileBasicAuthDisabled</Code>
<Message>Basic Authentication scheme not allowed</Message>
<Contexts/>
</Error>הפעלה מחדש של אימות בסיסי
אם מסיבה כלשהי אתם צריכים להפעיל מחדש את האימות הבסיסי, אתם צריכים לבצע את השלבים הבאים:
- מתחברים לכל צומת ZooKeeper ב-Edge.
- מריצים את הסקריפט הבא של Bash כדי להשבית את כל האבטחה:
#! /bin/bash /opt/apigee/apigee-zookeeper/bin/zkCli.sh -server localhost:2181 <<EOF set /system/securityprofile <SecurityProfile></SecurityProfile> quit EOF
הפלט ייראה כך:
Connecting to localhost:2181 Welcome to ZooKeeper! JLine support is enabled WATCHER:: WatchedEvent state:SyncConnected type:None path:null [zk: localhost:2181(CONNECTED) 0] set /system/securityprofile <SecurityProfile></SecurityProfile> cZxid = 0x89 ... [zk: localhost:2181(CONNECTED) 1] quit Quitting...
- מפעילים מחדש את האימות הבסיסי ואת האימות של ספק הזהויות החיצוני:
curl -H "Content-Type: application/xml" http://localhost:8080/v1/securityprofile -u sysAdminEmail:pWord -d '<SecurityProfile enabled="true" name="securityprofile"> <UserAccessControl enabled="true"> <SSOServer> <BasicAuthEnabled>true</BasicAuthEnabled> <PublicKeyEndPoint>/token_key</PublicKeyEndPoint> <ServerUrl>http://35.197.37.220:9099</ServerUrl> </SSOServer> </UserAccessControl> </SecurityProfile>'
עכשיו אפשר להשתמש שוב באימות בסיסי. כדי להחליף את ממשק המשתמש החדש של Edge מ-SSO בחזרה לאימות בסיסי, מגדירים את AUTH_MODE=basic ואת MANAGEMENT_UI_SSO_ENABLED=n בקובץ התצורה של ממשק המשתמש החדש של Edge, ואז מריצים את /opt/apigee/apigee-service/bin/apigee-service edge-management-ui configure-sso -f configFile ואחריו את /opt/apigee/apigee-service/bin/apigee-service edge-management-ui restart (או מריצים את /opt/apigee/apigee-setup/bin/setup.sh -p ue -f configFile).