Azure에 tbot 배포
이 가이드에서는 Azure VM에 머신 및 워크로드 아이덴티티의 에이전트 tbot을 설치합니다. Azure 플랫폼에서 가상 머신에는 관리 아이덴티티를 할당할 수 있습니다. azure 조인 방법은 봇이 이 증명 데이터 문서와 JWT를 사용하여 Teleport Auth Service에 아이덴티티를 증명하도록 지시합니다.
이 가이드에서는 Azure VM에 머신 및 워크로드 아이덴티티의 에이전트 tbot을 설치합니다. 봇은 azure 위임 조인 방법을 사용하여 Teleport 클러스터에 인증하도록 설정됩니다. 이를 통해 장기 시크릿이 필요 없어집니다.
작동 방식#
Azure 플랫폼에서 가상 머신에는 관리 아이덴티티를 할당할 수 있습니다. Azure 플랫폼은 그러면 가상 머신이 이 아이덴티티로 작동할 수 있게 하는 증명 데이터 문서와 JWT를 가상 머신에서 사용 가능하게 합니다. 이 토큰을 사용하여 Azure 아이덴티티 서비스에서 자신의 아이덴티티를 가져오려는 시도를 통해 제3자가 이 아이덴티티를 검증할 수 있습니다.
azure 조인 방법은 봇이 이 증명 데이터 문서와 JWT를 사용하여 Teleport Auth Service에 아이덴티티를 증명하도록 지시합니다. 이를 통해 장기 시크릿 없이 조인이 가능합니다.
사전 조건#
-
A running Teleport cluster. If you want to get started with Teleport, sign up for a free trial or set up a demo environment.
-
The
tctlandtshclients.Installing `tctl` and `tsh` clients
-
Determine the version of your Teleport cluster. The
tctlandtshclients must be at most one major version behind your Teleport cluster version. Send a GET request to the Proxy Service at/v1/webapi/findand use a JSON query tool to obtain your cluster version. Replace with the web address of your Teleport Proxy Service:$ TELEPORT_DOMAIN= $ TELEPORT_VERSION="$(curl -s https://$TELEPORT_DOMAIN/v1/webapi/find | jq -r '.server_version')" -
Follow the instructions for your platform to install
tctlandtshclients:
-
To check that you can connect to your Teleport cluster, sign in with tsh login, then
verify that you can run tctl commands using your current credentials.
For example, run the following command, assigning to the domain name of the Teleport Proxy Service in your cluster and to your Teleport username:
$ tsh login --proxy= --user=
$ tctl status
# Cluster (=teleport.url=)
# Version (=teleport.version=)
# CA pin (=presets.ca_pin=)
If you can connect to the cluster and run the tctl status command, you can use your
current credentials to run subsequent tctl commands from your workstation.
If you host your own Teleport cluster, you can also run tctl commands on the computer that
hosts the Teleport Auth Service for full permissions.
Microsoft.Compute/virtualMachines/read권한을 부여하는 역할이 있는 Azure 관리 아이덴티티. 이 아이덴티티의 UID를 알아야 합니다.- 사용자 할당 관리 아이덴티티로 설정된 관리 아이덴티티와 함께 머신 및 워크로드 아이덴티티를 설치할 Azure VM.
1단계/5단계. tbot 설치#
이 단계는 Azure VM에서 완료합니다.
먼저 머신 및 워크로드 아이덴티티를 사용할 VM에 tbot을 설치해야 합니다.
플랫폼에 맞는 Teleport 패키지를 다운로드하고 설치합니다:
To install a Teleport Agent on your Linux server:
The recommended installation method is the cluster install script. It will select the correct version, edition, and installation mode for your cluster.
-
Assign to your Teleport cluster hostname and port, but not the scheme (https://).
-
Run your cluster's install script:
$ curl "https:///scripts/install.sh" | sudo bash
2단계/5단계. 봇 만들기#
이 단계는 로컬 머신에서 완료합니다.
Next, you need to create a Bot. A Bot is a Teleport identity for a machine or group of machines. Like users, bots have a set of roles and traits which define what they can access.
Create bot.yaml:
kind: bot
version: v1
metadata:
# name is a unique identifier for the Bot in the cluster.
name: example
spec:
# roles is a list of roles to grant to the Bot. Don't worry if you don't know
# what roles you need to specify here, the Access Guides will walk you through
# creating and assigning roles to the already created Bot.
roles: []
Make sure you replace example with a unique, descriptive name for your Bot.
Use tctl to apply this file:
$ tctl create bot.yaml
3단계/5단계. 조인 토큰 만들기#
이 단계는 로컬 머신에서 완료합니다.
bot-token.yaml을 만듭니다:
kind: token
version: v2
metadata:
# name은 이 토큰을 사용하는 `tbot`에서 지정됩니다.
name: example-bot
spec:
roles: [Bot]
# bot_name은 이 가이드에서 이전에 만든 봇의 이름과 일치해야 합니다.
bot_name: example
join_method: azure
azure:
allow:
# subscription은 Azure 구독의 UID여야 합니다. 이 구독 내의 VM만
# 조인할 수 있습니다.
- subscription: 11111111-1111-1111-1111-111111111111
# resource_groups를 사용하면 특정 리소스 그룹의 VM으로 조인을 제한할 수 있습니다.
# 구독 내 모든 VM에서 조인을 허용하려면 생략할 수 있습니다.
resource_groups: ["group1"]
교체:
11111111-1111-1111-1111-111111111111을 Azure 구독의 UID로.example을 두 번째 단계에서 만든 봇의 이름으로.group1을 VM이 속한 리소스 그룹 이름으로, 또는 구독 내 모든 VM에서 조인을 허용하려면 완전히 생략하세요.
tctl을 사용하여 이 파일을 적용합니다:
$ tctl create -f bot-token.yaml
4단계/5단계. tbot 설정#
이 단계는 Azure VM에서 완료합니다.
/etc/tbot.yaml을 만듭니다:
version: v2
proxy_server: example.teleport.sh:443
onboarding:
join_method: azure
token: example-bot
azure :
client_id: 22222222-2222-2222-2222-222222222222
storage:
type: memory
# services는 접근 가이드를 완료하는 동안 채워집니다.
services: []
교체:
example.teleport.sh:443을 Teleport Proxy 또는 Auth Service의 주소로. Teleport Proxy의 주소를 사용하는 것이 좋습니다.22222222-2222-2222-2222-222222222222를 VM에 할당된 Azure 관리 아이덴티티의 ID로.example-bot을 두 번째 단계에서 만든 토큰 이름으로.
Now, you must decide if you want to run tbot as a daemon or in one-shot mode.
In daemon mode, tbot runs continually, renewing the short-lived credentials
for the configured outputs on a fixed interval. This is often combined with a
service manager (such as systemd) in order to run tbot in the background.
This is the default behaviour of tbot.
In one-shot mode, tbot generates short-lived credentials and then exits. This
is useful when combining tbot with scripting (such as in CI/CD) as it allows
further steps to be dependent on tbot having succeeded. It is important to
note that the credentials will expire if not renewed and to ensure that the
TTL for the certificates is long enough to cover the length of the CI/CD job.
Configuring tbot as a daemon#
(!docs/pages/includes/machine-id/daemon.mdx!)
Configuring tbot for one-shot mode#
To use tbot in one-shot mode, modify /etc/tbot.yaml to add oneshot: true:
version: v2
oneshot: true
auth_server: ...
Now, you should test your tbot configuration. When started, several log
messages will be emitted before it exits with status 0:
$ export TELEPORT_ANONYMOUS_TELEMETRY=1
$ tbot start -c /etc/tbot.yaml
TELEPORT_ANONYMOUS_TELEMETRY enables the submission of anonymous usage
telemetry. This helps us shape the future development of tbot. You can disable
this by omitting this.
5단계/5단계. 서비스 설정#
You have now prepared the base configuration for tbot. At this point, it
identifies itself to the Teleport cluster and renews its own credentials but
does not output any credentials for other applications to use.
Follow one of the access guides to configure a service that meets your access needs.
다음 단계#
- 접근 가이드를 따라 환경에 맞게
tbot을 마저 설정합니다. - 사용 가능한 모든 설정 옵션을 확인하려면 설정 레퍼런스를 읽으세요.
TELEPORT_ANONYMOUS_TELEMETRY에 대한 자세한 정보.
