השבתת אימות בסיסי ב-Edge

Edge for Private Cloud גרסה 4.18.01

אחרי שמפעילים SAML ב-Edge, אפשר להשבית את Basic Auth. עם זאת, לפני שמשביתים את Basic Auth:

  • חשוב לוודא שהוספת את כל משתמשי Edge, כולל מנהלי מערכת, ל-IdP ב-SAML.
  • חשוב לוודא שבדקת היטב את אימות SAML בממשק המשתמש של Edge וב-Edge Management API.
  • אם אתם משתמשים גם ב-API BaaS, עליכם להגדיר ולבדוק את SAML ב-API BaaS. למידע נוסף, ראו הפעלת SAML לממשקי API BaaS.
  • אם משתמשים בפורטל Developer Services, צריך להגדיר ולבדוק את SAML בפורטל כדי לוודא שהפורטל יכול להתחבר ל-Edge. למידע נוסף, אפשר לקרוא את המאמר הגדרת פורטל השירותים למפתחים לשימוש ב-SAML לצורך תקשורת עם Edge.

הצגת פרופיל האבטחה הנוכחי

אפשר להציג את פרופיל האבטחה של Edge כדי לקבוע את ההגדרה הנוכחית, ולקבוע אם Basic Auth ו-SAML מופעלים כרגע. כדי להציג את פרופיל האבטחה הנוכחי שבו משתמש Edge, צריך להשתמש בקריאה הבאה ל-Edge Management API בשרת הניהול של Edge:

> curl -H "accept:application/xml" http://localhost:8080/v1/securityprofile -u sysAdminEmail:pWord

אם עדיין לא הגדרת SAML, התגובה תופיע בהמשך, כלומר, מופעל 'אימות בסיסי':

<SecurityProfile enabled="true" name="securityprofile">
    <UserAccessControl enabled="true">
    </UserAccessControl>
</SecurityProfile>

אם כבר הפעלת SAML, התג <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>

שימו לב שבגרסה שבה SAML מופעל מוצג גם <BasicAuthEnabled>true</BasicAuthEnabled>, והמשמעות היא שהאימות הבסיסי (Basic Auth) עדיין יפעל.

השבתת האימות הבסיסי

כדי להשבית את Basic Auth, משתמשים בקריאה הבאה ל-Edge Management API בשרת Edge Management. שימו לב שצריך להעביר בתור המטען הייעודי (payload) את אובייקט ה-XML שהוחזר בקטע הקודם. ההבדל היחיד הוא שמגדירים את <BasicAuthEnabled>false</BasicAuthEnabled>:

> 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>'

אחרי השבתת Basic Auth, כל קריאה ל-Edge Management API שתעביר את פרטי הכניסה של Basic Auth תחזיר את השגיאה הבאה:

<Error>
    <Code>security.SecurityProfileBasicAuthDisabled</Code>
    <Message>Basic Authentication scheme not allowed</Message>
    <Contexts/>
</Error>

הפעלה מחדש של האימות הבסיסי

אם מסיבה כלשהי עליך להפעיל מחדש את Basic Auth, עליך לבצע את השלבים הבאים:

זהירות: במסגרת ההפעלה מחדש של Basic Auth, צריך להשבית באופן זמני את כל האימותים ב-Edge, כולל SAML.

  1. מתחברים לכל צומת של EdgezoKeeper.
  2. כדי להשבית את כל האבטחה, מריצים את סקריפט ה-Bash הבא:
    זהירות: השלב הזה משבית את כל סוגי האימות ב-Edge, כולל SAML.

    #! /bin/bash
    /opt/apigee/apigee-zookeeper/bin/zkCli.sh -server localhost:2181 <<EOF
    set /system/securityprofile <SecurityProfile></SecurityProfile>
    סיום
    EOF

    הפלט יופיע בצורה הבאה:
    Connecting to localhost:2181
    ברוך הבא ל-ZooKeeper!
    התמיכה ב-JLine מופעלת
    WATCHER::

    מצב WatchedEvent:SyncConnected type:None path:null
    [zk: localhost:2181(CONNECTED) 0] set /system/securityprofile <SecurityProfile></SecurityProfile>
    cZxid = 0x89
    ...
    [zk: localhost:2181(CONNECTED) 1] יציאה
    יוצא...
  3. הפעלה מחדש של אימות בסיסי ואימות SAML:

    > curl -H "Content-Type: application/xml"
    http://localhost:8080/v1/securityprofile -u sysAdminEmail:pWord -d
    '<SecurityProfile enabled="true" name="securityprofile">

    <UserAccessPointControl enabled="true">
    Enabled SSOKeyAuthPublic
    Enabled <SSOKeyAuthPublic
    <SSOPointControl5
    Enabled <SSOKeyAuthPublic
    Enabled [SSO )
    sysAdminEmail:pWord -d

    עכשיו אפשר להשתמש שוב ב-Basic Auth.