Edge for Private Cloud v4.18.01
Edge で SAML を有効にしたら、Basic 認証を無効にできます。ただし、基本認証を無効にする前に、次のことを行う必要があります。
- システム管理者を含むすべての Edge ユーザーを SAML IDP に追加していることを確認します。
- Edge UI と Edge Management API で SAML 認証を十分にテストしていることを確認します。
- API BaaS も使用している場合は、API BaaS で SAML を構成してテストします。API BaaS での SAML の有効化をご覧ください。
- Developer Services ポータルを使用している場合は、ポータルで SAML を構成してテストし、ポータルが Edge に接続できることを確認します。Edge との通信に SAML を使用するように Developer Services ポータルを構成するをご覧ください。
現在のセキュリティ プロファイルの表示
Edge セキュリティ プロファイルを表示して、現在の構成を確認し、Basic 認証と SAML が現在有効になっているかどうかを判断できます。Edge で現在使用されているセキュリティ プロファイルを表示するには、Edge Management Server で次の Edge Management API 呼び出しを使用します。
> curl -H "accept:application/xml" http://localhost:8080/v1/securityprofile -u sysAdminEmail:pWordSAML をまだ構成していない場合、レスポンスは次のようになります。これは、基本認証が有効になっていることを意味します。
<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 認証を無効にする
Basic 認証を無効にするには、Edge Management Server で次の Edge Management API 呼び出しを使用します。前のセクションで返された 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 を無効にすると、Basic Auth の認証情報を渡す Edge Management API 呼び出しは次のエラーを返します。
<Error>
<Code>security.SecurityProfileBasicAuthDisabled</Code>
<Message>Basic Authentication scheme not allowed</Message>
<Contexts/>
</Error>Basic Auth を再び有効にする
なんらかの理由で Basic Auth を再度有効にする必要がある場合は、次の手順を行う必要があります。
注意: 基本認証を再度有効にするには、Edge で SAML を含むすべての認証を一時的に無効にする必要があります。
- 任意の Edge ZooKeeper ノードにログインします。
- 次の bash スクリプトを実行して、すべてのセキュリティを無効にします。
注意: この手順により、SAML を含む Edge のすべての認証が無効になります。
#! /bin/bash
/opt/apigee/apigee-zookeeper/bin/zkCli.sh -server localhost:2181 <<EOFset /system/securityprofile <SecurityProfile></SecurityProfile>quitEOF
次のような出力が表示されます。
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 認証と 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>'