לאחר הפעלת SAML או LDAP ב-Edge, אפשר להשבית את האימות הבסיסי. אבל, לפעמים לפני שמשביתים את האימות הבסיסי:
- חשוב לוודא שהוספת את כל משתמשי Edge, כולל מנהלי מערכת, IDP.
- חשוב לוודא שבדקת באופן יסודי את אימות ה-IDP בממשק המשתמש של Edge וב-Edge Management API.
- אם אתם משתמשים בפורטל השירותים למפתחים של Apigee (או פשוט בפורטל), צריך להגדיר ולבדוק את ה-IdP החיצוני בפורטל כדי להבטיח שהפורטל יכול להתחבר ל-Edge. צפייה הגדרת הפורטל ל-IdPs חיצוניים.
צפייה בפרופיל האבטחה הנוכחי
אפשר לעיין בפרופיל האבטחה של Edge כדי לבדוק את התצורה הנוכחית כדי לברר אם אימות בסיסי ו-IdP חיצוני מופעלים כרגע. איך משתמשים באפשרויות הניהול הבאות ב-Edge קריאה ל-API בשרת ניהול הקצה כדי להציג את פרופיל האבטחה הנוכחי שבו משתמש 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>, פירושו האימות עדיין מופעל.
השבתת האימות הבסיסי
כדי להשבית את Basic, משתמשים בקריאה הבאה ל-Edge management API בשרת Edge Management. אימות.
כדי להשבית את האימות הבסיסי, מעבירים את אובייקט ה-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 שעוברת את ההגדרה Basic פרטי הכניסה לאימות יחזירו את השגיאה הבאה:
<Error>
<Code>security.SecurityProfileBasicAuthDisabled</Code>
<Message>Basic Authentication scheme not allowed</Message>
<Contexts/>
</Error>הפעלה מחדש של אימות בסיסי
אם מסיבה כלשהי יש להפעיל מחדש את האימות הבסיסי, צריך לבצע את הפעולות הבאות שלבים:
- מתחברים לכל צומת של Edge zoKeeper.
- מריצים את סקריפט ה-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 החדשה מופעלת.