Bound Keypair로 서비스 조인하기
Teleport v18.11요약
이 가이드는 Bound Keypair 조인 방식을 사용하여 Teleport 프로세스가 Teleport 클러스터에 조인하도록 구성하는 방법을 설명합니다. Bound Keypair 조인 방식은 Teleport 에이전트에 대해 두 가지 작동 모드를 지원합니다.
이 가이드는 Bound Keypair 조인 방식을 사용하여 Teleport 프로세스가 Teleport 클러스터에 조인하도록 구성하는 방법을 설명합니다.
Bound Keypair 조인 방식은 Teleport 에이전트에 대해 두 가지 작동 모드를 지원합니다.
- 등록 시크릿을 통한 조인: 일회용 시크릿을 Teleport에 제공하거나 Teleport가 생성하여
조인하는 에이전트에 복사합니다. 기존
token조인 방식과 유사합니다. - 정적 키를 사용한 조인: 조인하는 에이전트에서 키 쌍을 생성하여 대역 외로 Teleport에 공유하고, Teleport가 해당 에이전트의 공개 키를 신뢰하도록 구성합니다.
이 가이드는 등록 시크릿의 사용을 다루며, 에이전트의 데이터 디렉터리
(예: /var/lib/teleport)에 수명이 긴 영구 스토리지가 있는 환경에 가장 적합합니다.
Bound Keypair 정적 키로 에이전트를 조인하려면
전용 가이드를 참조하십시오.
이 가이드는 표준 teleport 바이너리로 에이전트를 조인하는 경우에 적용됩니다.
bound_keypair 조인 방식으로 봇을 조인하는 방법은
봇 전용 가이드를 참조하십시오.
작동 방식#
Bound Keypair 조인에서 Teleport 에이전트는 고유한 키 쌍을 생성하여 내부 노드별 아이덴티티 스토리지에 기록합니다. 이후 Teleport는 이 공개 키를 이후의 조인 시도에 대해 신뢰하도록 구성됩니다.
나중에 에이전트가 클러스터에 조인하려고 하면 Teleport는 개인 키로만 완료할 수 있는 챌린지를 발급합니다. 에이전트는 해결한 챌린지를 반환하여 자신의 아이덴티티를 증명하고, 조건부로 클러스터 조인이 허용됩니다. 드물게 에이전트가 새 인증서를 받아야 하는 경우, 저장된 키로 챌린지 과정을 반복하여 다시 인증하고 새 인증서를 가져옵니다.
이 조인 방식이 작동하는 방법과 프로덕션에서 사용하는 방법에 대한 자세한 내용은 레퍼런스 페이지를 참조하십시오.
봇이 아닌 에이전트에 Bound Keypair 조인을 사용할 때는 다음과 같은 고유한 제한 사항이 있습니다.
- Bound Keypair 조인 방식으로 클러스터에 조인하는 Teleport 에이전트는 일반적으로
최초 조인 시도 때 한 번만 Bound Keypair 기능을 사용합니다.
Teleport에 자주 인증하는
tbot클라이언트와 달리 에이전트는 조인할 때 수명이 긴 인증서를 발급받고 이 인증서는 보통 갱신되지 않습니다. 따라서 조인 상태 검증, 키 쌍 교체 등 Bound Keypair 기능은 에이전트의 일반 작동 중에는 사용되지 않습니다. - 표준 사전 등록 키는 현재 지원되지 않습니다.
에이전트 조인의 제한 사항에 대한 자세한 내용은 관리자 가이드를 참조하십시오.
사전 요구사항#
-
실행 중인 Teleport (v18.8.0 or higher) 클러스터. Teleport를 시작하려면 무료 체험판에 가입하거나 데모 환경을 구성하세요.
-
`tsh`, `tctl`, and `tbot` clients.
Installing \`tsh\`, \`tctl\`, and \`tbot\` clients
-
Teleport 클러스터의 버전을 확인합니다. `tsh`, `tctl`, and `tbot` 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')" -
사용 중인 플랫폼에 대한 지침에 따라 `tsh`, `tctl`, and `tbot` clients를 설치합니다:
-
Mac
\`tsh\`, \`tctl\`, and \`tbot\` 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 \`tsh\`, \`tctl\`, and \`tbot\` clients to your %PATH%
# NOTE: Do not place the \`tsh\`, \`tctl\`, and \`tbot\` 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 바이너리에는 \`tsh\`, \`tctl\`, and \`tbot\` 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
```
- 영구 스토리지가 있는 Linux 호스트(베어메탈 또는 VM)
1/5단계. Bound Keypair 토큰 준비#
다음 token.yaml 파일을 생성하고, 원하는 bound_keypair 구성을 지정하는
bound_keypair 섹션을 작성합니다. 대부분의 경우 에이전트 조인에는 기본값인
standard 복구 모드와 recovery.limit 1이면 충분합니다.
kind: token
version: v2
metadata:
name: example-token
spec:
roles: [Bot]
join_method: bound_keypair
bot_name: example
# Fields related to the bound keypair joining process.
bound_keypair:
# Fields related to the initial join attempt.
onboarding:
# If set to a public key in SSH authorized_keys format, the
# joining client must have the corresponding private key to join. This
# keypair may be created using `tbot keypair create`. If set,
# `registration_secret` and `must_register_before` are ignored.
initial_public_key: ""
# If set to a secret string value, a client may use this secret to perform
# the first join without pre-registering a public key in
# `initial_public_key`. If unset and no `initial_public_key` is provided,
# a random value will be generated automatically into
# `.status.bound_keypair.registration_secret`.
registration_secret: ""
# If set to an RFC 3339 timestamp, attempts to register via
# `registration_secret` will be denied once the timestamp has elapsed. If
# more time is needed, this field can be edited to extend the registration
# period.
must_register_before: ""
# Fields related to recovery after certificates have expired.
recovery:
# The maximum number of allowed recovery attempts. This value may
# be raised or lowered after creation to allow additional recovery
# attempts should the initial limit be exhausted. If `mode` is set to
# `standard`, recovery attempts will only be allowed if
# `.status.bound_keypair.recovery_count` is less than this limit. This
# limit is not enforced if `mode` is set to `relaxed` or `insecure`. This
# value must be at least 1 to allow for the initial join during
# onboarding, which counts as a recovery.
limit: 1
# The recovery rule enforcement mode. Valid values:
# - standard (or unset): all configured rules enforced. The recovery limit
# and client join state are required and verified. This is the most
# secure recovery mode.
# - relaxed: recovery limit is not enforced, but client join state is
# still required. This effectively allows unlimited recovery attempts,
# but client join state still helps mitigate stolen credentials.
# - insecure: neither the recovery limit nor client join state are
# enforced. This allows any client with the private key to join freely.
# This is less secure, but can be useful in certain situations, like in
# otherwise unsupported CI/CD providers. This mode should be used with
# care, and RBAC rules should be configured to heavily restrict which
# resources this identity can access.
mode: "standard"
# If set to an RFC 3339 timestamp, once elapsed, a keypair rotation will be
# forced on next join if it has not already been rotated. The most recent
# rotation is recorded in `.status.bound_keypair.last_rotated_at`.
rotate_after: ""
다음 명령을 실행하여 토큰을 생성합니다.
$ tctl create token.yaml
Terraform 구성에 다음 리소스를 추가하고, 안내에 따라 값을 바꿉니다.
이 섹션의 내용은 원문 문서를 참조하세요. (bound-keypair-spec-hcl.mdx)
다음 쿠버네티스 리소스 매니페스트를 추가하고, 안내에 따라 값을 바꿉니다.
이 섹션의 내용은 원문 문서를 참조하세요. (bound-keypair-spec-kube.mdx)
2/5단계. 등록 시크릿 가져오기#
로컬 머신의 tctl 클라이언트로 1단계에서 생성한 토큰의 등록 시크릿을
가져옵니다.
$ tctl get token/example-token --with-secrets
kind: token
metadata:
name: example-token
spec:
bound_keypair:
onboarding: {}
recovery:
limit: 1
mode: standard
join_method: bound_keypair
roles:
- Node
status:
bound_keypair:
bound_bot_instance_id: ""
bound_public_key: ""
recovery_count: 0
registration_secret: example-value
version: v2
status.bound_keypair.registration_secret 필드 값을 기록해 두십시오.
이후 단계에서 노드의 teleport.yaml에 이 값을 넣어야 합니다.
3/5단계. Teleport 설치#
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단계. 서비스 구성#
Bound Keypair 조인 방식은 SSH(Node), Proxy, Kubernetes, Application, Database,
Windows Desktop Service를 실행하는 Teleport 프로세스에 사용할 수 있습니다.
Teleport 프로세스는 Linux 호스트에서 직접 실행해야 합니다.
사용자 지정 teleport.yaml 파일로 Teleport 프로세스를 구성합니다.
join_params 섹션에서 token_name은 1단계에서 생성한 토큰 이름과 일치시키고
method: bound_keypair를 지정합니다. 구성 예시는 다음과 같습니다.
# /etc/teleport.yaml
version: v3
teleport:
join_params:
token_name: example-token
method: bound_keypair
bound_keypair:
registration_secret_value: <secret value here>
# Alternatively, specify a path to a file containing the registration
# secret.
# registration_secret_path: /path/to/secret
proxy_server: teleport.example.com:443
ssh_service:
enabled: true
auth_service:
enabled: false
proxy_service:
enabled: false
bound_keypair 필드 아래에 등록 시크릿을 반드시 구성하십시오.
registration_secret_value를 등록 시크릿이 담긴 문자열로 설정하거나,registration_secret_path를 등록 시크릿이 담긴 파일의 경로로 설정합니다.
두 필드 중 하나만 지정할 수 있습니다.
5/5단계. 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를 시작한 후 서비스가 클러스터에 연결되어 조인하는지 확인합니다.