Edge で SAML または LDAP を有効にした後、Basic 認証を無効にできます。ただし、Basic 認証を無効にする前に次のことを行ってください。
- システム管理者を含むすべての Edge ユーザーが IDP に追加されていることを確認します。
- Edge UI と Edge Management API で IDP 認証を十分にテストします。
- Apigee Developer Services ポータル(略して「ポータル」)を使用している場合は、ポータルで外部 IDP を構成してテストし、ポータルから Edge に接続できることを確認します。外部 IDP を使用するようにポータルを構成するをご覧ください。
現在のセキュリティ プロファイルを表示する
Edge セキュリティ プロファイルを表示して、現在の構成で Basic 認証と外部 IDP が有効になっているかどうかを確認できます。Edge で現在使用されているセキュリティ プロファイルを表示するには、Edge Management Server で次の Edge Management API 呼び出しを使用します。
curl -H "accept:application/xml" http://localhost:8080/v1/securityprofile -u sysAdminEmail:pWord
外部 IDP をまだ構成していない場合は、Basic 認証が有効であることを示す次のようなレスポンスが返されます。
<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> も含まれている点に注意してください。これは Basic 認証がまだ有効であることを示します。
Basic 認証を無効にする
Basic 認証を無効にするには、Edge Management Server で次の Edge Management API 呼び出しを使用します。
Basic 認証を無効にするには、前のセクションで返された 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>'
Basic 認証を無効にした後、Edge Management API 呼び出しで Basic 認証の認証情報を渡すと、次のエラーが返されます。
<Error> <Code>security.SecurityProfileBasicAuthDisabled</Code> <Message>Basic Authentication scheme not allowed</Message> <Contexts/> </Error>
Basic 認証を再び有効にする
なんらかの理由で Basic 認証を再び有効にする場合は、次の手順に従います。
- 任意の 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...
- Basic 認証と外部 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>'
これで Basic 認証を再び使用できます。New Edge エクスペリエンスが有効になっている場合、Basic 認証は機能しないので注意してください。