אחרי שמפעילים SAML או LDAP ב-Edge, אפשר להשבית את האימות הבסיסי. עם זאת, לפני שתשביתו את האימות הבסיסי:
- חשוב לוודא שהוספת את כל משתמשי Edge, כולל מנהלי המערכת, ל-IDP.
- חשוב לוודא שבדקתם היטב את אימות ה-IdP בממשק המשתמש של Edge וב-Edge Management API.
- אם משתמשים בפורטל Apigee Developer Services (או פשוט בפורטל), צריך להגדיר ולבדוק את ה-IdP החיצוני בפורטל כדי לוודא שהפורטל יכול להתחבר ל-Edge. למידע נוסף, ראו הגדרת הפורטל ל-IdPs חיצוניים.
הצגה של פרופיל האבטחה הנוכחי
אפשר לבדוק את פרופיל האבטחה של Edge כדי לקבוע את ההגדרה הנוכחית, ולקבוע אם אימות בסיסי ו-IdP חיצוני מופעלים. כדי להציג את פרופיל האבטחה הנוכחי שבו משתמש Edge, צריך להשתמש בקריאה הבאה ל-API לניהול Edge בשרת הניהול של Edge:
curl -H "accept:application/xml" http://localhost:8080/v1/securityprofile -u sysAdminEmail:pWord
אם עדיין לא הגדרת IDP חיצוני, התגובה תופיע כאן, כלומר, מופעל אימות בסיסי:
<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. מעבירים את אובייקט ה-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>
הפעלה מחדש של אימות בסיסי
אם מסיבה כלשהי תצטרכו להפעיל מחדש את האימות הבסיסי, עליכם לבצע את השלבים הבאים:
- מתחברים לכל צומת של EdgezoKeeper.
- כדי להשבית את כל אמצעי האבטחה, מריצים את סקריפט ה-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...
- מפעילים מחדש את האימות הבסיסי ואת אימות ה-IdP החיצוני:
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 מופעלת.