AKS 관리형 Microsoft Entra 통합을 사용하여 로컬 계정 관리

AKS 클러스터를 배포할 때 로컬 계정은 기본적으로 사용하도록 설정됩니다. RBAC 또는 Microsoft Entra 통합을 사용하더라도 --admin 액세스는 계속 감사할 수 없는 백도어 옵션으로 존재합니다. 이 문서는 기존 클러스터에서 로컬 계정을 사용하지 않도록 하고, 로컬 계정이 사용되지 않는 새로운 클러스터를 만들며, 기존 클러스터에서 로컬 계정을 다시 사용하는 방법을 보여 줍니다.

시작하기 전에

로컬 계정 사용 중지

disable-local-accounts 매개 변수를 사용하여 로컬 계정을 사용하지 않도록 설정할 수 있습니다. 기능이 클러스터에서 사용하도록 설정되었는지 여부를 나타내는 필드 properties.disableLocalAccounts도 관리 클러스터 API에 추가되었습니다.

참고 항목

  • Microsoft Entra 통합이 사용되는 클러스터에서는 aad-admin-group-object-ids로 지정된 Microsoft Entra 관리자 그룹에 할당된 사용자가 비관리자 자격 증명을 이용해 액세스 권한을 계속 얻을 수 있습니다. Microsoft Entra 통합이 사용되지 않고 properties.disableLocalAccountstrue로 설정된 클러스터에서는 사용자 또는 관리자 자격 증명을 이용해 인증하려는 시도에 실패하게 됩니다.

  • 로컬 사용자 계정을 인증했을 수 있는 기존 AKS 클러스터에서 로컬 계정을 사용하지 않도록 설정하면 관리자는 해당 사용자가 액세스할 수 있는 인증서를 철회하기 위해 클러스터 인증서를 회전해야 합니다. 새 클러스터인 경우 아무 작업도 필요하지 않습니다.

로컬 계정이 없는 새 클러스터 만들기

  1. 로컬 계정 없이 새 AKS 클러스터를 만들려면 az aks create 플래그와 함께 disable-local-accounts 명령을 사용합니다.

    az aks create -g <resource-group> -n <cluster-name> --enable-aad --aad-admin-group-object-ids <aad-group-id> --disable-local-accounts
    
  2. 출력에서 properties.disableLocalAccounts 필드가 true로 설정되어 있는지 확인하여 로컬 계정이 사용되지 않는지 확인합니다.

    "properties": {
        ...
        "disableLocalAccounts": true,
        ...
    }
    
  3. az aks get-credentials 명령을 실행하여 클러스터가 로컬 계정을 사용하지 않도록 설정되었는지 확인합니다.

    az aks get-credentials --resource-group <resource-group> --name <cluster-name> --admin
    

    기능이 액세스를 차단하고 있음을 나타내는 다음 오류 메시지가 출력에 표시됩니다.

    Operation failed with status: 'Bad Request'. Details: Getting static credential isn't allowed because this cluster is set to disable local accounts.
    

기존 클러스터에서 로컬 계정 사용 안 함

  1. disable-local-accounts 매개 변수와 함께 az aks update 명령을 사용하여 기존 Microsoft Entra 통합 지원 AKS 클러스터에서 로컬 계정을 사용 중지합니다.

    az aks update -g <resource-group> -n <cluster-name> --disable-local-accounts
    
  2. 출력에서 properties.disableLocalAccounts 필드가 true로 설정되어 있는지 확인하여 로컬 계정이 사용되지 않는지 확인합니다.

    "properties": {
        ...
        "disableLocalAccounts": true,
        ...
    }
    
  3. az aks get-credentials 명령을 실행하여 클러스터가 로컬 계정을 사용하지 않도록 설정되었는지 확인합니다.

    az aks get-credentials --resource-group <resource-group> --name <cluster-name> --admin
    

    기능이 액세스를 차단하고 있음을 나타내는 다음 오류 메시지가 출력에 표시됩니다.

    Operation failed with status: 'Bad Request'. Details: Getting static credential isn't allowed because this cluster is set to disable local accounts.
    

기존 클러스터에서 로컬 계정 다시 사용

  1. enable-local-accounts 매개 변수와 함께 az aks update 명령을 사용하여 기존 클러스터에서 사용되지 않는 로컬 계정을 다시 사용합니다.

    az aks update -g <resource-group> -n <cluster-name> --enable-local-accounts
    
  2. 출력에서 properties.disableLocalAccounts 필드가 false로 설정되어 있는지 확인하여 로컬 계정이 다시 사용되는지 확인합니다.

    "properties": {
        ...
        "disableLocalAccounts": false,
        ...
    }
    
  3. az aks get-credentials 명령을 실행하여 클러스터가 로컬 계정을 사용하도록 설정되었는지 확인합니다.

    az aks get-credentials --resource-group <resource-group> --name <cluster-name> --admin
    

    클러스터에서 로컬 계정을 사용함을 나타내는 다음 메시지가 출력에 표시됩니다.

    Merged "<cluster-name>-admin" as current context in C:\Users\<username>\.kube\config
    

다음 단계