Azure 관리 ID를 통한 서비스 참여
Teleport v18.9이 가이드에서는 Azure 참여 방법을 사용하여 Azure Virtual Machine에서 실행 중인 Teleport 인스턴스가 비밀을 공유하지 않고 Teleport 클러스터에 참여하도록 구성하는 방법을 설명합니다.
이 가이드에서는 Azure 참여 방법을 사용하여 Azure Virtual Machine에서 실행 중인 Teleport 인스턴스가 비밀을 공유하지 않고 Teleport 클러스터에 참여하도록 구성하는 방법을 설명합니다.
Azure 참여 방법은 Azure Virtual Machine에서 실행되는 모든 Teleport 프로세스에서 사용할 수 있습니다.
Teleport 프로세스를 클러스터에 참여시키는 다른 방법은 Teleport 서비스를 클러스터에 참여시키기를 참조하십시오.
작동 방식#
내부적으로, Teleport 프로세스는 서명된 증명 데이터 문서와 액세스 토큰을 Teleport Auth Service에 전송하여 Azure 구독에서 실행 중임을 증명합니다. VM의 ID는 Azure 참여 토큰에 구성된 허용 규칙과 일치해야 합니다.
사전 요구 사항#
-
실행 중인 Teleport 클러스터. Teleport를 시작하려면 무료 체험판에 가입하거나 데모 환경을 구성하세요.
-
tctlandtshclients.Installing `tctl` and `tsh` clients
-
Teleport 클러스터의 버전을 확인합니다.
tctlandtshclients는 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')" -
사용 중인 플랫폼에 대한 지침에 따라
tctlandtshclients를 설치합니다:
-
Mac
`tctl` and `tsh` clients가 포함된, 서명된 Teleport macOS .pkg 설치 프로그램을 다운로드합니다:
```code
$ curl -O https://cdn.teleport.dev/teleport-${TELEPORT_VERSION?}.pkg
```
Finder에서 `pkg` 파일을 더블 클릭하여 설치를 시작합니다.
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 바이너리가 설치된 Linux를 실행하는 Azure Virtual Machine. 해당 Virtual Machine에는 관리 ID가 할당되어 있어야 합니다.
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단계. 관리 ID 설정#
Azure 방법을 사용하여 Teleport 클러스터에 참여하는 Teleport 프로세스를 호스팅하는 모든 가상 머신에는 관리 ID가 할당되어 있어야 합니다.
관리 ID를 설정하려면:
- Azure VM에서 Teleport를 호스팅하는 경우 Virtual machines 보기로 이동하거나, Azure VMSS에서 Teleport를 호스팅하는 경우 Virtual machine scale sets 보기로 이동합니다.
- Teleport 서비스를 호스팅하는 VM 또는 VMSS를 선택합니다.
- 오른쪽 패널에서 Security/Identity 탭을 클릭합니다.
- Identity 섹션 아래에서 System assigned 탭을 선택합니다.
- Status 스위치를 On으로 전환합니다.
- Save를 클릭합니다.
VMSS를 사용하고 수동 업그레이드 모드로 구성된 경우, ID 변경 사항이 적용되려면 VM 인스턴스를 업데이트해야 합니다:
- 오른쪽 패널에서 Instances 탭을 클릭합니다.
- 업데이트할 VM 인스턴스를 선택합니다.
- Restart를 클릭합니다.
일반 VM에 시스템 할당 ID를 연결하려면 다음을 실행합니다:
$ az vm identity assign --resource-group <resource-group> --name <vm-name>
Azure VMSS에 시스템 할당 ID를 연결하려면 다음을 실행합니다:
$ az vmss identity assign --resource-group <resource-group> --name <vmss-name>
VMSS를 사용하고 수동 업그레이드 모드로 구성된 경우, ID 변경 사항이 적용되려면 VM 인스턴스를 업데이트해야 합니다. 다음 명령을 실행하여 ID 변경 사항을 전파합니다:
$ az vmss update-instances --resource-group <resource-group> --name <vmss-name> --instance-ids *
2/5단계. Azure 참여 토큰 생성#
VM의 ID가 일치해야 하는 Azure 구독 및 리소스 그룹을 지정하는 allow 규칙이 포함된
다음 token.yaml을 생성합니다.
# token.yaml
kind: token
version: v2
metadata:
# the token name is not a secret because instances must prove that they are
# running in your Azure subscription to use this token
name: azure-token
spec:
# use the minimal set of roles required
roles: [Node]
join_method: azure
azure:
allow:
# specify the Azure subscription which Teleport processes may join from
- subscription: 11111111-1111-1111-1111-111111111111
# multiple allow rules are supported
- subscription: 22222222-2222-2222-2222-222222222222
# resource_groups is optional and allows you to restrict the resource group of
# joining Teleport processes
- subscription: 33333333-3333-3333-3333-333333333333
resource_groups: ["group1", "group2"]
토큰 이름 azure-token은 예시일 뿐이며, 3단계에서 join_params.token_name에
동일한 값을 사용하는 한 원하는 어떤 값이든 사용할 수 있습니다.
다음 명령을 실행하여 토큰을 생성합니다:
$ tctl create -f token.yaml
3/5단계 Teleport 설치#
Azure Linux VM에 Teleport를 설치합니다.
Linux 서버에 Teleport Agent를 설치하려면:
권장 설치 방법은 클러스터 설치 스크립트입니다. 이 스크립트는 클러스터에 맞는 올바른 버전, 에디션, 설치 모드를 선택합니다.
-
teleport.example.com:443에 Teleport 클러스터의 호스트명과 포트를 할당하되, 스킴(https://)은 포함하지 마십시오. -
클러스터의 설치 스크립트를 실행하십시오:
$ curl "https://teleport.example.com:443/scripts/install.sh" | sudo bash
4/5단계. Teleport 프로세스 구성#
Azure 참여 방법은 SSH, Proxy, Kubernetes, 애플리케이션, 데이터베이스 또는 Desktop 서비스를 실행하는 Teleport 프로세스에 사용할 수 있습니다.
사용자 정의 teleport.yaml 파일로 Teleport 프로세스를 구성합니다. 다음 예시 구성과
같이 2단계에서 생성한 토큰과 일치하는 token_name 및 method: azure가 포함된
join_params 섹션을 사용합니다:
# /etc/teleport.yaml
version: v3
teleport:
join_params:
token_name: azure-token
method: azure
azure:
# client_id는 사용자 할당 관리 ID의 클라이언트 ID입니다.
# 시스템 할당 관리 ID를 사용할 때는 이 값을 생략합니다.
client_id: 11111111-1111-1111-1111-111111111111
proxy_server: teleport.example.com:443
ssh_service:
enabled: true
auth_service:
enabled: false
proxy_service:
enabled: false
5/5단계. Teleport 프로세스 시작#
Azure VM에서 Teleport를 시작합니다.
systemd 서비스를 생성하여 호스트가 부팅될 때 your Teleport instance이 자동으로 시작되도록 구성합니다. 지침은 your Teleport instance을 어떻게 설치했는지에 따라 다릅니다.
Package Manager
your Teleport instance을 실행할 호스트에서 Teleport를 활성화하고 시작합니다:
$ sudo systemctl enable teleport
$ sudo systemctl start teleport
TAR Archive
your Teleport instance을 실행할 호스트에서 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로 your Teleport instance의 상태를 확인하고 journalctl -fu teleport로
로그를 볼 수 있습니다.
Teleport 프로세스가 클러스터에 연결하고 참여할 수 있는지 확인합니다. 모든 설정이 완료되었습니다!