پساز فعال کردن SAML یا LDAP در Edge، میتوانید اصالتسنجی «پایه» را غیرفعال کنید. بااینحال، قبلاز غیرفعال کردن «اصالتسنجی پایه»:
- مطمئن شوید که همه کاربران Edge، ازجمله سرپرستان سیستم، را به IDP خود اضافه کردهاید.
- مطمئن شوید که اصالتسنجی IDP را در New Edge UI و Edge management API کاملاً آزمایش کردهاید.
مشاهده نمایه امنیتی فعلی
میتوانید نمایه امنیتی Edge را مشاهده کنید تا پیکربندی فعلی را تعیین کنید و ببینید آیا «اصالتسنجی پایه» و IDP خارجی درحالحاضر فعال هستند یا نه. برای مشاهده نمایه امنیتی کنونی که Edge استفاده میکند، از فراخوانی میانای برنامهسازی کاربردی مدیریت Edge زیر در «کارساز مدیریت 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 که اعتبارنامههای اصالتسنجی «پایه» را ارسال میکند، خطای زیر را برمیگرداند:
<Error>
<Code>security.SecurityProfileBasicAuthDisabled</Code>
<Message>Basic Authentication scheme not allowed</Message>
<Contexts/>
</Error>فعال کردن مجدد اصالتسنجی پایه
اگر به هر دلیلی مجبور شدید «اصالتسنجی پایه» را دوباره فعال کنید، باید مراحل زیر را انجام دهید:
- به سیستم یکی از گرههای Edge ZooKeeper وارد شوید.
- اسکریپت 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...
- «اصالتسنجی پایه» و اصالتسنجی «ارائهدهنده هویت خارجی» را دوباره فعال کنید:
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>'
اکنون میتوانید دوباره از «اصالتسنجی پایه» استفاده کنید. برای تغییر دادن «میانای کاربری New Edge» از
«ورود به سیستم یکپارچه» به «اصالتسنجی پایه»، AUTH_MODE=basic و
MANAGEMENT_UI_SSO_ENABLED=n را در فایل پیکربندی «میانای کاربری New 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 را اجرا کنید).