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

Edge สำหรับ Private Cloud เวอร์ชัน 4.18.01

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

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

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

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

ใช้การเรียก Edge Management API ต่อไปนี้บน Edge Management Server เพื่อปิดใช้การตรวจสอบสิทธิ์พื้นฐาน โปรดทราบว่าคุณจะส่งผ่านเป็นเพย์โหลดที่ออบเจ็กต์ 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>'

หลังจากปิดใช้การตรวจสอบสิทธิ์พื้นฐาน การเรียก Edge Management API ที่ส่งข้อมูลเข้าสู่ระบบการตรวจสอบสิทธิ์พื้นฐานจะแสดงผลข้อผิดพลาดต่อไปนี้

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

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

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

ข้อควรระวัง: ในการเปิดใช้การตรวจสอบสิทธิ์พื้นฐานอีกครั้ง คุณจะต้องปิดใช้การตรวจสอบสิทธิ์ทั้งหมดบน Edge รวมถึง SAML ชั่วคราว

  1. เข้าสู่ระบบโหนด Edge ZooKeeper
  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 status: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">

    <UserAccessControl enabled="true">
    <SSOAccessControl enabled="true">
    <SSOAuthServer></B>




    คุณสามารถใช้การตรวจสอบสิทธิ์พื้นฐานได้อีกครั้งแล้ว