InfoGrab DocsInfoGrab Docs

Terraform Azure VM 자동 검색 구성

요약

이 가이드는 Terraform을 사용하여 Teleport와 Azure를 구성하고, Azure 가상 머신을 Teleport 클러스터에 자동으로 등록하는 방법을 설명합니다. teleport-discovery-azure Terraform 모듈은 Discovery Service가 Teleport Azure 가상 머신 자동 검색을 수행하는 데 필요한 Azure 리소스와 Teleport 클러스터 리소스를 생성합니다.

이 가이드는 Terraform을 사용하여 Teleport와 Azure를 구성하고, Azure 가상 머신을 Teleport 클러스터에 자동으로 등록하는 방법을 설명합니다.

작동 방식#

teleport-discovery-azure Terraform 모듈은 Discovery Service가 Teleport Azure 가상 머신 자동 검색을 수행하는 데 필요한 Azure 리소스와 Teleport 클러스터 리소스를 생성합니다.

Teleport Discovery Service는 Azure API를 조회하여 구성한 구독, 리소스 그룹, 태그와 일치하는 가상 머신 목록을 가져옵니다. 검색한 각 가상 머신에 대해 Discovery Service는 Azure Run Command 기능을 사용하여 인스턴스에 Teleport를 설치하고, Teleport로 보호되는 서버로 클러스터에 조인시킵니다.

사전 요구사항#

  • 실행 중인 Teleport 클러스터. Teleport를 시작하려면 무료 체험판에 가입하거나 데모 환경을 구성하세요.

  • tctl and tsh clients.

    Installing `tctl` and `tsh` clients
    1. Teleport 클러스터의 버전을 확인합니다. tctl and tsh clients는 Teleport 클러스터 버전보다 최대 한 개의 메이저 버전까지만 뒤처질 수 있습니다. Proxy Service의 /v1/webapi/find로 GET 요청을 보내고 JSON 쿼리 도구를 사용하여 클러스터 버전을 확인합니다. teleport.example.com:443를 Teleport Proxy Service의 웹 주소로 바꿉니다:

      $ TELEPORT_DOMAIN=teleport.example.com:443
      $ TELEPORT_VERSION="$(curl -s https://$TELEPORT_DOMAIN/v1/webapi/find | jq -r '.server_version')"
      
    2. 사용 중인 플랫폼에 대한 지침에 따라 tctl and tsh clients를 설치합니다:

Mac

     `tctl` and `tsh` clients가 포함된, 서명된 Teleport macOS .pkg 설치 프로그램을 다운로드합니다:
 
     ```code
     $ curl -O https://cdn.teleport.dev/teleport-${TELEPORT_VERSION?}.pkg
     ```

     Finder에서 `pkg` 파일을 더블 클릭하여 설치를 시작합니다.
 
     
Warning
       Homebrew를 사용하여 Teleport를 설치하는 것은 지원되지 않습니다. Homebrew의
       Teleport 패키지는 Teleport에서 유지 관리하지 않으므로 신뢰성이나 보안을
       보장할 수 없습니다.
     

Windows - Powershell

     ```code
     $ curl.exe -O https://cdn.teleport.dev/teleport-v${TELEPORT_VERSION?}-windows-amd64-bin.zip
     # Unzip the archive and move the `tctl` and `tsh` clients to your %PATH%
     # NOTE: Do not place the `tctl` and `tsh` clients in the System32 directory, as this can cause issues when using WinSCP.
     # Use %SystemRoot% (C:\Windows) or %USERPROFILE% (C:\Users\<username>) instead.
     ```
 
   

 
   

Linux

     Linux 설치판의 모든 Teleport 바이너리에는 `tctl` and `tsh` clients가 포함되어 있습니다.  RPM/DEB
     패키지 및 i386/ARM/ARM64용 다운로드를 포함한 더 많은 옵션은
     [설치 페이지](../installation/installation.mdx)를 참조하세요.
 
     ```code
     $ curl -O https://cdn.teleport.dev/teleport-v${TELEPORT_VERSION?}-linux-amd64-bin.tar.gz
     $ tar -xzf teleport-v${TELEPORT_VERSION?}-linux-amd64-bin.tar.gz
     $ cd teleport
     $ sudo ./install
     # Teleport binaries have been copied to /usr/local/bin
     ```
   

 

Teleport cluster에 연결할 수 있는지 확인하려면 tsh login으로 로그인한 다음, 현재 자격 증명으로 tctl 명령을 실행할 수 있는지 확인합니다.

예를 들어, teleport.example.com에 cluster 내 Teleport Proxy Service의 도메인 이름을, email@example.com에 Teleport 사용자 이름을 지정하여 다음 명령을 실행합니다:

$ tsh login --proxy=teleport.example.com --user=email@example.com
$ tctl status
# Cluster  (=teleport.url=)
# Version  (=teleport.version=)
# CA pin   (=presets.ca_pin=)

cluster에 연결하여 tctl status 명령을 실행할 수 있다면, 현재 자격 증명을 사용하여 워크스테이션에서 이후의 tctl 명령을 실행할 수 있습니다. 자체 Teleport cluster를 호스팅하는 경우, 전체 권한을 얻기 위해 Teleport Auth Service를 호스팅하는 컴퓨터에서 tctl 명령을 실행할 수도 있습니다.

1/5단계. Discovery Service를 실행할 Teleport 설치#

Tip

이미 실행 중인 Discovery Service 인스턴스가 있다면 해당 인스턴스의 discovery_group을 discovery-group-name에 지정하고 3/5단계: teleport-discovery-azure Terraform 모듈 사용으로 진행합니다.

모든 Teleport Cloud 클러스터는 Discovery Service를 대신 실행하므로, Teleport Cloud 구독자도 이 설치 단계를 모두 건너뛸 수 있습니다.

Teleport 설치#

이미 다른 Teleport 서비스(예: Auth 또는 Proxy)를 실행 중인 호스트에서 Discovery Service를 함께 실행할 계획이라면 이 단계를 건너뛸 수 있습니다.

Discovery Service를 실행할 호스트 인스턴스에 Teleport를 설치합니다:

Linux 서버에 Teleport Agent를 설치하려면:

권장 설치 방법은 클러스터 설치 스크립트입니다. 이 스크립트는 클러스터에 맞는 올바른 버전, 에디션, 설치 모드를 선택합니다.

  1. teleport.example.com:443에 Teleport 클러스터의 호스트명과 포트를 할당하되, 스킴(https://)은 포함하지 마십시오.

  2. 클러스터의 설치 스크립트를 실행하십시오:

    $ curl "https://teleport.example.com:443/scripts/install.sh" | sudo bash
    

Discovery Service 구성#

Discovery Service를 별도의 호스트에서 실행하는 경우, 클러스터에 연결하려면 유효한 초대 토큰이 필요합니다. Teleport Auth Service에 대해 다음 명령을 실행하여 토큰을 생성합니다:

$ tctl tokens add --type=discovery

생성된 토큰을 Discovery Service를 실행할 호스트의 /tmp/token에 저장합니다.

Warning

Discovery Service는 검색된 리소스를 서로 다른 집합으로 그룹화할 수 있게 하는 구성 파라미터 discovery_service.discovery_group을 제공합니다. 이 파라미터는 서로 다른 클라우드 리소스 집합을 감시하는 Discovery Agent들이 서로 충돌하여 다른 서비스가 생성한 리소스를 삭제하는 것을 방지하는 데 사용됩니다.

여러 개의 Discovery Service를 실행할 때, 동일한 클라우드 리소스를 감시하는 경우에는 각 서비스가 동일한 discovery_group 값으로 구성되어 있는지 확인해야 하며, 서로 다른 클라우드 리소스를 감시하는 경우에는 서로 다른 값으로 구성해야 합니다.

동일한 Teleport 클러스터에서 구성을 혼합하여 실행할 수 있습니다. 즉 일부 Discovery Service는 동일한 클라우드 리소스를 감시하도록 구성하고 다른 서비스는 서로 다른 리소스를 감시하도록 구성할 수 있습니다. 예를 들어, 서로 다른 두 개의 클라우드 계정에서 데이터를 분석하는 4개 에이전트 고가용성 구성은 다음과 같은 구성으로 실행됩니다.

  • Production 계정에서 데이터를 폴링하는 discovery_group: "prod"로 구성된 Discovery Service 2개.
  • Staging 계정에서 데이터를 폴링하는 discovery_group: "staging"로 구성된 Discovery Service 2개.

teleport.example.com:443에는 클러스터의 Teleport Proxy Service 호스트와 포트를 지정하고, discovery-group-name에는 등록할 리소스 그룹을 식별하는 이름을 지정합니다:

# teleport.yaml
version: v3
teleport:
  join_params:
    # token_name can be a literal token string or a path to a file.
    # File path is preferable to avoid including a secret in the config file.
    token_name: "/tmp/token"
    method: token
  proxy_server: "teleport.example.com:443"
auth_service:
  enabled: false
proxy_service:
  enabled: false
ssh_service:
  enabled: false
discovery_service:
  enabled: true
  discovery_group: "discovery-group-name"

Teleport 시작#

systemd 서비스를 생성하여 호스트가 부팅될 때 the Discovery Service이 자동으로 시작되도록 구성합니다. 지침은 the Discovery Service을 어떻게 설치했는지에 따라 다릅니다.

Package Manager

the Discovery Service을 실행할 호스트에서 Teleport를 활성화하고 시작합니다:

$ sudo systemctl enable teleport
$ sudo systemctl start teleport

TAR Archive

the Discovery Service을 실행할 호스트에서 Teleport용 systemd 서비스 구성을 생성하고, Teleport 서비스를 활성화한 후 Teleport를 시작합니다:

$ sudo teleport install systemd -o /etc/systemd/system/teleport.service
$ sudo systemctl enable teleport
$ sudo systemctl start teleport

systemctl status teleport로 the Discovery Service의 상태를 확인하고 journalctl -fu teleport로 로그를 볼 수 있습니다.

2/5단계. 검색된 VM용 ID 설정#

검색 대상이 되는 모든 Azure VM에는 시스템 할당 관리 ID 또는 사용자 할당 관리 ID 중 하나가 할당되어 있어야 합니다.

Note

이 섹션의 내용은 원문 문서를 참조하세요. (azure-join-enable-identity.mdx)

3/5단계. teleport-discovery-azure Terraform 모듈 사용#

AzureRM Terraform 프로바이더 구성#

AzureRM Terraform 프로바이더와, Terraform이 Azure 리소스를 관리하는 데 필요한 Azure 권한을 구성합니다.

AzureRM Terraform 프로바이더에 필요한 Azure 권한

AzureRM Terraform 프로바이더에는 teleport-discovery-azure 모듈이 리소스를 생성하는 범위에서 다음 Azure 권한이 필요합니다:

  • Microsoft.ManagedIdentity/userAssignedIdentities/read
  • Microsoft.ManagedIdentity/userAssignedIdentities/write
  • Microsoft.ManagedIdentity/userAssignedIdentities/delete
  • Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/read
  • Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/write
  • Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/delete
  • Microsoft.Authorization/roleDefinitions/read
  • Microsoft.Authorization/roleDefinitions/write
  • Microsoft.Authorization/roleDefinitions/delete
  • Microsoft.Authorization/roleAssignments/read
  • Microsoft.Authorization/roleAssignments/write
  • Microsoft.Authorization/roleAssignments/delete

Teleport Terraform 프로바이더 구성#

CI, Spacelift 등 원격 환경처럼 Terraform을 실행하는 방식에 따라 Teleport Terraform 프로바이더를 구성하는 방법이 여러 가지 있지만, 빠르게 시작하려면 로컬 데모 가이드를 참고하십시오.

로컬 데모 가이드는 로컬 Teleport 자격 증명으로 Teleport Terraform 프로바이더를 구성하는 방법을 안내합니다. 일반적으로 terraform 명령을 실행하는 셸과 동일한 셸에서 tsh로 로그인하고 tctl 명령을 실행해야 합니다:

$ tsh login
$ eval "$(tctl terraform env)"

클라우드 VM, 온프레미스 서버, CI/CD 파이프라인과 같은 원격 환경에서 Terraform을 실행하는 경우, Teleport Terraform 프로바이더 사용하기에서 사용 사례에 맞는 가이드를 확인합니다.

Terraform 모듈 입력 구성#

Terraform 구성에 teleport-discovery-azure 모듈을 추가합니다.

Tip

관리 그룹의 여러 구독에 걸쳐 VM을 검색하려면 관리 그룹을 사용하여 여러 구독의 VM 검색을 참고합니다.

module "azure_discovery" {
  source  = "terraform.releases.teleport.dev/teleport/discovery/azure"
  version = "~> (=cloud.major_version=).0"

  # Required inputs:
  # Assign example.teleport.sh:443 to your Teleport cluster's proxy public address in host:port form.
  teleport_proxy_public_addr    = "example.teleport.sh:443"
  # teleport_discovery_group_name must match the discovery group name in your Discovery Service config.
  # Teleport Cloud clusters run the Discovery Service in the group name "cloud-discovery-group".
  # Do not modify this input unless you intend to run your own Discovery Service.
  teleport_discovery_group_name = "cloud-discovery-group"

  # Name of an existing Azure Resource Group where Azure resources will be created.
  azure_resource_group_name       = "my-resource-group"
  # Azure region where the managed identity used by the Discovery Service will be created.
  azure_managed_identity_location = "eastus"

  # Matchers configure which Azure resources the Discovery Service will discover and enroll into Teleport.
  azure_matchers = [
    {
      types = ["vm"]
      # subscriptions filters which Azure subscriptions are scanned for VMs.
      subscriptions = ["subscription-id"]
      # resource_groups filters which resource groups are scanned. The wildcard matches all resource groups.
      resource_groups = ["*"]
      # regions filters which Azure regions are scanned. The wildcard matches all regions.
      regions = ["*"]
      # tags filter which VMs are enrolled. The wildcard matches all tags.
      tags = { "*" : ["*"] }
    }
  ]

  # Optional inputs:
  # Apply the additional Azure tag "origin=example" to all Azure resources created by this module
  apply_azure_tags               = { origin = "example" }
  # Apply the additional Teleport label "origin=example" to all Teleport resources created by this module
  apply_teleport_resource_labels = { origin = "example" }
}
Note

Teleport Azure OIDC 연동은 페더레이션 ID 자격 증명을 사용하여 Discovery Service를 관리 ID로 인증하므로, Teleport Proxy Service가 퍼블릭 인터넷에서 접근 가능해야 합니다.

프라이빗 네트워크에 있는 Teleport 클러스터는 use_oidc_integration = false로 설정하고 Discovery Service 호스트에 관리 ID를 직접 할당합니다.

필요한 권한을 가진 관리 ID가 이미 있다면, 모듈 구성에 create_azure_managed_identity = false를 추가로 설정하여 관리 ID 생성을 건너뜁니다. 필요한 권한은 모듈 레퍼런스를 참고합니다.

구성을 적용한 뒤에는 Discovery Service 호스트에 관리 ID 할당을 진행합니다.

module "azure_discovery" {
  source  = "terraform.releases.teleport.dev/teleport/discovery/azure"
  version = "~> (=teleport.major_version=).0"

  # Required inputs:
  # Edit this input to the host and port of the Teleport Proxy Service in your cluster
  teleport_proxy_public_addr    = "teleport.example.com:443"
  # Assign discovery-group-name to the discovery group name in your Discovery Service config file.
  teleport_discovery_group_name = "discovery-group-name"

  # Name of an existing Azure Resource Group where Azure resources will be created.
  azure_resource_group_name       = "my-resource-group"
  # Azure region where the managed identity used by the Discovery Service will be created.
  azure_managed_identity_location = "eastus"

  # Matchers to configure the Discovery Service; used to discover and enroll Azure resources into Teleport.
  azure_matchers = [
    {
      types = ["vm"]
      # subscriptions filters which Azure subscriptions are scanned for VMs.
      subscriptions = ["subscription-id"]
      # resource_groups filters which resource groups are scanned. The wildcard matches all resource groups.
      resource_groups = ["*"]
      # regions filters which Azure regions are scanned. The wildcard matches all regions.
      regions = ["*"]
      # tags filter which VMs are enrolled. The wildcard matches all tags.
      tags = { "*" : ["*"] }
    }
  ]

  # Optional inputs:
  # Apply the additional Azure tag "origin=example" to all Azure resources created by this module
  apply_azure_tags               = { origin = "example" }
  # Apply the additional Teleport label "origin=example" to all Teleport resources created by this module
  apply_teleport_resource_labels = { origin = "example" }
}

Terraform이 모듈의 출력을 표시하도록 모듈용 Terraform 출력을 추가합니다:

output "azure_discovery" {
  value = module.azure_discovery
}

모듈 입력과 출력에 대한 전체 설명은 teleport-discovery-azure 레퍼런스를 참고합니다.

4/5단계. Terraform 모듈 적용#

$ terraform init
$ terraform apply

Terraform은 다음 리소스를 생성하도록 계획해야 합니다:

  • Teleport Discovery Service용 Azure 사용자 할당 관리 ID
  • OIDC 워크로드 ID 페더레이션용 Azure 페더레이션 ID 자격 증명
  • VM 검색에 필요한 권한을 갖춘 Azure 사용자 지정 역할 정의
  • 구성된 구독 또는 관리 그룹 범위의 Azure 역할 할당
  • Azure 리소스 검색을 위해 Teleport를 구성하는 Teleport discovery_config 클러스터 리소스
  • Azure OIDC용 Teleport integration 클러스터 리소스
  • Teleport 노드가 Azure 자격 증명으로 클러스터에 조인할 수 있게 하는 Teleport token 클러스터 리소스

Terraform 계획을 검토하고 계획된 작업을 확인합니다.

Terraform이 계획 적용을 마치면 다음과 같이 모듈 출력이 표시됩니다:

azure_discovery = {
  "teleport_discovery_config_name"            = "discovery-abcd0123"
  "teleport_integration_name"                 = "discovery-abcd0123"
  "teleport_provision_token_name"             = "discovery-abcd0123"
  "azure_discovery_role_definition"           = { ... }
  "azure_teleport_discovery_managed_identity" = { ... }
}

Azure 리소스에는 다음 태그가 있어야 합니다:

  • origin=example
  • TeleportCluster=<cluster-name>
  • TeleportIntegration=discovery-abcd0123
  • TeleportIACTool=terraform

Teleport 리소스에는 다음 라벨이 있어야 합니다:

  • origin=example
  • teleport.dev/iac-tool=terraform

Discovery Service 호스트에 관리 ID 할당#

Azure에서 실행되는 셀프 호스팅 Teleport 클러스터에서 모듈을 use_oidc_integration = false로 구성한 경우, Terraform 모듈이 생성한 관리 ID를 Discovery Service를 실행하는 VM에 할당합니다. Discovery Service는 사용자 할당 ID를 사용하여 Azure Instance Metadata Service(IMDS)를 통해 Azure에 인증합니다.

Discovery Service를 실행하는 VM을 Terraform으로 관리한다면, 호스트 VM 리소스의 identity 블록에서 모듈 출력을 참조합니다:

resource "azurerm_linux_virtual_machine" "teleport" {
  # ...

  identity {
    type         = "UserAssigned"
    identity_ids = [module.azure_discovery.azure_teleport_discovery_managed_identity.id]
  }
}

또는 Azure CLI를 사용하여 기존 VM에 ID를 할당할 수 있습니다. discovery-service-vm-name에는 Discovery Service를 실행하는 VM의 이름을, discovery-service-vm-resource-group에는 해당 VM의 리소스 그룹을, azure-managed-identity-id에는 모듈의 azure_teleport_discovery_managed_identity 출력에 있는 id를 지정합니다.

$ az vm identity assign \
    --name discovery-service-vm-name \
    --resource-group discovery-service-vm-resource-group \
    --identities "azure-managed-identity-id"

5/5단계. 검색 상태 확인#

Terraform 모듈을 적용하면 Teleport Discovery Service가 Azure VM 인스턴스를 검색하고 보호 대상 리소스로 클러스터에 등록하기 시작합니다.

Note

가상 머신이 검색되어 등록되기까지 몇 분 정도 걸릴 수 있습니다.

Teleport Web UI에서 Zero Trust Access > Integrations를 선택합니다. 기본적으로 teleport-discovery-azure Terraform 모듈이 생성한 연동의 이름은 discovery-<random>입니다.

연동을 클릭하여 검색 상태를 확인합니다.

연동 페이지에서는 검색된 가상 머신의 수와 검색 과정에서 발생한 문제를 한눈에 확인할 수 있습니다.

모듈 구성 업데이트#

모듈 입력을 변경하고 다시 적용하여 Azure 검색 연동을 조정할 수 있습니다.

예를 들어 이전에 모든 리전을 의미하는 와일드카드 기본값 대신 특정 Azure 리전을 지정했다면, Azure 매처의 regions를 조정하여 Azure 검색 대상 리전을 추가하고 모듈을 다시 적용하면 해당 리전의 인스턴스도 등록되기 시작합니다.

 azure_matchers = [
   {
     types           = ["vm"]
     subscriptions   = ["subscription-id"]
     resource_groups = ["*"]
-    regions         = ["eastus"]
+    regions         = ["eastus", "westus"]
     tags            = { "*" : ["*"] }
   }
 ]

Terraform을 다시 적용합니다:

$ terraform apply

변경을 확정하기 전에 Terraform 계획을 검토합니다.

Terraform이 계획 적용을 마치면 Discovery Service가 동적 discovery_config의 변경 사항을 반영하여 새로 구성한 리전의 VM을 등록하기 시작합니다.

관리 그룹을 사용하여 여러 구독의 VM 검색#

관리 그룹에 속한 모든 구독의 VM을 검색하려면 azure_management_group_id 입력을 추가하고 와일드카드("*") 구독 매처를 사용합니다. 테넌트 루트 그룹을 대상으로 하려면 테넌트 ID를 지정할 수 있습니다.

module "azure_discovery" {
  source  = "terraform.releases.teleport.dev/teleport/discovery/azure"
  version = "~> (=teleport.major_version=).0"

  teleport_proxy_public_addr    = "teleport.example.com:443"
  teleport_discovery_group_name = "discovery-group-name"

  # Management group ID or tenant ID. Using a tenant ID targets the
  # Tenant root group, which requires elevated access.
  azure_management_group_id = "management-group-id"

  # Name of an existing Azure Resource Group where Azure resources will be created.
  azure_resource_group_name       = "my-resource-group"
  # Azure region where the managed identity used by the Discovery Service will be created.
  azure_managed_identity_location = "eastus"

  azure_matchers = [
    {
      types = ["vm"]
      # The wildcard discovers VMs across all subscriptions visible to the
      # managed identity's role assignment scope.
      subscriptions = ["*"]
      # regions filters which Azure regions are scanned. The wildcard matches all regions.
      regions = ["*"]
      # tags filter which VMs are enrolled. The wildcard matches all tags.
      tags = { "*" : ["*"] }
    }
  ]
}

모듈은 제공된 관리 그룹 범위를 사용하여 역할 정의와 역할 할당을 생성하고, 테넌트 ID를 사용하여 프로비저닝 토큰 허용 규칙을 생성합니다.

Warning

테넌트 ID를 관리 그룹 ID로 사용하면 테넌트 루트 그룹을 대상으로 하게 되며, 이를 위해서는 상승된 접근 권한이 필요합니다.

전체 구성 예시는 관리 그룹 예시를 참고합니다.

여러 관리 그룹에 걸쳐 VM 검색#

여러 관리 그룹에 걸쳐 VM을 검색하려면 azure_management_group_id를 하위 관리 그룹 계층의 최상위에 있는 관리 그룹으로 설정합니다. azure_role_assignment_scopes 입력을 사용하여 관리 ID의 역할 할당에 대한 정규화된 범위를 명시적으로 지정합니다.

와일드카드 구독 매처(["*"])를 사용하면 Discovery Service는 azure_role_assignment_scopes의 역할 할당에서 볼 수 있는 구독의 VM을 검색합니다.

azure_role_assignment_scopes를 지정한 경우에는 teleport_provision_token_allow_rules도 명시적으로 설정해야 합니다.

module "azure_discovery" {
  source  = "terraform.releases.teleport.dev/teleport/discovery/azure"
  version = "~> (=teleport.major_version=).0"

  teleport_proxy_public_addr    = "teleport.example.com:443"
  teleport_discovery_group_name = "discovery-group-name"

  azure_resource_group_name       = "my-resource-group"
  azure_managed_identity_location = "eastus"

  # Common parent management group, used as the role definition's assignable scope.
  azure_management_group_id = "management-group-id"

  # Role assignments are created at each scope. The wildcard subscription
  # matcher will discover subscriptions visible to the assigned scopes.
  azure_role_assignment_scopes = [
    "/providers/Microsoft.Management/managementGroups/management-group-1",
    "/providers/Microsoft.Management/managementGroups/management-group-2",
  ]

  azure_matchers = [
    {
      types         = ["vm"]
      subscriptions = ["*"]
    }
  ]

  teleport_provision_token_allow_rules = [
    { tenant = "00000000-0000-0000-0000-000000000000" }
  ]
}

문제 해결#

Note

이 섹션의 내용은 원문 문서를 참조하세요. (azure-vm-troubleshooting.mdx)

다음 단계#

Note

이 섹션의 내용은 원문 문서를 참조하세요. (azure-vm-next-steps.mdx)

Terraform Azure VM 자동 검색 구성

Teleport v18.11
원문 보기

요약

이 가이드는 Terraform을 사용하여 Teleport와 Azure를 구성하고, Azure 가상 머신을 Teleport 클러스터에 자동으로 등록하는 방법을 설명합니다. teleport-discovery-azure Terraform 모듈은 Discovery Service가 Teleport Azure 가상 머신 자동 검색을 수행하는 데 필요한 Azure 리소스와 Teleport 클러스터 리소스를 생성합니다.

이 가이드는 Terraform을 사용하여 Teleport와 Azure를 구성하고, Azure 가상 머신을 Teleport 클러스터에 자동으로 등록하는 방법을 설명합니다.

작동 방식#

teleport-discovery-azure Terraform 모듈은 Discovery Service가 Teleport Azure 가상 머신 자동 검색을 수행하는 데 필요한 Azure 리소스와 Teleport 클러스터 리소스를 생성합니다.

Teleport Discovery Service는 Azure API를 조회하여 구성한 구독, 리소스 그룹, 태그와 일치하는 가상 머신 목록을 가져옵니다. 검색한 각 가상 머신에 대해 Discovery Service는 Azure Run Command 기능을 사용하여 인스턴스에 Teleport를 설치하고, Teleport로 보호되는 서버로 클러스터에 조인시킵니다.

사전 요구사항#

  • 실행 중인 Teleport 클러스터. Teleport를 시작하려면 무료 체험판에 가입하거나 데모 환경을 구성하세요.

  • tctl and tsh clients.

    Installing `tctl` and `tsh` clients
    1. Teleport 클러스터의 버전을 확인합니다. tctl and tsh clients는 Teleport 클러스터 버전보다 최대 한 개의 메이저 버전까지만 뒤처질 수 있습니다. Proxy Service의 /v1/webapi/find로 GET 요청을 보내고 JSON 쿼리 도구를 사용하여 클러스터 버전을 확인합니다. teleport.example.com:443를 Teleport Proxy Service의 웹 주소로 바꿉니다:

      $ TELEPORT_DOMAIN=teleport.example.com:443
      $ TELEPORT_VERSION="$(curl -s https://$TELEPORT_DOMAIN/v1/webapi/find | jq -r '.server_version')"
      
    2. 사용 중인 플랫폼에 대한 지침에 따라 tctl and tsh clients를 설치합니다:

Mac

     `tctl` and `tsh` clients가 포함된, 서명된 Teleport macOS .pkg 설치 프로그램을 다운로드합니다:
 
     ```code
     $ curl -O https://cdn.teleport.dev/teleport-${TELEPORT_VERSION?}.pkg
     ```

     Finder에서 `pkg` 파일을 더블 클릭하여 설치를 시작합니다.
 
     
Warning
       Homebrew를 사용하여 Teleport를 설치하는 것은 지원되지 않습니다. Homebrew의
       Teleport 패키지는 Teleport에서 유지 관리하지 않으므로 신뢰성이나 보안을
       보장할 수 없습니다.
     

Windows - Powershell

     ```code
     $ curl.exe -O https://cdn.teleport.dev/teleport-v${TELEPORT_VERSION?}-windows-amd64-bin.zip
     # Unzip the archive and move the `tctl` and `tsh` clients to your %PATH%
     # NOTE: Do not place the `tctl` and `tsh` clients in the System32 directory, as this can cause issues when using WinSCP.
     # Use %SystemRoot% (C:\Windows) or %USERPROFILE% (C:\Users\<username>) instead.
     ```
 
   

 
   

Linux

     Linux 설치판의 모든 Teleport 바이너리에는 `tctl` and `tsh` clients가 포함되어 있습니다.  RPM/DEB
     패키지 및 i386/ARM/ARM64용 다운로드를 포함한 더 많은 옵션은
     [설치 페이지](../installation/installation.mdx)를 참조하세요.
 
     ```code
     $ curl -O https://cdn.teleport.dev/teleport-v${TELEPORT_VERSION?}-linux-amd64-bin.tar.gz
     $ tar -xzf teleport-v${TELEPORT_VERSION?}-linux-amd64-bin.tar.gz
     $ cd teleport
     $ sudo ./install
     # Teleport binaries have been copied to /usr/local/bin
     ```
   

 

Teleport cluster에 연결할 수 있는지 확인하려면 tsh login으로 로그인한 다음, 현재 자격 증명으로 tctl 명령을 실행할 수 있는지 확인합니다.

예를 들어, teleport.example.com에 cluster 내 Teleport Proxy Service의 도메인 이름을, email@example.com에 Teleport 사용자 이름을 지정하여 다음 명령을 실행합니다:

$ tsh login --proxy=teleport.example.com --user=email@example.com
$ tctl status
# Cluster  (=teleport.url=)
# Version  (=teleport.version=)
# CA pin   (=presets.ca_pin=)

cluster에 연결하여 tctl status 명령을 실행할 수 있다면, 현재 자격 증명을 사용하여 워크스테이션에서 이후의 tctl 명령을 실행할 수 있습니다. 자체 Teleport cluster를 호스팅하는 경우, 전체 권한을 얻기 위해 Teleport Auth Service를 호스팅하는 컴퓨터에서 tctl 명령을 실행할 수도 있습니다.

1/5단계. Discovery Service를 실행할 Teleport 설치#

Tip

이미 실행 중인 Discovery Service 인스턴스가 있다면 해당 인스턴스의 discovery_group을 discovery-group-name에 지정하고 3/5단계: teleport-discovery-azure Terraform 모듈 사용으로 진행합니다.

모든 Teleport Cloud 클러스터는 Discovery Service를 대신 실행하므로, Teleport Cloud 구독자도 이 설치 단계를 모두 건너뛸 수 있습니다.

Teleport 설치#

이미 다른 Teleport 서비스(예: Auth 또는 Proxy)를 실행 중인 호스트에서 Discovery Service를 함께 실행할 계획이라면 이 단계를 건너뛸 수 있습니다.

Discovery Service를 실행할 호스트 인스턴스에 Teleport를 설치합니다:

Linux 서버에 Teleport Agent를 설치하려면:

권장 설치 방법은 클러스터 설치 스크립트입니다. 이 스크립트는 클러스터에 맞는 올바른 버전, 에디션, 설치 모드를 선택합니다.

  1. teleport.example.com:443에 Teleport 클러스터의 호스트명과 포트를 할당하되, 스킴(https://)은 포함하지 마십시오.

  2. 클러스터의 설치 스크립트를 실행하십시오:

    $ curl "https://teleport.example.com:443/scripts/install.sh" | sudo bash
    

Discovery Service 구성#

Discovery Service를 별도의 호스트에서 실행하는 경우, 클러스터에 연결하려면 유효한 초대 토큰이 필요합니다. Teleport Auth Service에 대해 다음 명령을 실행하여 토큰을 생성합니다:

$ tctl tokens add --type=discovery

생성된 토큰을 Discovery Service를 실행할 호스트의 /tmp/token에 저장합니다.

Warning

Discovery Service는 검색된 리소스를 서로 다른 집합으로 그룹화할 수 있게 하는 구성 파라미터 discovery_service.discovery_group을 제공합니다. 이 파라미터는 서로 다른 클라우드 리소스 집합을 감시하는 Discovery Agent들이 서로 충돌하여 다른 서비스가 생성한 리소스를 삭제하는 것을 방지하는 데 사용됩니다.

여러 개의 Discovery Service를 실행할 때, 동일한 클라우드 리소스를 감시하는 경우에는 각 서비스가 동일한 discovery_group 값으로 구성되어 있는지 확인해야 하며, 서로 다른 클라우드 리소스를 감시하는 경우에는 서로 다른 값으로 구성해야 합니다.

동일한 Teleport 클러스터에서 구성을 혼합하여 실행할 수 있습니다. 즉 일부 Discovery Service는 동일한 클라우드 리소스를 감시하도록 구성하고 다른 서비스는 서로 다른 리소스를 감시하도록 구성할 수 있습니다. 예를 들어, 서로 다른 두 개의 클라우드 계정에서 데이터를 분석하는 4개 에이전트 고가용성 구성은 다음과 같은 구성으로 실행됩니다.

  • Production 계정에서 데이터를 폴링하는 discovery_group: "prod"로 구성된 Discovery Service 2개.
  • Staging 계정에서 데이터를 폴링하는 discovery_group: "staging"로 구성된 Discovery Service 2개.

teleport.example.com:443에는 클러스터의 Teleport Proxy Service 호스트와 포트를 지정하고, discovery-group-name에는 등록할 리소스 그룹을 식별하는 이름을 지정합니다:

# teleport.yaml
version: v3
teleport:
  join_params:
    # token_name can be a literal token string or a path to a file.
    # File path is preferable to avoid including a secret in the config file.
    token_name: "/tmp/token"
    method: token
  proxy_server: "teleport.example.com:443"
auth_service:
  enabled: false
proxy_service:
  enabled: false
ssh_service:
  enabled: false
discovery_service:
  enabled: true
  discovery_group: "discovery-group-name"

Teleport 시작#

systemd 서비스를 생성하여 호스트가 부팅될 때 the Discovery Service이 자동으로 시작되도록 구성합니다. 지침은 the Discovery Service을 어떻게 설치했는지에 따라 다릅니다.

Package Manager

the Discovery Service을 실행할 호스트에서 Teleport를 활성화하고 시작합니다:

$ sudo systemctl enable teleport
$ sudo systemctl start teleport

TAR Archive

the Discovery Service을 실행할 호스트에서 Teleport용 systemd 서비스 구성을 생성하고, Teleport 서비스를 활성화한 후 Teleport를 시작합니다:

$ sudo teleport install systemd -o /etc/systemd/system/teleport.service
$ sudo systemctl enable teleport
$ sudo systemctl start teleport

systemctl status teleport로 the Discovery Service의 상태를 확인하고 journalctl -fu teleport로 로그를 볼 수 있습니다.

2/5단계. 검색된 VM용 ID 설정#

검색 대상이 되는 모든 Azure VM에는 시스템 할당 관리 ID 또는 사용자 할당 관리 ID 중 하나가 할당되어 있어야 합니다.

Note

이 섹션의 내용은 원문 문서를 참조하세요. (azure-join-enable-identity.mdx)

3/5단계. teleport-discovery-azure Terraform 모듈 사용#

AzureRM Terraform 프로바이더 구성#

AzureRM Terraform 프로바이더와, Terraform이 Azure 리소스를 관리하는 데 필요한 Azure 권한을 구성합니다.

AzureRM Terraform 프로바이더에 필요한 Azure 권한

AzureRM Terraform 프로바이더에는 teleport-discovery-azure 모듈이 리소스를 생성하는 범위에서 다음 Azure 권한이 필요합니다:

  • Microsoft.ManagedIdentity/userAssignedIdentities/read
  • Microsoft.ManagedIdentity/userAssignedIdentities/write
  • Microsoft.ManagedIdentity/userAssignedIdentities/delete
  • Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/read
  • Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/write
  • Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/delete
  • Microsoft.Authorization/roleDefinitions/read
  • Microsoft.Authorization/roleDefinitions/write
  • Microsoft.Authorization/roleDefinitions/delete
  • Microsoft.Authorization/roleAssignments/read
  • Microsoft.Authorization/roleAssignments/write
  • Microsoft.Authorization/roleAssignments/delete

Teleport Terraform 프로바이더 구성#

CI, Spacelift 등 원격 환경처럼 Terraform을 실행하는 방식에 따라 Teleport Terraform 프로바이더를 구성하는 방법이 여러 가지 있지만, 빠르게 시작하려면 로컬 데모 가이드를 참고하십시오.

로컬 데모 가이드는 로컬 Teleport 자격 증명으로 Teleport Terraform 프로바이더를 구성하는 방법을 안내합니다. 일반적으로 terraform 명령을 실행하는 셸과 동일한 셸에서 tsh로 로그인하고 tctl 명령을 실행해야 합니다:

$ tsh login
$ eval "$(tctl terraform env)"

클라우드 VM, 온프레미스 서버, CI/CD 파이프라인과 같은 원격 환경에서 Terraform을 실행하는 경우, Teleport Terraform 프로바이더 사용하기에서 사용 사례에 맞는 가이드를 확인합니다.

Terraform 모듈 입력 구성#

Terraform 구성에 teleport-discovery-azure 모듈을 추가합니다.

Tip

관리 그룹의 여러 구독에 걸쳐 VM을 검색하려면 관리 그룹을 사용하여 여러 구독의 VM 검색을 참고합니다.

module "azure_discovery" {
  source  = "terraform.releases.teleport.dev/teleport/discovery/azure"
  version = "~> (=cloud.major_version=).0"

  # Required inputs:
  # Assign example.teleport.sh:443 to your Teleport cluster's proxy public address in host:port form.
  teleport_proxy_public_addr    = "example.teleport.sh:443"
  # teleport_discovery_group_name must match the discovery group name in your Discovery Service config.
  # Teleport Cloud clusters run the Discovery Service in the group name "cloud-discovery-group".
  # Do not modify this input unless you intend to run your own Discovery Service.
  teleport_discovery_group_name = "cloud-discovery-group"

  # Name of an existing Azure Resource Group where Azure resources will be created.
  azure_resource_group_name       = "my-resource-group"
  # Azure region where the managed identity used by the Discovery Service will be created.
  azure_managed_identity_location = "eastus"

  # Matchers configure which Azure resources the Discovery Service will discover and enroll into Teleport.
  azure_matchers = [
    {
      types = ["vm"]
      # subscriptions filters which Azure subscriptions are scanned for VMs.
      subscriptions = ["subscription-id"]
      # resource_groups filters which resource groups are scanned. The wildcard matches all resource groups.
      resource_groups = ["*"]
      # regions filters which Azure regions are scanned. The wildcard matches all regions.
      regions = ["*"]
      # tags filter which VMs are enrolled. The wildcard matches all tags.
      tags = { "*" : ["*"] }
    }
  ]

  # Optional inputs:
  # Apply the additional Azure tag "origin=example" to all Azure resources created by this module
  apply_azure_tags               = { origin = "example" }
  # Apply the additional Teleport label "origin=example" to all Teleport resources created by this module
  apply_teleport_resource_labels = { origin = "example" }
}
Note

Teleport Azure OIDC 연동은 페더레이션 ID 자격 증명을 사용하여 Discovery Service를 관리 ID로 인증하므로, Teleport Proxy Service가 퍼블릭 인터넷에서 접근 가능해야 합니다.

프라이빗 네트워크에 있는 Teleport 클러스터는 use_oidc_integration = false로 설정하고 Discovery Service 호스트에 관리 ID를 직접 할당합니다.

필요한 권한을 가진 관리 ID가 이미 있다면, 모듈 구성에 create_azure_managed_identity = false를 추가로 설정하여 관리 ID 생성을 건너뜁니다. 필요한 권한은 모듈 레퍼런스를 참고합니다.

구성을 적용한 뒤에는 Discovery Service 호스트에 관리 ID 할당을 진행합니다.

module "azure_discovery" {
  source  = "terraform.releases.teleport.dev/teleport/discovery/azure"
  version = "~> (=teleport.major_version=).0"

  # Required inputs:
  # Edit this input to the host and port of the Teleport Proxy Service in your cluster
  teleport_proxy_public_addr    = "teleport.example.com:443"
  # Assign discovery-group-name to the discovery group name in your Discovery Service config file.
  teleport_discovery_group_name = "discovery-group-name"

  # Name of an existing Azure Resource Group where Azure resources will be created.
  azure_resource_group_name       = "my-resource-group"
  # Azure region where the managed identity used by the Discovery Service will be created.
  azure_managed_identity_location = "eastus"

  # Matchers to configure the Discovery Service; used to discover and enroll Azure resources into Teleport.
  azure_matchers = [
    {
      types = ["vm"]
      # subscriptions filters which Azure subscriptions are scanned for VMs.
      subscriptions = ["subscription-id"]
      # resource_groups filters which resource groups are scanned. The wildcard matches all resource groups.
      resource_groups = ["*"]
      # regions filters which Azure regions are scanned. The wildcard matches all regions.
      regions = ["*"]
      # tags filter which VMs are enrolled. The wildcard matches all tags.
      tags = { "*" : ["*"] }
    }
  ]

  # Optional inputs:
  # Apply the additional Azure tag "origin=example" to all Azure resources created by this module
  apply_azure_tags               = { origin = "example" }
  # Apply the additional Teleport label "origin=example" to all Teleport resources created by this module
  apply_teleport_resource_labels = { origin = "example" }
}

Terraform이 모듈의 출력을 표시하도록 모듈용 Terraform 출력을 추가합니다:

output "azure_discovery" {
  value = module.azure_discovery
}

모듈 입력과 출력에 대한 전체 설명은 teleport-discovery-azure 레퍼런스를 참고합니다.

4/5단계. Terraform 모듈 적용#

$ terraform init
$ terraform apply

Terraform은 다음 리소스를 생성하도록 계획해야 합니다:

  • Teleport Discovery Service용 Azure 사용자 할당 관리 ID
  • OIDC 워크로드 ID 페더레이션용 Azure 페더레이션 ID 자격 증명
  • VM 검색에 필요한 권한을 갖춘 Azure 사용자 지정 역할 정의
  • 구성된 구독 또는 관리 그룹 범위의 Azure 역할 할당
  • Azure 리소스 검색을 위해 Teleport를 구성하는 Teleport discovery_config 클러스터 리소스
  • Azure OIDC용 Teleport integration 클러스터 리소스
  • Teleport 노드가 Azure 자격 증명으로 클러스터에 조인할 수 있게 하는 Teleport token 클러스터 리소스

Terraform 계획을 검토하고 계획된 작업을 확인합니다.

Terraform이 계획 적용을 마치면 다음과 같이 모듈 출력이 표시됩니다:

azure_discovery = {
  "teleport_discovery_config_name"            = "discovery-abcd0123"
  "teleport_integration_name"                 = "discovery-abcd0123"
  "teleport_provision_token_name"             = "discovery-abcd0123"
  "azure_discovery_role_definition"           = { ... }
  "azure_teleport_discovery_managed_identity" = { ... }
}

Azure 리소스에는 다음 태그가 있어야 합니다:

  • origin=example
  • TeleportCluster=<cluster-name>
  • TeleportIntegration=discovery-abcd0123
  • TeleportIACTool=terraform

Teleport 리소스에는 다음 라벨이 있어야 합니다:

  • origin=example
  • teleport.dev/iac-tool=terraform

Discovery Service 호스트에 관리 ID 할당#

Azure에서 실행되는 셀프 호스팅 Teleport 클러스터에서 모듈을 use_oidc_integration = false로 구성한 경우, Terraform 모듈이 생성한 관리 ID를 Discovery Service를 실행하는 VM에 할당합니다. Discovery Service는 사용자 할당 ID를 사용하여 Azure Instance Metadata Service(IMDS)를 통해 Azure에 인증합니다.

Discovery Service를 실행하는 VM을 Terraform으로 관리한다면, 호스트 VM 리소스의 identity 블록에서 모듈 출력을 참조합니다:

resource "azurerm_linux_virtual_machine" "teleport" {
  # ...

  identity {
    type         = "UserAssigned"
    identity_ids = [module.azure_discovery.azure_teleport_discovery_managed_identity.id]
  }
}

또는 Azure CLI를 사용하여 기존 VM에 ID를 할당할 수 있습니다. discovery-service-vm-name에는 Discovery Service를 실행하는 VM의 이름을, discovery-service-vm-resource-group에는 해당 VM의 리소스 그룹을, azure-managed-identity-id에는 모듈의 azure_teleport_discovery_managed_identity 출력에 있는 id를 지정합니다.

$ az vm identity assign \
    --name discovery-service-vm-name \
    --resource-group discovery-service-vm-resource-group \
    --identities "azure-managed-identity-id"

5/5단계. 검색 상태 확인#

Terraform 모듈을 적용하면 Teleport Discovery Service가 Azure VM 인스턴스를 검색하고 보호 대상 리소스로 클러스터에 등록하기 시작합니다.

Note

가상 머신이 검색되어 등록되기까지 몇 분 정도 걸릴 수 있습니다.

Teleport Web UI에서 Zero Trust Access > Integrations를 선택합니다. 기본적으로 teleport-discovery-azure Terraform 모듈이 생성한 연동의 이름은 discovery-<random>입니다.

연동을 클릭하여 검색 상태를 확인합니다.

연동 페이지에서는 검색된 가상 머신의 수와 검색 과정에서 발생한 문제를 한눈에 확인할 수 있습니다.

모듈 구성 업데이트#

모듈 입력을 변경하고 다시 적용하여 Azure 검색 연동을 조정할 수 있습니다.

예를 들어 이전에 모든 리전을 의미하는 와일드카드 기본값 대신 특정 Azure 리전을 지정했다면, Azure 매처의 regions를 조정하여 Azure 검색 대상 리전을 추가하고 모듈을 다시 적용하면 해당 리전의 인스턴스도 등록되기 시작합니다.

 azure_matchers = [
   {
     types           = ["vm"]
     subscriptions   = ["subscription-id"]
     resource_groups = ["*"]
-    regions         = ["eastus"]
+    regions         = ["eastus", "westus"]
     tags            = { "*" : ["*"] }
   }
 ]

Terraform을 다시 적용합니다:

$ terraform apply

변경을 확정하기 전에 Terraform 계획을 검토합니다.

Terraform이 계획 적용을 마치면 Discovery Service가 동적 discovery_config의 변경 사항을 반영하여 새로 구성한 리전의 VM을 등록하기 시작합니다.

관리 그룹을 사용하여 여러 구독의 VM 검색#

관리 그룹에 속한 모든 구독의 VM을 검색하려면 azure_management_group_id 입력을 추가하고 와일드카드("*") 구독 매처를 사용합니다. 테넌트 루트 그룹을 대상으로 하려면 테넌트 ID를 지정할 수 있습니다.

module "azure_discovery" {
  source  = "terraform.releases.teleport.dev/teleport/discovery/azure"
  version = "~> (=teleport.major_version=).0"

  teleport_proxy_public_addr    = "teleport.example.com:443"
  teleport_discovery_group_name = "discovery-group-name"

  # Management group ID or tenant ID. Using a tenant ID targets the
  # Tenant root group, which requires elevated access.
  azure_management_group_id = "management-group-id"

  # Name of an existing Azure Resource Group where Azure resources will be created.
  azure_resource_group_name       = "my-resource-group"
  # Azure region where the managed identity used by the Discovery Service will be created.
  azure_managed_identity_location = "eastus"

  azure_matchers = [
    {
      types = ["vm"]
      # The wildcard discovers VMs across all subscriptions visible to the
      # managed identity's role assignment scope.
      subscriptions = ["*"]
      # regions filters which Azure regions are scanned. The wildcard matches all regions.
      regions = ["*"]
      # tags filter which VMs are enrolled. The wildcard matches all tags.
      tags = { "*" : ["*"] }
    }
  ]
}

모듈은 제공된 관리 그룹 범위를 사용하여 역할 정의와 역할 할당을 생성하고, 테넌트 ID를 사용하여 프로비저닝 토큰 허용 규칙을 생성합니다.

Warning

테넌트 ID를 관리 그룹 ID로 사용하면 테넌트 루트 그룹을 대상으로 하게 되며, 이를 위해서는 상승된 접근 권한이 필요합니다.

전체 구성 예시는 관리 그룹 예시를 참고합니다.

여러 관리 그룹에 걸쳐 VM 검색#

여러 관리 그룹에 걸쳐 VM을 검색하려면 azure_management_group_id를 하위 관리 그룹 계층의 최상위에 있는 관리 그룹으로 설정합니다. azure_role_assignment_scopes 입력을 사용하여 관리 ID의 역할 할당에 대한 정규화된 범위를 명시적으로 지정합니다.

와일드카드 구독 매처(["*"])를 사용하면 Discovery Service는 azure_role_assignment_scopes의 역할 할당에서 볼 수 있는 구독의 VM을 검색합니다.

azure_role_assignment_scopes를 지정한 경우에는 teleport_provision_token_allow_rules도 명시적으로 설정해야 합니다.

module "azure_discovery" {
  source  = "terraform.releases.teleport.dev/teleport/discovery/azure"
  version = "~> (=teleport.major_version=).0"

  teleport_proxy_public_addr    = "teleport.example.com:443"
  teleport_discovery_group_name = "discovery-group-name"

  azure_resource_group_name       = "my-resource-group"
  azure_managed_identity_location = "eastus"

  # Common parent management group, used as the role definition's assignable scope.
  azure_management_group_id = "management-group-id"

  # Role assignments are created at each scope. The wildcard subscription
  # matcher will discover subscriptions visible to the assigned scopes.
  azure_role_assignment_scopes = [
    "/providers/Microsoft.Management/managementGroups/management-group-1",
    "/providers/Microsoft.Management/managementGroups/management-group-2",
  ]

  azure_matchers = [
    {
      types         = ["vm"]
      subscriptions = ["*"]
    }
  ]

  teleport_provision_token_allow_rules = [
    { tenant = "00000000-0000-0000-0000-000000000000" }
  ]
}

문제 해결#

Note

이 섹션의 내용은 원문 문서를 참조하세요. (azure-vm-troubleshooting.mdx)

다음 단계#

Note

이 섹션의 내용은 원문 문서를 참조하세요. (azure-vm-next-steps.mdx)