Edge에서 기본 인증 사용 중지

Edge에서 SAML 또는 LDAP를 사용 설정한 후 기본 인증을 사용 중지할 수 있습니다. 하지만 기본 인증을 사용 중지하기 전에:

  • 시스템 관리자를 포함한 모든 Edge 사용자를 IDP에 추가했는지 확인합니다.
  • 새 Edge UI 및 Edge Management API에서 IDP 인증을 철저히 테스트했는지 확인합니다.

현재 보안 프로필 보기

Edge 보안 프로필을 보고 현재 구성을 확인하여 기본 인증 및 외부 IDP가 현재 사용 설정되어 있는지 확인할 수 있습니다. Edge Management Server에서 다음 Edge management API 호출을 사용하여 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 Server에서 다음 Edge Management API 호출을 사용하여 기본 인증을 사용 중지합니다.

기본 인증을 사용 중지하려면 이전 섹션에서 반환된 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 Management API 호출은 다음 오류를 반환합니다.

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

기본 인증 다시 사용 설정

어떤 이유로든 기본 인증을 다시 사용 설정해야 하는 경우 다음 단계를 수행해야 합니다.

  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. 기본 인증 및 외부 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>'

이제 기본 인증을 다시 사용할 수 있습니다. 새 Edge UI를 SSO에서 기본 인증으로 다시 전환하려면 새 Edge UI 구성 파일에서 AUTH_MODE=basic 및 MANAGEMENT_UI_SSO_ENABLED=n을 설정한 후 /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 실행).