ปิดใช้การตรวจสอบสิทธิ์ขั้นพื้นฐานใน Edge

หลังจากเปิดใช้ SAML หรือ LDAP ใน Edge แล้ว คุณจะปิดใช้การตรวจสอบสิทธิ์พื้นฐานได้ อย่างไรก็ตาม ก่อนที่จะปิดใช้การตรวจสอบสิทธิ์พื้นฐาน ให้ดำเนินการดังนี้

  • ตรวจสอบว่าคุณได้เพิ่มผู้ใช้ Edge ทั้งหมด รวมถึงผู้ดูแลระบบ ไปยัง IDP แล้ว
  • ตรวจสอบว่าคุณได้ทดสอบการตรวจสอบสิทธิ์ IDP อย่างละเอียดใน UI Edge ใหม่และ Edge Management API แล้ว

ดูโปรไฟล์ความปลอดภัยปัจจุบัน

คุณสามารถดูโปรไฟล์ความปลอดภัยของ Edge เพื่อกำหนดการกำหนดค่าปัจจุบันเพื่อดูว่า การตรวจสอบสิทธิ์พื้นฐานและ IDP ภายนอกเปิดใช้อยู่หรือไม่ ใช้การเรียก Edge management API ต่อไปนี้ใน Edge Management Server เพื่อดูโปรไฟล์ความปลอดภัยปัจจุบันที่ 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 Management Server เพื่อปิดใช้การตรวจสอบสิทธิ์พื้นฐาน

หากต้องการปิดใช้การตรวจสอบสิทธิ์พื้นฐาน ให้ส่งออบเจ็กต์ XML ที่แสดงในส่วนก่อนหน้าเป็นเพย์โหลด ความแตกต่างเพียงอย่างเดียวคือคุณตั้งค่า <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>

เปิดใช้การตรวจสอบสิทธิ์พื้นฐานอีกครั้ง

หากคุณต้องเปิดใช้การตรวจสอบสิทธิ์พื้นฐานอีกครั้งไม่ว่าด้วยเหตุผลใดก็ตาม คุณต้องทำตามขั้นตอนต่อไปนี้

  1. เข้าสู่ระบบโหนด Edge ZooKeeper ใดก็ได้
  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. เปิดใช้การตรวจสอบสิทธิ์พื้นฐานและการตรวจสอบสิทธิ์ 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>'

ตอนนี้คุณใช้การตรวจสอบสิทธิ์พื้นฐานได้อีกครั้ง หากต้องการเปลี่ยน UI Edge ใหม่จาก SSO กลับไปเป็นการตรวจสอบสิทธิ์พื้นฐาน ให้ตั้งค่า AUTH_MODE=basic และ MANAGEMENT_UI_SSO_ENABLED=n ในไฟล์การกำหนดค่า UI 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)