Edge で Basic 認証を無効にする

Edge for Private Cloud v4.19.01

Edge で SAML を有効にしたら、Basic 認証を無効にできます。ただし、 Basic 認証を無効にする:

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

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

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

curl -H "accept:application/xml" http://localhost:8080/v1/securityprofile -u sysAdminEmail:pWord

SAML をまだ構成していない場合、レスポンスは次のようになります。つまり、Basic 認証は enabled:

<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 が有効になっているバージョンには、 &lt;BasicAuthEnabled&gt;true&lt;/BasicAuthEnabled&gt;: Basic 認証が 引き続き有効です。

Basic 認証を無効にする

Basic を無効にするには、Edge 管理サーバーで次の Edge 管理 API 呼び出しを使用します 認証前のセクションで返された XML オブジェクトをペイロードとして渡していることに注意してください。唯一の 違いは、 &lt;BasicAuthEnabled&gt;false&lt;/BasicAuthEnabled&gt;:

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 認証を無効にした後は、Basic 認証の認証情報を渡す Edge Management API 呼び出し 次のエラーが返されます。

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

Basic 認証を再度有効にする

なんらかの理由で Basic 認証を再度有効にする必要がある場合は、次の手順を行う必要があります。

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

    これで Basic 認証を再び使用できるようになりました。