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

Edge for Private Cloud גרסה 4.19.01

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

  • חשוב לוודא שהוספת את כל משתמשי Edge, כולל מנהלי מערכת, ל-IdP ב-SAML.
  • חשוב לוודא שבדקת היטב את אימות SAML בממשק המשתמש של Edge וב-Edge Management API.
  • אם משתמשים בפורטל Apigee 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, עליך לבצע את השלבים הבאים:

  1. מתחברים לכל צומת של EdgezoKeeper.
  2. כדי להשבית את כל פעולות האבטחה, מריצים את סקריפט ה-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...
  3. הפעלה מחדש של אימות בסיסי ואימות SAML:
    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>'

    עכשיו אפשר להשתמש שוב באימות הבסיסי.