Edge で Basic 認証を無効にする

Edge for Private Cloud v4.19.01

Edge で SAML を有効にしたら、Basic 認証を無効にできます。ただし、基本認証を無効にする前に、次のことを行う必要があります。

  • システム管理者を含むすべての Edge ユーザーを SAML IDP に追加していることを確認します。
  • Edge UI と Edge Management API で SAML 認証を十分にテストしていることを確認します。
  • Apigee Developer Services ポータル(略して「ポータル」)を使用している場合は、ポータルで SAML を構成してテストし、ポータルが Edge に接続できることを確認します。Edge との通信に SAML を使用するようにポータルを構成するをご覧ください。

現在のセキュリティ プロファイルの表示

Edge セキュリティ プロファイルを表示して、現在の構成を確認し、Basic 認証と SAML が現在有効になっているかどうかを判断できます。Edge で現在使用されているセキュリティ プロファイルを表示するには、Edge Management Server で次の Edge Management API 呼び出しを使用します。

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> も表示されます。これは、基本認証が引き続き有効であることを意味します。

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 を再度有効にする必要がある場合は、次の手順を行う必要があります。

  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. 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>'

    基本認証を再度使用できるようになりました。