머신 및 워크로드 아이덴티티 구성 참조
이 참조는 tbot 구성 파일에서 구성할 수 있는 다양한 옵션을 설명합니다. 구성 파일로 tbot을 실행하려면 -c 플래그로 경로를 지정하세요: 이 참조에서 아티팩트라는 용어는 출력을 생성하는 프로세스의 일부로 tbot이 대상에 쓰는 항목을 나타냅니다.
이 참조는 tbot 구성 파일에서 구성할 수 있는 다양한 옵션을 설명합니다. 이 구성 파일은 CLI 매개변수만으로 tbot을 구성하는 것보다 더 많은 제어를 제공합니다.
구성 파일로 tbot을 실행하려면 -c 플래그로 경로를 지정하세요:
$ tbot start -c ./tbot.yaml
이 참조에서 아티팩트라는 용어는 출력을 생성하는 프로세스의 일부로 tbot이 대상에 쓰는 항목을 나타냅니다. 아티팩트의 예로는 구성 파일, 인증서 및 암호화 키 자료가 있습니다. 일반적으로 아티팩트는 파일이지만, 대상이 반드시 파일시스템일 필요는 없으므로 이 용어를 명시적으로 사용합니다.
# version은 사용 중인 구성 파일의 버전을 지정합니다. `v2`가 가장 최신이며
# 모든 새 봇에 사용되어야 합니다. 이 예시의 나머지는 `v2` 스키마입니다.
version: v2
# debug는 stderr에 상세 로깅을 활성화합니다. 지정하지 않으면 기본값은
# false입니다.
debug: true
# auth_server는 `tbot`이 연결해야 하는 Auth Service 인스턴스의 주소를
# 지정합니다. Proxy Service 주소를 지정하기 위해 `proxy_server`를
# 지정하는 것을 권장합니다.
auth_server: "teleport.example.com:3025"
# proxy_server는 `tbot`이 연결해야 하는 Teleport Proxy Service의 주소를
# 지정합니다.
# Teleport Proxy Service의 주소 또는 Teleport Cloud를 사용하는 경우
# Teleport Cloud 인스턴스의 주소를 사용하는 것을 권장합니다.
proxy_server: "teleport.example.com:443" # 또는 Teleport Cloud의 경우 "example.teleport.sh:443"
# credential_ttl은 `tbot`이 생성한 인증서의 유효 기간을 지정합니다.
# `m`(분) 또는 `h`(시간) 접미사와 함께 양의 숫자 값이어야 합니다.
# 기본값은 `1h`입니다.
# 최대값은 `24h`입니다.
#
# 대부분의 출력 및 서비스에서 `tbot`의 내부 인증서보다 짧은 TTL을
# 갖도록 재정의할 수 있습니다.
credential_ttl: "1h"
# renewal_interval은 `tbot`이 생성한 출력을 갱신하려는 빈도를 지정합니다.
# `m`(분) 또는 `h`(시간) 접미사와 함께 양의 숫자 값이어야 합니다.
# 기본값은 `20m`입니다.
# 이 값은 `credential_ttl`보다 낮아야 합니다.
# 이 값은 `tbot`이 원샷 모드에서 실행 중일 때 무시됩니다.
#
# 대부분의 출력 및 서비스에서 `tbot`의 내부 인증서보다 짧은 갱신
# 간격을 갖도록 재정의할 수 있습니다.
renewal_interval: "20m"
# oneshot은 출력을 생성한 직후 `tbot`이 종료되도록 구성합니다.
# 기본값은 `false`입니다. CI/CD와 같은 일시적 환경에서는 `true` 값이
# 유용합니다.
oneshot: false
# onboarding은 `tbot`이 Teleport 클러스터로 인증하는 방법을 제어하는
# 구성 옵션 그룹입니다.
onboarding:
# token은 Teleport 클러스터에 구성된 어떤 조인 토큰을 Teleport 클러스터에
# 가입하는 데 사용해야 하는지 지정합니다.
#
# 사용하려는 값이 포함된 파일의 절대 경로일 수도 있습니다.
# 파일 경로 예시:
# token: /var/lib/teleport/tokenjoin
token: "00000000000000000000000000000000"
# join_method는 위에서 지정된 토큰과 연결된 조인 방법이어야 합니다.
# 이 설정은 `tctl`을 사용하여 봇을 생성할 때 출력된 값과 일치해야 합니다.
#
# 지원되는 값:
# - `token`
# - `azure`
# - `gcp`
# - `circleci`
# - `github`
# - `gitlab`
# - `iam`
# - `ec2`
# - `kubernetes`
# - `spacelift`
# - `tpm`
# - `terraform_cloud`
join_method: "token"
# ca_pins는 첫 번째 연결 시 Teleport Auth Service의 신원을 검증하는
# 데 사용됩니다. Teleport Cloud를 사용하거나 Teleport Proxy를 통해
# 연결할 때는 지정하지 않아야 합니다.
ca_pins:
- "(=presets.ca_pin=)"
- "(=presets.ca_pin=)"
# ca_path는 첫 번째 연결 시 Teleport Auth Service의 신원을 검증하는 데
# 사용할 수 있는 CA 파일의 위치를 지정합니다.
# Teleport Cloud를 사용하거나 Teleport Proxy를 통해 연결할 때는
# 지정하지 않아야 합니다. ca_pins 옵션이 ca_path보다 권장됩니다.
ca_path: "/path/to/ca.pem"
# gitlab은 "gitlab" 조인 방법에 특화된 구성을 보유합니다.
gitlab:
# token_env_var_name은 GitLab ID 토큰이 포함된 환경 변수를 지정할
# 수 있습니다. 지정하지 않으면 기본값은 "TBOT_GITLAB_JWT"입니다.
#
# 단일 GitLab CI 작업에서 여러 Teleport 클러스터로 인증하기 위해
# `tbot`을 사용해야 할 때 이를 재정의하는 것이 유용합니다.
token_env_var_name: "MY_GITLAB_ID_TOKEN"
# bound_keypair는 "bound_keypair" 조인 방법에 특화된 매개변수를 보유합니다
bound_keypair:
# registration_secret은 미리 등록된 키 쌍 대신 첫 번째 가입 시 사용할
# 선택적 시크릿입니다. `TBOT_REGISTRATION_SECRET` 환경 변수에서도
# 설정할 수 있습니다.
registration_secret: "secret"
# registration_secret_path는 등록 시크릿이 포함된 파일의 선택적 경로입니다;
# `registration_secret`과 충돌합니다
registration_secret_path: ./path/to/secret
# static_key_path는 정적 개인 키가 포함된 파일의 선택적 경로입니다.
static_key_path: ./path/to/secret
# storage는 `tbot`이 내부 상태를 저장하는 데 사용할 대상을 지정합니다.
# 이 상태는 민감하므로 여기에 지정한 대상이 `tbot`만 접근할 수 있도록
# 해야 합니다.
#
# 지정하지 않으면 storage는 `/var/lib/teleport/bot` 경로의 디렉터리
# 대상으로 설정됩니다.
#
# 지원되는 대상의 전체 목록과 구성 옵션은 이 참조 페이지의 대상 섹션을
# 참조하세요.
storage:
type: directory
path: /var/lib/teleport/bot
# services는 어떤 `tbot` 서브 서비스를 활성화해야 하고 어떻게 구성해야
# 하는지 지정합니다.
#
# 지원되는 서비스의 전체 목록과 구성 옵션은 이 참조 페이지의 서비스
# 섹션을 참조하세요.
services:
- type: identity
destination:
type: directory
path: /opt/machine-id
# outputs는 `services`와 동의어이며 레거시 호환성을 위해 존재합니다.
# `services`와 `outputs` 양쪽에 지정된 모든 서비스가 활성화됩니다.
# 두 필드 사이에 항목을 중복하지 않아야 하며, 가능한 경우 `services`
# 필드 내에 구성을 유지하는 것을 권장합니다.
outputs:
- type: example
구성 파일이 제공되지 않으면 제공된 CLI 플래그를 기반으로 간단한 구성이 사용됩니다. tctl bots add ...의 다음 샘플 CLI를 사용하면:
$ tbot start \
--destination-dir=./tbot-user \
--token=00000000000000000000000000000000 \
--ca-pin=(=presets.ca_pin=) \
--proxy-server=example.teleport.sh:443
다음과 동등한 구성이 사용됩니다:
proxy_server: example.teleport.sh:443
onboarding:
join_method: "token"
token: "(=presets.tokens.first=)"
ca_pins:
- "(=presets.ca_pin=)"
storage:
type: directory
path: /var/lib/teleport/bot
services:
- type: identity
destination:
type: directory
path: ./tbot-user
출력 서비스#
출력 서비스는 tbot이 실행될 때 수행해야 하는 작업을 정의합니다. 생성할 인증서의 형식, 인증서를 생성하는 데 사용되는 역할, 그리고 인증서를 작성해야 하는 대상을 설명합니다.
여러 유형의 출력이 있습니다. 의도한 사용 사례에 가장 적합한 것을 선택하세요.
identity#
identity 출력 서비스는 다음을 인증하는 데 사용할 수 있습니다:
tsh, openssh 및 ansible과 같은 도구를 사용하여 Teleport 서버에 SSH 접근.tsh또는tctl과 같은 도구를 사용하여 클러스터에 대한 관리 작업.- Teleport Terraform 프로바이더를 사용하여 Teleport 리소스 관리.
- Teleport Go SDK를 사용하여 Teleport API 접근.
identity 출력을 컨텍스트에서 사용하는 것을 보려면 시작하기 가이드를 참조하세요.
# type은 출력의 유형을 지정합니다. identity 출력의 경우 항상 `identity`입니다.
type: identity
# ssh_config는 identity 출력이 OpenSSH 구성 파일을 생성하려 할지 제어합니다.
# 이를 위해서는 `tbot`이 Teleport Proxy Service에 연결할 수 있어야 합니다.
# "on" 또는 "off"여야 합니다. 지정하지 않으면 기본값은 "on"입니다.
ssh_config: on
# allow_reissue는 identity 출력이 생성한 인증서를 재발행할 수 있는지
# (예: `tsh apps login`/`tsh db login`과 함께 사용) 제어합니다.
# 지정하지 않으면 기본값은 `false`입니다. 인증서를 재발행할 수 없다는
# 오류 메시지가 표시되면 이를 `true`로 설정하세요.
allow_reissue: false
<!-- INCLUDE:ENGLISH:docs/pages/includes/machine-id/common-output-config.yaml -->
# The following configuration fields are available across most output types.
# destination specifies where the output should write any generated artifacts
# such as certificates and configuration files.
#
# See the full list of supported destinations and their configuration options
# under the Destinations section of this reference page.
destination:
type: directory
path: /opt/machine-id
# roles specifies the roles that should be included in the certificates generated
# by the output. These roles must be roles that the bot has been granted
# permission to impersonate.
#
# if no roles are specified, all roles the bot is allowed to impersonate are used.
roles:
- editor
# credential_ttl and renewal_interval override the credential TTL and renewal
# interval for this specific output, so that you can make its certificates valid
# for shorter than `tbot`'s internal certificates.
#
# This is particularly useful when using `tbot` in one-shot as part of a cron job
# where you need `tbot`'s internal certificate to live long enough to be renewed
# on the next invocation, but don't want long-lived workload certificates on-disk.
credential_ttl: 30m
renewal_interval: 15m
# name optionally overrides the name of the service used in logs and the `/readyz`
# endpoint. It must only contain letters, numbers, hyphens, underscores, and plus
# symbols.
name: my-service-name
<!-- /INCLUDE:ENGLISH -->
application#
application 출력 서비스는 Teleport로 구성된 애플리케이션에 접근하는 데 사용할 수 있는 자격 증명을 생성하는 데 사용됩니다.
application 출력을 컨텍스트에서 사용하는 것을 보려면 애플리케이션이 있는 머신 및 워크로드 아이덴티티 가이드를 참조하세요.
# type은 출력의 유형을 지정합니다. application 출력의 경우 항상
# `application`입니다.
type: application
# app_name은 `tbot`이 자격 증명을 생성해야 하는 Teleport 클러스터에
# 구성된 애플리케이션 이름을 지정합니다.
# 이 필드는 반드시 지정해야 합니다.
app_name: grafana
<!-- INCLUDE:ENGLISH:docs/pages/includes/machine-id/common-output-config.yaml -->
# The following configuration fields are available across most output types.
# destination specifies where the output should write any generated artifacts
# such as certificates and configuration files.
#
# See the full list of supported destinations and their configuration options
# under the Destinations section of this reference page.
destination:
type: directory
path: /opt/machine-id
# roles specifies the roles that should be included in the certificates generated
# by the output. These roles must be roles that the bot has been granted
# permission to impersonate.
#
# if no roles are specified, all roles the bot is allowed to impersonate are used.
roles:
- editor
# credential_ttl and renewal_interval override the credential TTL and renewal
# interval for this specific output, so that you can make its certificates valid
# for shorter than `tbot`'s internal certificates.
#
# This is particularly useful when using `tbot` in one-shot as part of a cron job
# where you need `tbot`'s internal certificate to live long enough to be renewed
# on the next invocation, but don't want long-lived workload certificates on-disk.
credential_ttl: 30m
renewal_interval: 15m
# name optionally overrides the name of the service used in logs and the `/readyz`
# endpoint. It must only contain letters, numbers, hyphens, underscores, and plus
# symbols.
name: my-service-name
<!-- /INCLUDE:ENGLISH -->
database#
database 출력 서비스는 Teleport로 구성된 데이터베이스에 접근하는 데 사용할 수 있는 자격 증명을 생성하는 데 사용됩니다.
database 출력을 컨텍스트에서 사용하는 것을 보려면 데이터베이스가 있는 머신 및 워크로드 아이덴티티 가이드를 참조하세요.
# type은 출력의 유형을 지정합니다. database 출력의 경우 항상 `database`입니다.
type: database
# service는 출력이 자격 증명을 생성해야 하는 Teleport에 구성된 데이터베이스
# 서버의 이름입니다. 이 필드는 반드시 지정해야 합니다.
service: my-postgres-server
# database는 자격 증명을 생성할 지정된 데이터베이스 서버의 특정 데이터베이스
# 이름입니다. 여러 개별 데이터베이스를 지원하지 않는 데이터베이스 유형의
# 경우 지정할 필요가 없습니다.
database: my-database
# username은 자격 증명을 생성할 지정된 데이터베이스 서버의 사용자 이름입니다.
# 사용자가 없는 데이터베이스 유형의 경우 지정할 필요가 없습니다.
username: my-user
# format은 출력 아티팩트에 사용할 형식을 지정합니다. 지정하지 않으면
# 기본 형식이 사용됩니다. 지원되는 값의 전체 목록은 아래의 "지원되는
# 형식" 테이블을 참조하세요.
format: tls
<!-- INCLUDE:ENGLISH:docs/pages/includes/machine-id/common-output-config.yaml -->
# The following configuration fields are available across most output types.
# destination specifies where the output should write any generated artifacts
# such as certificates and configuration files.
#
# See the full list of supported destinations and their configuration options
# under the Destinations section of this reference page.
destination:
type: directory
path: /opt/machine-id
# roles specifies the roles that should be included in the certificates generated
# by the output. These roles must be roles that the bot has been granted
# permission to impersonate.
#
# if no roles are specified, all roles the bot is allowed to impersonate are used.
roles:
- editor
# credential_ttl and renewal_interval override the credential TTL and renewal
# interval for this specific output, so that you can make its certificates valid
# for shorter than `tbot`'s internal certificates.
#
# This is particularly useful when using `tbot` in one-shot as part of a cron job
# where you need `tbot`'s internal certificate to live long enough to be renewed
# on the next invocation, but don't want long-lived workload certificates on-disk.
credential_ttl: 30m
renewal_interval: 15m
# name optionally overrides the name of the service used in logs and the `/readyz`
# endpoint. It must only contain letters, numbers, hyphens, underscores, and plus
# symbols.
name: my-service-name
<!-- /INCLUDE:ENGLISH -->
지원되는 형식#
database 출력 유형의 format 구성 필드에 다음 값을 제공할 수 있습니다:
format |
설명 |
|---|---|
| 미지정 | tlscert에 인증서, key에 개인 키, teleport-database-ca.crt에 CA를 제공합니다. 대부분의 클라이언트 및 데이터베이스와 호환됩니다. |
mongo |
mongo.crt 및 mongo.cas를 제공합니다. MongoDB 클라이언트와 함께 사용하도록 설계되었습니다. |
cockroach |
cockroach/node.key, cockroach/node.crt, cockroach/ca.crt를 제공합니다. CockroachDB 클라이언트와 함께 사용하도록 설계되었습니다. |
tls |
tls.key, tls.crt, tls.cas를 제공합니다. 특정 파일 확장자가 필요한 일반 클라이언트를 위한 것입니다. |
kubernetes#
kubernetes 출력은 Teleport로 구성된 Kubernetes 클러스터에 접근하는 데 사용할 수 있는 자격 증명을 생성하는 데 사용됩니다.
kubectl과 함께 사용할 수 있는 kubeconfig.yaml을 출력 대상에 생성합니다.
kubernetes 출력을 컨텍스트에서 사용하는 것을 보려면 Kubernetes 클러스터가 있는 머신 및 워크로드 아이덴티티 가이드를 참조하세요.
# type은 출력의 유형을 지정합니다. kubernetes 출력의 경우 항상
# `kubernetes`입니다.
type: kubernetes
# kubernetes_cluster는 출력이 자격 증명과 kubeconfig를 생성해야 하는
# Teleport에 구성된 Kubernetes 클러스터의 이름입니다.
# 이 필드는 반드시 지정해야 합니다.
kubernetes_cluster: my-cluster
# disable_exec_plugin은 `kubectl` 자격 증명 exec 플러그인으로 `tbot` 바이너리를
# 사용하는 기본 동작을 비활성화합니다. 이는 생성된 kubeconfig를 소비하는
# 시스템에 `tbot`이 존재하지 않는 환경에서 유용합니다(예: `kubernetes_secret`
# 출력 유형 사용 시). 이 자격 증명 exec 플러그인은 단일 `kubectl` 호출 내에서
# 자격 증명을 자동으로 갱신하는 데 사용됩니다. 기본값은 `false`입니다.
disable_exec_plugin: false
<!-- INCLUDE:ENGLISH:docs/pages/includes/machine-id/common-output-config.yaml -->
# The following configuration fields are available across most output types.
# destination specifies where the output should write any generated artifacts
# such as certificates and configuration files.
#
# See the full list of supported destinations and their configuration options
# under the Destinations section of this reference page.
destination:
type: directory
path: /opt/machine-id
# roles specifies the roles that should be included in the certificates generated
# by the output. These roles must be roles that the bot has been granted
# permission to impersonate.
#
# if no roles are specified, all roles the bot is allowed to impersonate are used.
roles:
- editor
# credential_ttl and renewal_interval override the credential TTL and renewal
# interval for this specific output, so that you can make its certificates valid
# for shorter than `tbot`'s internal certificates.
#
# This is particularly useful when using `tbot` in one-shot as part of a cron job
# where you need `tbot`'s internal certificate to live long enough to be renewed
# on the next invocation, but don't want long-lived workload certificates on-disk.
credential_ttl: 30m
renewal_interval: 15m
# name optionally overrides the name of the service used in logs and the `/readyz`
# endpoint. It must only contain letters, numbers, hyphens, underscores, and plus
# symbols.
name: my-service-name
<!-- /INCLUDE:ENGLISH -->
kubernetes/v2#
kubernetes/v2 출력 서비스는 동일한 kubeconfig.yaml 내에서 개별 컨텍스트로 여러 Kubernetes 클러스터에 접근하는 데 사용할 수 있습니다.
type: kubernetes/v2
# selectors는 하나 이상의 일치하는 Kubernetes 클러스터를 포함합니다.
# 각 일치는 봇이 클러스터에 접근할 권한이 있다고 가정하여 결과
# `kubeconfig.yaml`에 포함됩니다.
selectors:
# name은 이름으로 정확히 일치합니다. 현재 와일드카드는 지원되지 않습니다.
# 원하는 경우 여러 name 셀렉터를 지정할 수 있습니다.
- name: foo
# default_namespace는 kubeconfig 내 컨텍스트에 구성되어야 하는
# 네임스페이스입니다. 이는 사용자가 명시적으로 네임스페이스를 제공하지
# 않은 경우 `kubectl`/SDK에서 사용되는 네임스페이스입니다.
#
# 지정하지 않으면 kubeconfig에 기본 네임스페이스가 설정되지 않으며
# `kubectl`/SDK는 자체 로직에 따라 기본값을 사용합니다 - 종종
# `default` 네임스페이스를 선택합니다.
default_namespace: my-namespace
# labels는 이러한 레이블과 일치하는 모든 클러스터를 포함합니다. 필요한 경우
# 여러 레이블 셀렉터를 제공할 수 있습니다.
- labels:
env: dev
# 다음 구성 필드는 대부분의 출력 유형에서 사용 가능합니다.
# 이 출력 유형에는 `roles`가 지원되지 않습니다.
destination:
type: directory
path: /opt/machine-id
# credential_ttl 및 renewal_interval은 이 특정 출력에 대한 자격 증명 TTL 및
# 갱신 간격을 재정의하여 `tbot`의 내부 인증서보다 짧은 유효 기간의 인증서를
# 만들 수 있습니다.
#
# 이는 cron 작업의 일부로 `tbot`을 원샷으로 사용할 때 특히 유용합니다.
# 다음 호출 시 갱신될 수 있도록 `tbot`의 내부 인증서가 충분히 오래
# 지속되어야 하지만, 디스크에 오래 지속되는 워크로드 인증서를 원하지 않는
# 경우에 사용됩니다.
credential_ttl: 30m
renewal_interval: 15m
# disable_exec_plugin은 `kubectl` 자격 증명 exec 플러그인으로 `tbot` 바이너리를
# 사용하는 기본 동작을 비활성화합니다. 이는 생성된 kubeconfig를 소비하는
# 시스템에 `tbot`이 존재하지 않는 환경에서 유용합니다(예: `kubernetes_secret`
# 출력 유형 사용 시). 이 자격 증명 exec 플러그인은 단일 `kubectl` 호출 내에서
# 자격 증명을 자동으로 갱신하는 데 사용됩니다. 기본값은 `false`입니다.
disable_exec_plugin: false
# context_name_template은 생성된 kubeconfig에서 컨텍스트 이름의 형식을
# 결정합니다. 다음 변수를 지원하는 Go 템플릿 문자열입니다:
#
# - {} - Teleport 클러스터 이름
# - {} - Kubernetes 클러스터 리소스 이름
# - {} - `{{index .Labels "key"}}`를 사용하여 인덱싱할 수 있는
# Kubernetes 클러스터 리소스에 적용된 레이블의 맵
#
# 기본적으로 다음 템플릿이 사용됩니다: "{}-{}"
context_name_template: "{}"
# relay_server는 tbot이 Teleport 컨트롤 플레인 대신 Kubernetes 트래픽을
# 라우팅하는 데 사용해야 하는 Relay 서비스 주소를 지정합니다. 설정하면
# 모든 Kubernetes API 연결이 이 Relay를 통해 전송됩니다; 지정된 Relay를
# 통해 접근 가능한 Kubernetes 클러스터만 접근할 수 있으며 tbot은 컨트롤
# 플레인으로 폴백하지 않습니다. 호스트 이름 또는 host:port를 제공하세요
# (예: relay.example.com 또는 relay.example.com:443).
#
# relay_server 옵션을 사용하려면 `tbot` 18.5.0 이상이 필요합니다.
relay_server: relay.example.com
# name은 선택적으로 로그와 `/readyz` 엔드포인트에서 사용되는 서비스 이름을
# 재정의합니다. 문자, 숫자, 하이픈, 밑줄, 더하기 기호만 포함해야 합니다.
name: my-service-name
셀렉터와 일치하는 각 Kubernetes 클러스터는 생성된 kubeconfig.yaml에 새 컨텍스트가 됩니다. 다음과 같이 사용할 수 있습니다:
$ kubectl --kubeconfig /opt/machine-id/kubeconfig.yaml --context=example.teleport.sh-foo get pods
컨텍스트 이름은 [Teleport 클러스터 이름]-[Kubernetes 클러스터 이름]이므로 위 명령은 foo 클러스터에서 kubectl get pods를 실행합니다.
시간이 지남에 따라 클러스터가 추가되거나 제거되면, kubeconfig.yaml은 봇의 일반 갱신 간격에 따라 업데이트됩니다. tbot을 재시작하거나 pkill -usr1 tbot으로 신호를 보내 조기 갱신을 트리거할 수 있습니다.
kubernetes/argo-cd#
kubernetes/argo-cd 출력 서비스는 Argo CD가 외부 Kubernetes 클러스터에 안전하게 연결할 수 있도록 하는 데 사용할 수 있습니다.
Kubernetes 시크릿을 사용하여 "선언적으로" 클러스터 자격 증명을 관리함으로써 작동합니다. 각 일치하는 Kubernetes 클러스터에 대해 tbot은 연결 세부 정보와 단기 자격 증명이 포함된 시크릿을 생성하고 지속적으로 업데이트하며, Argo CD 검색을 위해 "argocd.argoproj.io/secret-type": "cluster"로 레이블을 지정합니다.
따라서 Kubernetes 클러스터 내에서만 사용하도록 의도되어 있습니다. Helm 차트를 사용하여 배포하는 방법에 대해서는 Argo CD가 있는 머신 및 워크로드 아이덴티티 가이드를 참조하세요.
kubernetes/argo-cd 출력 유형은 현재 Teleport 프록시가 TLS 종료
로드 밸런서 뒤에 있는 구성을 지원하지 않습니다.
type: kubernetes/argo-cd
# selectors는 하나 이상의 일치하는 Kubernetes 클러스터를 포함합니다. 봇이
# 접근할 권한이 있는 각 일치하는 클러스터는 Kubernetes 시크릿을 생성하여
# Argo CD에 등록됩니다.
selectors:
# name은 이름으로 정확히 일치합니다. 현재 와일드카드는 지원되지 않습니다.
# 원하는 경우 여러 name 셀렉터를 지정할 수 있습니다.
- name: foo
# labels는 이러한 레이블과 일치하는 모든 클러스터를 포함합니다. 필요한 경우
# 여러 레이블 셀렉터를 제공할 수 있습니다.
- labels:
env: dev
# secret_namespace는 Argo CD 클러스터 시크릿이 생성될 Kubernetes 네임스페이스입니다.
# Argo CD가 실행 중인 네임스페이스와 일치해야 합니다.
#
# 기본적으로 `tbot`은 `POD_NAMESPACE` 환경 변수를 사용하거나, 비어 있는 경우:
# "default"를 사용합니다.
secret_namespace: "argocd"
# secret_name_prefix는 Kubernetes 시크릿 이름에 적용될 접두사로 쉽게
# 식별할 수 있도록 합니다. 이름의 나머지는 대상 클러스터 이름의 해시에서
# 파생됩니다.
#
# 기본적으로 접두사는 "teleport.argocd-cluster"입니다.
secret_name_prefix: "argocd-cluster"
# secret_labels는 Argo CD 검색을 위해 추가된 "argocd.argoproj.io/secret-type"
# 레이블에 추가하여 클러스터 시크릿에 적용될 레이블 집합입니다.
#
# 레이블 값은 다음 변수를 가진 Go 템플릿 문자열일 수 있습니다:
#
# - {} - Teleport 클러스터 이름
# - {} - Kubernetes 클러스터 리소스 이름
# - {} - `{{index .Labels "key"}}`를 사용하여 인덱싱할 수 있는
# Kubernetes 클러스터 리소스에 적용된 레이블의 맵
#
# 레이블 값이 비어 있으면 레이블이 시크릿에 추가되지 않습니다.
secret_labels:
department: engineering
cluster-region: |-
{{index .Labels "region"}}
# secret_annotations는 `tbot`의 자체 어노테이션에 추가하여 클러스터 시크릿에
# 적용될 어노테이션 집합입니다:
#
# - "teleport.dev/bot-name" - 봇 이름
# - "teleport.dev/kubernetes-cluster-name" - Kubernetes 클러스터 이름
# - "teleport.dev/updated" - RFC3339 형식의 타임스탬프
# - "teleport.dev/tbot-version" - 실행 중인 tbot의 버전
# - "teleport.dev/teleport-cluster-name" - Teleport 클러스터 이름
#
# 어노테이션 값은 다음 변수를 가진 Go 템플릿 문자열일 수 있습니다:
#
# - {} - Teleport 클러스터 이름
# - {} - Kubernetes 클러스터 리소스 이름
# - {} - `{{index .Labels "key"}}`를 사용하여 인덱싱할 수 있는
# Kubernetes 클러스터 리소스에 적용된 레이블의 맵
#
# 어노테이션 값이 비어 있으면 어노테이션이 시크릿에 추가되지 않습니다
secret_annotations:
creator: bob
# project는 Kubernetes 클러스터가 연결될 Argo CD 프로젝트입니다.
project: edge-services
# namespaces는 선택적으로 대상 Kubernetes 클러스터 내에서 애플리케이션을
# 배포할 수 있는 네임스페이스를 제한합니다. 기본적으로 모든 네임스페이스가
# 허용됩니다.
namespaces:
- dev
- qa
# cluster_resources는 Argo CD가 대상 클러스터 내의 클러스터 범위 리소스에
# 대해 작동할 수 있는지 결정합니다. 이 옵션은 `namespaces`가 비어 있지
# 않을 때만 적용됩니다.
cluster_resources: true
# cluster_name_template은 Argo CD에서 클러스터 이름의 형식을 결정합니다.
# 다음 변수를 지원하는 Go 템플릿 문자열입니다:
#
# - {} - Teleport 클러스터 이름
# - {} - Kubernetes 클러스터 리소스 이름
#
# 기본적으로 다음 템플릿이 사용됩니다: "{}-{}"
cluster_name_template: "{}"
# 다음 구성 필드는 대부분의 출력 유형에서 사용 가능합니다.
# 이 출력 유형에는 `roles` 및 `destination`이 지원되지 않습니다.
# credential_ttl 및 renewal_interval은 이 특정 출력에 대한 자격 증명 TTL 및
# 갱신 간격을 재정의합니다.
credential_ttl: 30m
renewal_interval: 15m
# name은 선택적으로 로그와 `/readyz` 엔드포인트에서 사용되는 서비스 이름을
# 재정의합니다. 문자, 숫자, 하이픈, 밑줄, 더하기 기호만 포함해야 합니다.
name: my-service-name
ssh_host#
ssh_host 출력 서비스는 Teleport 사용자가 연결할 수 있도록 Teleport와 함께 OpenSSH 서버를 구성하는 데 필요한 아티팩트를 생성하는 데 사용됩니다.
출력 서비스는 다음 아티팩트를 생성합니다:
ssh_host-cert.pub: Teleport 호스트 인증 기관이 서명한 SSH 인증서.ssh_host: SSH 호스트 인증서와 연결된 개인 키.ssh_host-user-ca.pub: OpenSSH 호환 형식으로 내보낸 Teleport 사용자 인증 기관.
# type은 출력의 유형을 지정합니다. ssh host 출력의 경우 항상 `ssh_host`입니다.
type: ssh_host
# principals는 호스트 인증서에 포함할 호스트 이름 목록입니다.
# 이 이름은 클라이언트가 호스트에 연결하는 데 사용하는 이름과 일치해야 합니다.
principals:
- host.example.com
<!-- INCLUDE:ENGLISH:docs/pages/includes/machine-id/common-output-config.yaml -->
# The following configuration fields are available across most output types.
# destination specifies where the output should write any generated artifacts
# such as certificates and configuration files.
#
# See the full list of supported destinations and their configuration options
# under the Destinations section of this reference page.
destination:
type: directory
path: /opt/machine-id
# roles specifies the roles that should be included in the certificates generated
# by the output. These roles must be roles that the bot has been granted
# permission to impersonate.
#
# if no roles are specified, all roles the bot is allowed to impersonate are used.
roles:
- editor
# credential_ttl and renewal_interval override the credential TTL and renewal
# interval for this specific output, so that you can make its certificates valid
# for shorter than `tbot`'s internal certificates.
#
# This is particularly useful when using `tbot` in one-shot as part of a cron job
# where you need `tbot`'s internal certificate to live long enough to be renewed
# on the next invocation, but don't want long-lived workload certificates on-disk.
credential_ttl: 30m
renewal_interval: 15m
# name optionally overrides the name of the service used in logs and the `/readyz`
# endpoint. It must only contain letters, numbers, hyphens, underscores, and plus
# symbols.
name: my-service-name
<!-- /INCLUDE:ENGLISH -->
workload-identity-x509#
workload-identity-x509 출력 서비스는 X509 워크로드 신원 자격 증명을 발행하고 구성된 대상에 쓰는 데 사용됩니다.
출력은 다음 아티팩트를 생성합니다:
svid.pem: X509 SVID.svid.key: X509 SVID와 연결된 개인 키.bundle.pem: 신뢰 도메인 CA가 포함된 X509 번들.
워크로드 아이덴티티 기능에 대한 자세한 내용은 워크로드 아이덴티티 소개를 참조하세요.
# type은 출력의 유형을 지정합니다. X509 워크로드 아이덴티티 출력의 경우
# 항상 `workload-identity-x509`입니다.
type: workload-identity-x509
<!-- INCLUDE:ENGLISH:docs/pages/includes/machine-id/workload-identity-selector-config.yaml -->
# Selector is used to control which WorkloadIdentity resource will be used to
# issue the workload identity credential. The selector can either be the name of
# a specific WorkloadIdentity resource or a label selector that can match
# multiple WorkloadIdentity resources.
#
# The selector must be set to either a name or labels, but not both.
selector:
# Name is used to select a specific WorkloadIdentity resource by its name.
name: foo
# Labels is used to select multiple WorkloadIdentity resources by their labels.
labels:
app: [foo, bar]
<!-- /INCLUDE:ENGLISH -->
<!-- INCLUDE:ENGLISH:docs/pages/includes/machine-id/common-output-config.yaml -->
# The following configuration fields are available across most output types.
# destination specifies where the output should write any generated artifacts
# such as certificates and configuration files.
#
# See the full list of supported destinations and their configuration options
# under the Destinations section of this reference page.
destination:
type: directory
path: /opt/machine-id
# roles specifies the roles that should be included in the certificates generated
# by the output. These roles must be roles that the bot has been granted
# permission to impersonate.
#
# if no roles are specified, all roles the bot is allowed to impersonate are used.
roles:
- editor
# credential_ttl and renewal_interval override the credential TTL and renewal
# interval for this specific output, so that you can make its certificates valid
# for shorter than `tbot`'s internal certificates.
#
# This is particularly useful when using `tbot` in one-shot as part of a cron job
# where you need `tbot`'s internal certificate to live long enough to be renewed
# on the next invocation, but don't want long-lived workload certificates on-disk.
credential_ttl: 30m
renewal_interval: 15m
# name optionally overrides the name of the service used in logs and the `/readyz`
# endpoint. It must only contain letters, numbers, hyphens, underscores, and plus
# symbols.
name: my-service-name
<!-- /INCLUDE:ENGLISH -->
workload-identity-jwt#
workload-identity-jwt 출력 서비스는 JWT 워크로드 신원 자격 증명을 발행하고 구성된 대상에 쓰는 데 사용됩니다.
JWT 워크로드 신원 자격 증명은 SPIFFE JWT SVID 사양과 호환됩니다.
출력은 다음 아티팩트를 생성합니다:
jwt_svid: JWT SVID.
워크로드 아이덴티티 기능에 대한 자세한 내용은 워크로드 아이덴티티 소개를 참조하세요.
# type은 출력의 유형을 지정합니다. JWT 워크로드 아이덴티티 출력의 경우
# 항상 `workload-identity-jwt`입니다.
type: workload-identity-jwt
# audiences는 JWT의 `aud` 클레임에 포함되어야 하는 값을 지정합니다.
# 일반적으로 JWT의 의도된 수신자를 식별하며 단일 값을 포함합니다.
#
# 최소 하나의 audience 값을 지정해야 합니다.
audiences:
- example.com
- foo.example.com
<!-- INCLUDE:ENGLISH:docs/pages/includes/machine-id/workload-identity-selector-config.yaml -->
# Selector is used to control which WorkloadIdentity resource will be used to
# issue the workload identity credential. The selector can either be the name of
# a specific WorkloadIdentity resource or a label selector that can match
# multiple WorkloadIdentity resources.
#
# The selector must be set to either a name or labels, but not both.
selector:
# Name is used to select a specific WorkloadIdentity resource by its name.
name: foo
# Labels is used to select multiple WorkloadIdentity resources by their labels.
labels:
app: [foo, bar]
<!-- /INCLUDE:ENGLISH -->
<!-- INCLUDE:ENGLISH:docs/pages/includes/machine-id/common-output-config.yaml -->
# The following configuration fields are available across most output types.
# destination specifies where the output should write any generated artifacts
# such as certificates and configuration files.
#
# See the full list of supported destinations and their configuration options
# under the Destinations section of this reference page.
destination:
type: directory
path: /opt/machine-id
# roles specifies the roles that should be included in the certificates generated
# by the output. These roles must be roles that the bot has been granted
# permission to impersonate.
#
# if no roles are specified, all roles the bot is allowed to impersonate are used.
roles:
- editor
# credential_ttl and renewal_interval override the credential TTL and renewal
# interval for this specific output, so that you can make its certificates valid
# for shorter than `tbot`'s internal certificates.
#
# This is particularly useful when using `tbot` in one-shot as part of a cron job
# where you need `tbot`'s internal certificate to live long enough to be renewed
# on the next invocation, but don't want long-lived workload certificates on-disk.
credential_ttl: 30m
renewal_interval: 15m
# name optionally overrides the name of the service used in logs and the `/readyz`
# endpoint. It must only contain letters, numbers, hyphens, underscores, and plus
# symbols.
name: my-service-name
<!-- /INCLUDE:ENGLISH -->
workload-identity-aws-roles-anywhere#
workload-identity-aws-roles-anywhere 출력 서비스는 X509 워크로드 신원 자격 증명을 발행하고, Roles Anywhere를 사용하여 단기 AWS 자격 증명으로 교환하고, 구성된 대상에 쓰는 데 사용됩니다.
자격 증명은 AWS CLI 및 SDK와 호환되는 AWS 공유 자격 증명 파일 형식으로 작성됩니다.
출력 서비스는 다음 아티팩트를 생성합니다:
aws_credentials: CLI 및 SDK 호환 AWS 공유 자격 증명 파일.
워크로드 아이덴티티 기능에 대한 자세한 내용은 워크로드 아이덴티티 소개를 참조하세요.
# type은 출력의 유형을 지정합니다. 워크로드 아이덴티티 AWS Roles Anywhere
# 출력의 경우 항상 `workload-identity-aws-roles-anywhere`입니다.
type: workload-identity-aws-roles-anywhere
# 다음 구성 필드는 대부분의 출력 유형에서 사용 가능합니다.
# destination은 인증서 및 구성 파일과 같이 생성된 아티팩트를 출력이
# 작성해야 하는 위치를 지정합니다.
#
# 지원되는 대상의 전체 목록과 구성 옵션은 이 참조 페이지의 대상 섹션을
# 참조하세요.
destination:
type: directory
path: /opt/machine-id
# role_arn은 생성된 자격 증명이 수임해야 하는 AWS 역할의 ARN입니다.
# 필수.
role_arn: arn:aws:iam::123456789012:role/example-role
# profile_arn은 Roles Anywhere 교환 중 사용할 AWS 프로필의 ARN입니다.
# 필수.
profile_arn: arn:aws:rolesanywhere:us-east-1:123456789012:profile/0000000-0000-0000-0000-00000000000
# trust_anchor_arn은 Roles Anywhere 교환 중 사용해야 하는 신뢰 앵커의 ARN입니다.
# 필수.
trust_anchor_arn: arn:aws:rolesanywhere:us-east-1:123456789012:trust-anchor/0000000-0000-0000-0000-000000000000
# region은 Roles Anywhere 교환에 사용할 AWS 리전입니다. 생략하면
# `AWS_REGION` 환경 변수 또는 AWS 구성 파일로 설정된 리전이 기본값입니다.
region: us-east-1
# session_duration은 생성된 AWS 자격 증명의 유효 기간입니다. 최대 12시간까지
# 가능합니다. 생략하면 기본값은 6시간입니다.
session_duration: 6h
# session_renewal_interval은 AWS 자격 증명을 갱신해야 하는 간격입니다.
# 세션 기간보다 짧아야 합니다. 생략하면 기본값은 1시간입니다.
session_renewal_interval: 1h
# credential_profile_name은 AWS 자격 증명 파일에 쓸 프로필 이름입니다.
# 지정하지 않으면 이 프로필은 `default`로 이름이 지정됩니다.
credential_profile_name: my-profile
# artifact_name은 AWS 자격 증명을 작성할 파일 이름입니다.
# 지정하지 않으면 기본값은 `aws_credentials`입니다.
artifact_name: my-credentials-file
# overwrite_credential_file은 AWS 자격 증명 파일이 이미 존재하는 경우
# 덮어쓸지, 또는 tbot이 추가한 프로필을 파일의 기존 프로필과 병합할지
# 제어합니다. 지정하지 않으면 기본값은 `false`입니다.
overwrite_credential_file: false
<!-- INCLUDE:ENGLISH:docs/pages/includes/machine-id/workload-identity-selector-config.yaml -->
# Selector is used to control which WorkloadIdentity resource will be used to
# issue the workload identity credential. The selector can either be the name of
# a specific WorkloadIdentity resource or a label selector that can match
# multiple WorkloadIdentity resources.
#
# The selector must be set to either a name or labels, but not both.
selector:
# Name is used to select a specific WorkloadIdentity resource by its name.
name: foo
# Labels is used to select multiple WorkloadIdentity resources by their labels.
labels:
app: [foo, bar]
<!-- /INCLUDE:ENGLISH -->
# name은 선택적으로 로그와 `/readyz` 엔드포인트에서 사용되는 서비스 이름을
# 재정의합니다. 문자, 숫자, 하이픈, 밑줄, 더하기 기호만 포함해야 합니다.
name: my-service-name
spiffe-svid#
이 서비스의 사용은 새로운 워크로드 아이덴티티 구성 경험의 도입으로 더 이상 권장되지 않습니다. 이 출력의 사용을 새로운 workload-identity-x509 또는 workload-identity-jwt 서비스로 대체할 수 있습니다.
자세한 내용은 새로운 워크로드 아이덴티티 구성 경험 및 마이그레이션 방법을 참조하세요.
spiffe-svid 출력은 SPIFFE X509 SVID를 생성하고 구성된 대상에 쓰는 데 사용됩니다.
출력은 다음 아티팩트를 생성합니다:
svid.pem: X509 SVID.svid.key: X509 SVID와 연결된 개인 키.bundle.pem: 신뢰 도메인 CA가 포함된 X509 번들.
jwts 목록 내의 각 항목에 대한 아티팩트도 생성됩니다. 이는 file_name에 따라 이름이 지정됩니다. 이 아티팩트에는 audience에 지정된 audience가 있는 JWT-SVID만 포함됩니다.
SPIFFE SVID 사용 방법에 대한 자세한 내용은 워크로드 아이덴티티를 참조하세요.
# type은 출력의 유형을 지정합니다. SPIFFE SVID 출력의 경우 항상
# `spiffe-svid`입니다.
type: spiffe-svid
# svid는 요청해야 하는 SPIFFE SVID의 속성을 지정합니다.
svid:
# path는 SPIFFE ID에 대해 요청해야 하는 경로 요소를 지정합니다.
path: /svc/foo
# sans는 생성된 X509 SVID에 포함할 선택적 주체 대체 이름(SAN)을 지정합니다.
# 생략하면 SAN이 포함되지 않습니다.
sans:
# dns는 DNS SAN을 지정합니다. 생략하면 DNS SAN이 포함되지 않습니다.
dns:
- foo.svc.example.com
# ip는 IP SAN을 지정합니다. 생략하면 IP SAN이 포함되지 않습니다.
ip:
- 10.0.0.1
# jwts는 JWT-SVID의 출력을 제어합니다. 각 항목은 별도의 아티팩트로
# 생성됩니다. 생략하면 JWT-SVID가 생성되지 않습니다.
jwts:
# audience는 JWT-SVID를 발행해야 하는 audience를 지정합니다.
# 일반적으로 JWT-SVID를 인증하는 데 사용될 서비스를 식별합니다.
- audience: https://example.com
# file_name은 JWT-SVID를 작성할 파일 이름을 지정합니다.
file_name: example-jwt
<!-- INCLUDE:ENGLISH:docs/pages/includes/machine-id/common-output-config.yaml -->
# The following configuration fields are available across most output types.
# destination specifies where the output should write any generated artifacts
# such as certificates and configuration files.
#
# See the full list of supported destinations and their configuration options
# under the Destinations section of this reference page.
destination:
type: directory
path: /opt/machine-id
# roles specifies the roles that should be included in the certificates generated
# by the output. These roles must be roles that the bot has been granted
# permission to impersonate.
#
# if no roles are specified, all roles the bot is allowed to impersonate are used.
roles:
- editor
# credential_ttl and renewal_interval override the credential TTL and renewal
# interval for this specific output, so that you can make its certificates valid
# for shorter than `tbot`'s internal certificates.
#
# This is particularly useful when using `tbot` in one-shot as part of a cron job
# where you need `tbot`'s internal certificate to live long enough to be renewed
# on the next invocation, but don't want long-lived workload certificates on-disk.
credential_ttl: 30m
renewal_interval: 15m
# name optionally overrides the name of the service used in logs and the `/readyz`
# endpoint. It must only contain letters, numbers, hyphens, underscores, and plus
# symbols.
name: my-service-name
<!-- /INCLUDE:ENGLISH -->
서비스#
서비스는 tbot 내에서 실행되는 구성 가능한 장기 실행 구성 요소입니다. 출력 서비스와 달리 아티팩트를 반드시 생성할 필요는 없습니다. 일반적으로 서비스는 머신 간 접근을 위한 지원 기능(예: 터널 열기 또는 API 제공)을 제공합니다.
workload-identity-api#
workload-identity-api 서비스는 로컬 워크로드 신원 API를 제공하는 리스너를 열어 동일한 호스트에서 실행 중인 워크로드에 워크로드 신원 자격 증명(예: X509/JWT SPIFFE SVID)을 제공하도록 설계되었습니다.
자세한 내용은 워크로드 아이덴티티 API 및 워크로드 증명 참조를 참조하세요.
workload-identity-api 서비스는 tbot이 원샷 모드에서 실행되도록 구성된 경우 시작되지 않습니다.
spiffe-workload-api#
이 서비스의 사용은 새로운 워크로드 아이덴티티 구성 경험의 도입으로 더 이상 권장되지 않습니다. 이 서비스의 사용을 새로운 workload-identity-api 서비스로 대체할 수 있습니다.
자세한 내용은 새로운 워크로드 아이덴티티 구성 경험 및 마이그레이션 방법을 참조하세요.
spiffe-workload-api 서비스는 SPIFFE Workload API를 구현하는 서비스를 위한 리스너를 엽니다. 이 서비스는 워크로드에 SPIFFE SVID를 제공하는 데 사용됩니다.
SPIFFE Workload API에 대한 자세한 내용은 워크로드 아이덴티티를 참조하세요.
# type은 서비스의 유형을 지정합니다. SPIFFE Workload API 서비스의 경우
# 항상 `spiffe-workload-api`입니다.
type: spiffe-workload-api
# listen은 서비스가 수신 대기해야 하는 주소를 지정합니다.
#
# 두 가지 유형의 리스너가 지원됩니다:
# - TCP: `tcp://<address>:<port>`
# - Unix 소켓: `unix:///<path>`
listen: unix:///opt/machine-id/workload.sock
# attestors는 이 Workload API에 대한 워크로드 증명을 구성할 수 있게 합니다.
attestors:
# docker는 Docker 워크로드 증명자에 대한 구성입니다. 자세한 내용은
# 워크로드 아이덴티티 API & 워크로드 증명 참조를 참조하세요.
docker:
# enabled는 워크로드의 신원이 Docker 컨테이너에 대한 정보로 증명되어야
# 하는지 지정합니다. 지정하지 않으면 기본값은 false입니다.
enabled: true
# addr는 Docker Engine 데몬에 연결할 수 있는 주소입니다.
# TCP를 통한 연결은 현재 지원되지 않으므로 `unix://path/to/socket`
# 형식이어야 합니다. 지정하지 않으면 "rootful" Docker 설치의 표준
# 소켓 위치인 `unix:///var/run/docker.sock`이 기본값입니다.
addr: unix:///var/run/docker.sock
# kubernetes는 Kubernetes 워크로드 증명자에 대한 구성입니다. 자세한 내용은
# Kubernetes 워크로드 증명자 섹션을 참조하세요.
kubernetes:
# enabled는 Kubernetes 워크로드 증명자를 활성화해야 하는지 지정합니다.
# 지정하지 않으면 기본값은 false입니다.
enabled: true
# kubelet은 Kubernetes 워크로드 증명자의 Kubelet API와의 상호 작용에
# 관련된 구성을 보유합니다.
kubelet:
# read_only_port는 읽기 전용 작업을 위해 Kubelet API가 노출되는 포트입니다.
# Kubernetes 1.16 이후로 읽기 전용 포트는 기본적으로 비활성화되어
# 있으므로 대신 secure_port를 사용해야 합니다.
read_only_port: 10255
# secure_port는 증명자가 Kubelet 보안 API에 연결해야 하는 포트입니다.
# 지정하지 않으면 기본값은 `10250`입니다. ReadOnlyPort와 상호 배타적입니다.
secure_port: 10250
# token_path는 Kubelet API 클라이언트가 Kubelet API로 인증하는 데
# 사용해야 하는 토큰 파일 경로입니다. 지정하지 않으면 기본값은
# `/var/run/secrets/kubernetes.io/serviceaccount/token`입니다.
token_path: "/var/run/secrets/kubernetes.io/serviceaccount/token"
# ca_path는 Kubelet API 클라이언트가 Kubelet API 서버의 인증서를
# 검증하는 데 사용해야 하는 CA 파일 경로입니다. 지정하지 않으면
# 기본값은 `/var/run/secrets/kubernetes.io/serviceaccount/ca.crt`입니다.
ca_path: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
# skip_verify는 Kubelet API 서버의 인증서 검증을 비활성화하는 데
# 사용됩니다. 지정하지 않으면 기본값은 false입니다.
#
# 지정하면 ca_path에 지정된 값이 무시됩니다.
#
# 이는 Kubelet API 서버에 Kubernetes 클러스터 CA가 서명한 인증서가
# 발급되지 않은 경우에 유용합니다. 이는 여러 Kubernetes 배포판에서
# 꽤 일반적입니다.
skip_verify: true
# anonymous는 Kubelet API 인증을 비활성화하는 데 사용됩니다.
# 지정하지 않으면 기본값은 false입니다. 설정하면 token_path 필드가
# 무시됩니다.
anonymous: false
# podman은 Podman 워크로드 증명자에 대한 구성입니다. 자세한 내용은
# 워크로드 아이덴티티 API & 워크로드 증명 참조를 참조하세요.
podman:
# enabled는 워크로드의 신원이 Podman 컨테이너 및 파드에 대한 정보로
# 증명되어야 하는지 지정합니다. 지정하지 않으면 기본값은 false입니다.
enabled: true
# addr는 Podman API 서비스에 연결할 수 있는 주소입니다.
# TCP는 지원되지 않으므로 `unix://path/to/socket` 형식이어야 합니다.
# 이 필드는 필수이며 기본값이 없습니다. 자세한 내용은
# 워크로드 아이덴티티 API & 워크로드 증명 참조를 참조하세요.
addr: unix:///run/podman/podman.sock
# sigstore는 Sigstore 워크로드 증명자에 대한 구성입니다. 자세한 내용은
# Sigstore 워크로드 증명 페이지를 참조하세요.
sigstore:
# enabled는 tbot이 워크로드의 컨테이너 이미지에 대한 Sigstore 서명을
# 검색할지 지정합니다. 지정하지 않으면 기본값은 false입니다.
enabled: true
# additional_registries는 워크로드 컨테이너 이미지의 소스 레지스트리
# 외에 서명을 검색할 OCI 레지스트리를 선택적으로 구성합니다.
additional_registries:
-
# OCI 레지스트리의 호스트.
host: ghcr.io
# credentials_path는 레지스트리별 자격 증명이 포함된 Docker 또는
# Podman 구성 파일 경로입니다.
credentials_path: /path/to/docker/config.json
# allowed_private_network_prefixes는 Sigstore 증명자가 연결할 수 있는
# 프라이빗 IP 주소 접두사(CIDR 블록)입니다. 기본적으로 tbot은 SSRF
# 공격의 표면을 줄이기 위해 공개적으로 라우팅 가능한 IP 주소의
# 레지스트리에만 연결합니다.
allowed_private_network_prefixes:
- "192.168.1.42/32"
- "fd12:3456:789a:1::1/128"
# systemd는 Systemd 워크로드 증명자에 대한 구성입니다. 자세한 내용은
# 워크로드 아이덴티티 API & 워크로드 증명 참조를 참조하세요.
systemd:
# enabled는 워크로드의 신원이 Systemd 서비스에 대한 정보로 증명되어야
# 하는지 지정합니다. 지정하지 않으면 기본값은 false입니다.
enabled: true
# unix는 Unix 워크로드 증명자에 대한 구성입니다.
unix:
# binary_hash_max_size_bytes는 SHA-256 체크섬을 계산하기 위해 프로세스의
# 바이너리에서 읽을 최대 바이트 수입니다. 바이너리가 이보다 크면
# `workload.unix.binary_hash` 속성이 비어 있습니다. 지정하지 않으면
# 기본값은 1GiB입니다. 무제한으로 설정하려면 -1로 설정하세요.
binary_hash_max_size_bytes: 1024
# svids는 Workload API가 제공해야 하는 SPIFFE SVID를 지정합니다.
svids:
# path는 SPIFFE ID에 대해 요청해야 하는 경로 요소를 지정합니다.
- path: /svc/foo
# hint는 여러 SVID가 사용 가능한 경우 워크로드가 어느 SVID를 선택할지
# 결정하는 데 도움이 되는 자유 형식 문자열입니다. 생략하면 hint가
# 포함되지 않습니다.
hint: my-hint
# sans는 생성된 X509 SVID에 포함할 선택적 주체 대체 이름(SAN)을 지정합니다.
# 생략하면 SAN이 포함되지 않습니다.
sans:
# dns는 DNS SAN을 지정합니다. 생략하면 DNS SAN이 포함되지 않습니다.
dns:
- foo.svc.example.com
# ip는 IP SAN을 지정합니다. 생략하면 IP SAN이 포함되지 않습니다.
ip:
- 10.0.0.1
# rules는 워크로드 증명 규칙 목록을 지정합니다. 워크로드가 이 SVID를
# 받으려면 이러한 규칙 중 최소 하나를 충족해야 합니다.
#
# 규칙이 지정되지 않으면, 이 서비스에 연결하는 모든 워크로드에 SVID가
# 발행됩니다.
rules:
# unix는 워크로드가 동일한 호스트에서 실행 중이고 Unix 소켓을
# 사용하여 Workload API에 연결된 경우 사용 가능한 워크로드 증명
# 기준 그룹입니다.
#
# 이 그룹의 기준 중 하나라도 지정된 경우, Unix 소켓을 사용하여
# 연결하지 않는 워크로드는 이 SVID를 받지 않습니다.
- unix:
# uid는 이 SVID를 받으려면 워크로드 프로세스가 실행 중이어야
# 하는 사용자의 ID입니다.
#
# 지정하지 않으면 UID가 확인되지 않습니다.
uid: 1000
# pid는 이 SVID를 받으려면 워크로드 프로세스가 가져야 하는 ID입니다.
#
# 지정하지 않으면 PID가 확인되지 않습니다.
pid: 1234
# gid는 이 SVID를 받으려면 워크로드 프로세스가 실행 중이어야
# 하는 기본 그룹의 ID입니다.
#
# 지정하지 않으면 GID가 확인되지 않습니다.
gid: 50
# name은 선택적으로 로그와 `/readyz` 엔드포인트에서 사용되는 서비스 이름을
# 재정의합니다. 문자, 숫자, 하이픈, 밑줄, 더하기 기호만 포함해야 합니다.
name: my-service-name
Envoy SDS#
spiffe-workload-api 서비스 엔드포인트는 Envoy SDS API도 구현합니다. 이를 통해 Envoy 프록시의 인증서 및 인증 기관의 소스 역할을 할 수 있습니다.
포워드 프록시로서 Envoy는 SPIFFE를 지원하지 않는 워크로드의 아웃바운드 연결에 X.509 SVID를 첨부하는 데 사용될 수 있습니다.
리버스 프록시로서 Envoy는 SPIFFE 지원 클라이언트의 mTLS 연결을 종료하는 데 사용될 수 있습니다. Envoy는 클라이언트가 유효한 X.509 SVID를 제시했는지 검증하고 SVID에 포함된 SPIFFE ID를 기반으로 권한 부여 정책을 시행할 수 있습니다.
특정 프로토콜에 대한 리버스 프록시로 작동할 때, Envoy는 요청을 서비스로 전달하기 전에 클라이언트의 신원을 나타내는 헤더를 첨부하도록 구성할 수 있습니다. 그런 다음 서비스가 클라이언트의 신원을 기반으로 권한 부여 결정을 내리는 데 사용할 수 있습니다.
spiffe-workload-api 서비스에서 노출된 SDS API를 사용하도록 Envoy를 구성할 때, 구성을 돕기 위해 세 가지 특별한 이름을 사용할 수 있습니다:
default:tbot이 워크로드의 기본 SVID를 반환합니다.ROOTCA:tbot이 워크로드가 속한 신뢰 도메인의 신뢰 번들을 반환합니다.ALL:tbot이 워크로드가 속한 신뢰 도메인의 신뢰 번들과 함께 신뢰 도메인이 페더레이션된 다른 신뢰 도메인의 신뢰 번들을 반환합니다.
다음은 unix:///opt/machine-id/workload.sock에서 수신 대기 중인 spiffe-workload-api 서비스에서 인증서와 신뢰 번들을 소싱하는 예시 Envoy 구성입니다. 연결 클라이언트가 유효한 SPIFFE SVID를 제시하도록 요구하고 이 정보를 x-forwarded-client-cert 헤더에 백엔드 서비스로 전달합니다.
node:
id: "my-envoy-proxy"
cluster: "my-cluster"
static_resources:
listeners:
- name: test_listener
enable_reuse_port: false
address:
socket_address:
address: 0.0.0.0
port_value: 8080
filter_chains:
- filters:
- name: envoy.filters.network.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
common_http_protocol_options:
idle_timeout: 1s
forward_client_cert_details: sanitize_set
set_current_client_cert_details:
uri: true
stat_prefix: ingress_http
route_config:
name: local_route
virtual_hosts:
- name: my_service
domains: ["*"]
routes:
- match:
prefix: "/"
route:
cluster: my_service
http_filters:
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
transport_socket:
name: envoy.transport_sockets.tls
typed_config:
"@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
common_tls_context:
# configure the certificate that the reverse proxy should present.
tls_certificate_sds_secret_configs:
# `name` can be replaced with the desired SPIFFE ID if multiple
# SVIDs are available.
- name: "default"
sds_config:
resource_api_version: V3
api_config_source:
api_type: GRPC
transport_api_version: V3
grpc_services:
envoy_grpc:
cluster_name: tbot_agent
# combined validation context "melds" two validation contexts
# together. This is handy for extending the validation context
# from the SDS source.
combined_validation_context:
default_validation_context:
# You can use match_typed_subject_alt_names to configure
# rules that only allow connections from specific SPIFFE IDs.
match_typed_subject_alt_names: []
validation_context_sds_secret_config:
name: "ALL" # This can also be replaced with the trust domain name
sds_config:
resource_api_version: V3
api_config_source:
api_type: GRPC
transport_api_version: V3
grpc_services:
envoy_grpc:
cluster_name: tbot_agent
clusters:
# my_service is the example service that Envoy will forward traffic to.
- name: my_service
type: strict_dns
load_assignment:
cluster_name: my_service
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 127.0.0.1
port_value: 8090
- name: tbot_agent
http2_protocol_options: {}
load_assignment:
cluster_name: tbot_agent
endpoints:
- lb_endpoints:
- endpoint:
address:
pipe:
# Configure the path to the socket that `tbot` is
# listening on.
path: /opt/machine-id/workload.sock
database-tunnel#
database-tunnel 서비스는 데이터베이스 서버로의 연결을 터널링하는 서비스를 위한 리스너를 엽니다.
터널은 클라이언트의 연결을 인증하므로, 리스너에 연결할 수 있는 모든 애플리케이션이 지정된 사용자로 데이터베이스에 연결할 수 있습니다. 이러한 이유로 Unix 소켓 리스너 유형을 사용하고 소켓의 권한을 구성하여 의도된 애플리케이션만 연결할 수 있도록 하는 것을 강력히 권장합니다.
# type은 서비스의 유형을 지정합니다. database tunnel 서비스의 경우
# 항상 `database-tunnel`입니다.
type: database-tunnel
# listen은 서비스가 수신 대기해야 하는 주소를 지정합니다.
#
# 두 가지 유형의 리스너가 지원됩니다:
# - TCP: `tcp://<address>:<port>`
# - Unix 소켓: `unix:///<path>`
listen: tcp://127.0.0.1:25432
# service는 서비스가 터널을 열어야 하는 Teleport에 구성된 데이터베이스 서버의
# 이름입니다.
service: postgres-docker
# database는 지정된 데이터베이스 서비스의 특정 데이터베이스 이름입니다.
database: postgres
# username은 터널을 열 지정된 데이터베이스 서버의 사용자 이름입니다.
username: postgres
# name은 선택적으로 로그와 `/readyz` 엔드포인트에서 사용되는 서비스 이름을
# 재정의합니다. 문자, 숫자, 하이픈, 밑줄, 더하기 기호만 포함해야 합니다.
name: my-service-name
database-tunnel 서비스는 tbot이 원샷 모드에서 실행되도록 구성된 경우 시작되지 않습니다.
application-tunnel#
application-tunnel 서비스는 Teleport의 애플리케이션으로 연결을 터널링하는 리스너를 엽니다. HTTP 및 TCP 애플리케이션을 모두 지원합니다. 이는 클라이언트 인증서를 사용하도록 구성할 수 없는 애플리케이션, TCP 애플리케이션 사용 시, 또는 Teleport 프록시 앞에 L7 로드 밸런서를 사용하는 경우 유용합니다.
터널은 클라이언트의 연결을 인증하므로, 리스너에 연결하는 모든 클라이언트가 애플리케이션에 접근할 수 있습니다. 이러한 이유로 Unix 소켓 리스너를 사용하거나 127.0.0.1에 바인딩하여 의도된 클라이언트만 리스너에 접근할 수 있도록 해야 합니다.
# type은 서비스의 유형을 지정합니다. application tunnel 서비스의 경우
# 항상 `application-tunnel`입니다.
type: application-tunnel
# listen은 서비스가 수신 대기해야 하는 주소를 지정합니다.
#
# 두 가지 유형의 리스너가 지원됩니다:
# - TCP: `tcp://<address>:<port>`
# - Unix 소켓: `unix:///<path>`
listen: tcp://127.0.0.1:8084
# app_name은 서비스가 터널을 열어야 하는 Teleport에 구성된 애플리케이션의
# 이름입니다.
app_name: my-application
# name은 선택적으로 로그와 `/readyz` 엔드포인트에서 사용되는 서비스 이름을
# 재정의합니다. 문자, 숫자, 하이픈, 밑줄, 더하기 기호만 포함해야 합니다.
name: my-service-name
application-tunnel 서비스는 tbot이 원샷 모드에서 실행되도록 구성된 경우 시작되지 않습니다.
ssh-multiplexer#
ssh-multiplexer 서비스는 고성능 로컬 SSH 멀티플렉서를 위한 리스너를 엽니다. 이는 Teleport를 사용하여 많은 수의 SSH 연결을 생성하는 사용 사례(예: Ansible)를 위해 설계되었습니다.
이는 SSH용 identity 출력 사용과 몇 가지 점에서 다릅니다:
ssh-multiplexer서비스를 실행하는tbot인스턴스는 SSH 클라이언트와 동일한 호스트에서 실행되어야 합니다.ssh-multiplexer서비스는 장기 실행 백그라운드 서비스로 설계되었으며 원샷 모드에서는 사용할 수 없습니다. SSH 연결이 설정되고 계속 실행되려면 실행 중이어야 합니다.- Teleport Proxy Service로의 더 적은 수의 업스트림 연결을 통해 SSH 연결을 멀티플렉싱하여 리소스 소비가 크게 줄어듭니다.
- Teleport Relay를 통해 SSH 서버에 연결하도록
ssh-multiplexer서비스를 구성할 수 있습니다.
또한, ssh-multiplexer는 SSH 에이전트 프로토콜을 구현하는 소켓을 엽니다. 이를 통해 SSH 클라이언트가 민감한 개인 키를 디스크에 쓰지 않고 인증할 수 있습니다.
기본적으로 ssh-multiplexer 서비스는 tbot 자체를 ProxyCommand로 사용하는 ssh_config를 출력합니다. fdpass-teleport 바이너리를 설치하고 지정하여 SSH 연결의 리소스 소비를 더 줄일 수 있습니다.
# type은 서비스의 유형을 지정합니다. SSH 멀티플렉서의 경우
type: ssh-multiplexer
# destination은 터널이 열려야 하고 아티팩트가 작성되어야 하는 위치를
# 지정합니다. `directory` 유형이어야 합니다.
destination:
type: directory
path: /foo
# enable_resumption은 멀티플렉서가 세션 재개를 협상해야 하는지 지정합니다.
# 이를 통해 SSH 연결이 네트워크 중단을 견딜 수 있습니다. 연결당 메모리
# 리소스 사용이 증가합니다.
#
# 지정하지 않으면 기본값은 true입니다.
enable_resumption: true
# proxy_command는 생성된 SSH 구성에서 ProxyCommand로 사용해야 하는
# 명령을 지정합니다.
#
# 지정하지 않으면 ProxyCommand는 현재 실행 중인 tbot 바이너리 자체가 됩니다.
proxy_command:
- /usr/local/bin/fdpass-teleport
# proxy_templates_path는 연결할 Teleport 노드를 결정할 때 사용해야 하는
# 프록시 템플릿 구성 파일의 경로를 지정합니다. 이 파일은 ssh-multiplexer를
# 실행하는 장기 실행 tbot 프로세스가 접근할 수 있어야 합니다.
#
# 지정하지 않으면 프록시 템플릿이 사용되지 않습니다.
proxy_templates_path: /etc/my-proxy-templates.yaml
# relay_server는 tbot이 Teleport 컨트롤 플레인 대신 SSH 트래픽을 라우팅하는 데
# 사용해야 하는 Relay 서비스 주소를 지정합니다. 설정하면 모든 SSH 연결이
# 이 Relay를 통해 전송됩니다; 지정된 Relay를 통해 접근 가능한 서버만 접근할
# 수 있으며 tbot은 컨트롤 플레인으로 폴백하지 않습니다. 호스트 이름 또는
# host:port를 제공하세요 (예: relay.example.com 또는 relay.example.com:443).
#
# relay_server 옵션을 사용하려면 `tbot` 18.3.0 이상이 필요합니다.
relay_server: relay.example.com
# name은 선택적으로 로그와 `/readyz` 엔드포인트에서 사용되는 서비스 이름을
# 재정의합니다. 문자, 숫자, 하이픈, 밑줄, 더하기 기호만 포함해야 합니다.
name: my-service-name
구성되면 tbot은 지정된 대상에 다음 아티팩트를 생성합니다:
ssh_config: 멀티플렉서와 에이전트를 사용하도록 OpenSSH를 구성하는 SSH 구성 파일.known_hosts: OpenSSH가 서버의 신원을 검증하는 데 사용하는 알려진 호스트 파일.v1.sock: 멀티플렉서가 수신 대기하는 Unix 소켓.agent.sock: SSH 에이전트가 수신 대기하는 Unix 소켓.
ssh-multiplexer 서비스는 tbot이 원샷 모드에서 실행되도록 구성된 경우 시작되지 않습니다.
프로그래밍 방식으로 SSH 멀티플렉서 사용#
프로그래밍 방식으로 SSH 멀티플렉서를 사용하려면 SSH 클라이언트 라이브러리가 다음 두 가지 중 하나를 지원해야 합니다:
- FDPass로 ProxyCommand를 사용하는 기능. 이 경우
tbot이 생성한ssh_config파일을 사용하여 SSH 클라이언트를 구성할 수 있습니다. - SSH 서버로의 연결로 사용할 열린 소켓을 허용하는 기능. 그런 다음 소켓에 수동으로 연결하고 멀티플렉서 요청을 보내야 합니다.
v1.sock Unix 도메인 소켓은 V1 Teleport SSH 멀티플렉서 프로토콜을 구현합니다. 클라이언트는 먼저 원하는 대상 호스트와 포트를 나타내는 짧은 요청 메시지를 null 바이트로 종료하여 보내야 합니다. 그런 다음 멀티플렉서는 대상 호스트와 포트로 트래픽을 전달하기 시작합니다. 클라이언트는 그런 다음 SSH 연결을 만들 수 있습니다.
Python(Paramiko) 예시
```python import os import paramiko import sockethost = "ubuntu.example.teleport.sh" username = "root" port = 3022 directory_destination = "/opt/machine-id"
Connect to Mux Unix Domain Socket#
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.connect(os.path.join(directory_destination, "v1.sock"))
Send the connection request specifying the server you wish to connect to#
sock.sendall(f"{host}:{port}\x00".encode("utf-8"))
We must set the env var as Paramiko does not make this configurable...#
os.environ["SSH_AUTH_SOCK"] = os.path.join(directory_destination, "agent.sock")
ssh_config = paramiko.SSHConfig() with open(os.path.join(directory_destination, "ssh_config")) as f: ssh_config.parse(f)
ssh_client = paramiko.SSHClient()
Paramiko does not support known_hosts with CAs: https://github.com/paramiko/paramiko/issues/771#
Therefore, we must disable host key checking#
ssh_client.set_missing_host_key_policy(paramiko.WarningPolicy())
ssh_client.connect( hostname=host, port=port, username=username, sock=sock )
stdin, stdout, stderr = ssh_client.exec_command("hostname") print(stdout.read().decode())
</details>
<details>
<summary>Go 예시</summary>
```go
package main
import (
"fmt"
"net"
"path/filepath"
"golang.org/x/crypto/ssh"
"golang.org/x/crypto/ssh/agent"
"golang.org/x/crypto/ssh/knownhosts"
)
func main() {
host := "ubuntu.example.teleport.sh"
username := "root"
directoryDestination := "/opt/machine-id"
// Setup Agent and Known Hosts
agentConn, err := net.Dial(
"unix", filepath.Join(directoryDestination, "agent.sock"),
)
if err != nil {
panic(err)
}
defer agentConn.Close()
agentClient := agent.NewClient(agentConn)
hostKeyCallback, err := knownhosts.New(
filepath.Join(directoryDestination, "known_hosts"),
)
if err != nil {
panic(err)
}
// Create SSH Config
sshConfig := &ssh.ClientConfig{
Auth: []ssh.AuthMethod{
ssh.PublicKeysCallback(agentClient.Signers),
},
User: username,
HostKeyCallback: hostKeyCallback,
}
// Dial Unix Domain Socket and send multiplexing request
conn, err := net.Dial(
"unix", filepath.Join(directoryDestination, "v1.sock"),
)
if err != nil {
panic(err)
}
defer conn.Close()
_, err = fmt.Fprint(conn, fmt.Sprintf("%s:0\x00", host))
if err != nil {
panic(err)
}
sshConn, sshChan, sshReq, err := ssh.NewClientConn(
conn,
// Port here doesn't matter because Multiplexer has already established
// connection.
fmt.Sprintf("%s:22", host),
sshConfig,
)
if err != nil {
panic(err)
}
sshClient := ssh.NewClient(sshConn, sshChan, sshReq)
defer sshClient.Close()
sshSess, err := sshClient.NewSession()
if err != nil {
panic(err)
}
defer sshSess.Close()
out, err := sshSess.CombinedOutput("hostname")
if err != nil {
panic(err)
}
fmt.Println(string(out))
}
application-proxy#
application-proxy 서비스는 Teleport에 등록된 HTTP 애플리케이션으로 요청을 전달하는 HTTP 프록시를 제공하는 리스너를 엽니다. 클라이언트를 대신하여 업스트림 연결에 필요한 클라이언트 인증서를 첨부하는 프로세스를 처리합니다.
특정 애플리케이션에 명시적으로 바인딩되는 application-tunnel 서비스와 달리, application-proxy 서비스는 요청을 올바른 애플리케이션으로 동적으로 라우팅합니다. 이는 클라이언트가 Teleport에 등록된 많은 애플리케이션에 연결해야 하는 사용 사례(예: Teleport를 통해 Prometheus 메트릭 엔드포인트를 스크레이핑하는 경우)에 더 적합합니다.
프록시는 클라이언트의 연결을 인증하므로, 리스너에 연결하는 모든 클라이언트가 Teleport를 통해 애플리케이션에 접근할 수 있습니다. 이러한 이유로 Unix 소켓 리스너를 사용하거나 127.0.0.1에 바인딩하여 의도된 클라이언트만 리스너에 접근할 수 있도록 해야 합니다.
# type은 서비스의 유형을 지정합니다. application proxy 서비스의 경우
# 항상 `application-proxy`입니다.
type: application-proxy
# listen은 서비스가 수신 대기해야 하는 주소를 지정합니다.
#
# 두 가지 유형의 리스너가 지원됩니다:
# - TCP: `tcp://<address>:<port>`
# - Unix 소켓: `unix:///<path>`
listen: tcp://127.0.0.1:8080
# name은 선택적으로 로그와 `/readyz` 엔드포인트에서 사용되는 서비스 이름을
# 재정의합니다. 문자, 숫자, 하이픈, 밑줄, 더하기 기호만 포함해야 합니다.
name: my-service-name
application-proxy 서비스는 tbot이 원샷 모드에서 실행되도록 구성된 경우 시작되지 않습니다.
제한 사항#
application-proxy의 초기 구현에는 알아야 할 여러 제한 사항이 있습니다:
- HTTP 애플리케이션만 지원됩니다. TCP 애플리케이션은 현재 지원되지 않습니다.
- HTTP/1 및 HTTP/1.1만 지원됩니다. HTTP/2는 현재 지원되지 않습니다.
이러한 제한이 문제가 된다면 대신 application-tunnel 서비스를 사용하거나 Teleport 팀에 연락하여 사용 사례를 논의하세요.
애플리케이션 프록시 사용#
application-proxy 서비스에 의해 노출된 리스너는 광범위한 HTTP 클라이언트 및 라이브러리와 호환됩니다. 구성 방법은 사용 중인 클라이언트 또는 라이브러리에 따라 다릅니다. 많은 클라이언트에서 http_proxy 환경 변수를 사용하여 가능합니다.
application-proxy를 사용할 때, 요청의 Host 헤더 또는 대상 URI 내의 권한이 Teleport 내에 등록된 애플리케이션의 이름과 일치해야 합니다.
예를 들어, curl을 사용하여 Teleport에 등록된 my-app이라는 HTTP 애플리케이션에 접근하려면:
curl --proxy localhost:8080 http://my-app/example
대상#
대상은 tbot이 아티팩트를 읽고 쓸 수 있는 위치입니다.
대상은 tbot 구성의 두 곳에서 사용됩니다:
tbot이 내부 상태를 저장해야 하는 위치 지정.- 출력이 생성된 아티팩트를 작성해야 하는 위치 지정.
대상은 여러 유형으로 제공됩니다. 일반적으로 directory 유형이 가장 적합합니다.
directory#
directory 대상 유형은 아티팩트를 지정된 디렉터리에 파일로 저장합니다.
# type은 대상의 유형을 지정합니다. directory 대상의 경우 항상 `directory`입니다.
type: directory
# path는 이 대상이 쓸 디렉터리의 경로를 지정합니다. 이 디렉터리는 이미
# 존재해야 하거나, `tbot init`을 사용하여 올바른 권한으로 생성해야 합니다.
path: /opt/machine-id
# symlinks는 심볼릭 링크 공격 방지의 동작을 구성합니다.
# Linux 5.6+ 필요.
# 지원되는 값:
# * try-secure (기본값): 심볼릭 링크 없이 인증서를 안전하게 읽고 쓰려고
# 시도하지만, 호스트가 이를 지원하지 않으면 안전하지 않은 읽기 및 쓰기로
# (경고와 함께) 폴백합니다.
# * secure: 인증서를 안전하게 읽고 쓰려고 시도하며, 지원되지 않으면
# 하드 오류를 발생시킵니다.
# * insecure: 경로의 심볼릭 링크를 조용히 허용합니다.
symlinks: try-secure
# acls는 이 대상에 대해 Linux 접근 제어 목록(ACL) 설정을 수행해야 하는지
# 구성합니다.
# ACL을 지원하는 파일시스템을 갖춘 Linux 필요.
# 지원되는 값:
# * try (Linux의 기본값): ACL 사용을 시도하고, ACL이 구성되었지만 유효하지
# 않은 경우 런타임에 경고합니다.
# * off (비-Linux의 기본값): ACL 사용을 시도하지 않습니다.
# * required: 항상 ACL을 사용하고, ACL이 유효하지 않은 경우 런타임에
# 하드 오류를 발생시킵니다.
acls: try
# readers는 ACL에 의해 이 디렉터리 출력에 접근할 수 있는 사용자 및 그룹의
# 목록입니다. `acls` 매개변수는 `try` 또는 `required`여야 합니다. 파일 ACL은
# 런타임에 이 구성과 일치하도록 모니터링되고 수정됩니다.
# 개별 항목은 `user` 또는 `group`을 지정할 수 있지만 둘 다 지정할 수 없습니다.
# `user`는 기존 명명된 사용자 또는 UID를 허용하며, `group`은 기존 명명된
# 그룹 또는 GID를 허용합니다. UID 및 GID는 반드시 로컬 시스템에 존재할
# 필요는 없습니다.
# 비어 있는 readers 목록은 런타임 ACL 관리를 비활성화합니다.
readers:
- user: teleport
- user: 123
- group: teleport
- group: 456
memory#
memory 대상 유형은 아티팩트를 프로세스 메모리에 저장합니다. 프로세스가 종료되면 아무것도 지속되지 않습니다. 이 대상 유형은 일시적 환경에 가장 적합하지만 테스트에도 사용할 수 있습니다.
구성:
# type은 대상의 유형을 지정합니다. memory 대상의 경우 항상 `memory`입니다.
type: memory
kubernetes_secret#
kubernetes_secret 대상 유형은 아티팩트를 Kubernetes 시크릿에 저장합니다. 이를 통해 Kubernetes에 배포된 다른 컨테이너에 마운트할 수 있습니다.
시크릿이 이미 존재할 필요는 없으며, 존재하지 않으면 생성됩니다. 시크릿이 이미 존재하는 경우 tbot은 시크릿 내의 다른 키를 덮어씁니다.
기본적으로 kubernetes_secret 대상은 tbot 자체가 실행 중인 Kubernetes 클러스터에 대해 작동합니다. 이 모드에서는 구성이 거의 필요하지 않습니다. 그러나 다음을 확인해야 합니다:
tbot이 최대 하나의 복제본으로 Kubernetes에서 실행 중이어야 합니다.deployment를 사용하는 경우 한 번에 하나의 인스턴스만 존재하도록Recreate전략을 사용해야 합니다. 동일한 시크릿으로 구성된 여러tbot에이전트가 시크릿 쓰기를 위해 경쟁하여 일관성 없는 상태로 남거나tbot에이전트가 쓰기에 실패할 수 있기 때문입니다.tbot파드가 구성된 시크릿에서 읽고 쓸 수 있도록 하는 서비스 계정으로 구성되어야 합니다.POD_NAMESPACE환경 변수가tbot이 실행 중인 네임스페이스의 이름으로 구성되어야 합니다. 이는 Downward API를 사용하여 가장 잘 달성됩니다.
이러한 모든 요구 사항이 충족되도록 하는 가장 쉬운 방법은 tbot Helm 차트를 사용하는 것입니다.
tbot이 실행 중이지 않은 Kubernetes 클러스터의 시크릿에 쓰는 것도 가능합니다. 다른 Kubernetes 클러스터에서 실행 중이거나 Kubernetes 클러스터 외부에서 완전히 실행 중일 수 있습니다. 이를 구성하려면:
kubeconfig_path를tbot이 Kubernetes 클러스터에 연결하고 인증하는 데 필요한 구성이 포함된 kubeconfig 파일 경로로 설정하세요.- kubeconfig 파일에 여러 컨텍스트가 포함된 경우,
kubeconfig_context를 사용하여 원하는 컨텍스트를 선택하세요. 설정하지 않으면 기본 컨텍스트가 사용됩니다. namespace를 시크릿을 작성해야 하는 네임스페이스로 설정하세요.
구성:
# type은 대상의 유형을 지정합니다. kubernetes_secret 대상의 경우
# 항상 `kubernetes_secret`입니다.
type: kubernetes_secret
# name은 아티팩트를 작성할 Kubernetes 시크릿의 이름을 지정합니다.
name: my-secret
# namespace는 시크릿을 작성할 Kubernetes 네임스페이스를 지정합니다.
# 지정하지 않으면 `POD_NAMESPACE` 환경 변수의 값이 기본값입니다.
#
# Helm 차트를 사용하고 `tbot`이 실행 중인 네임스페이스가 아닌 다른
# 네임스페이스를 지정하는 경우, 해당 네임스페이스의 시크릿에 읽고 쓸
# 수 있는 권한을 `tbot` 서비스 계정에 수동으로 부여해야 합니다.
namespace: default
# labels는 Kubernetes 시크릿에 적용할 레이블을 지정합니다. 이 필드는
# 선택 사항입니다.
labels:
example: "foo"
# kubeconfig_path는 Kubernetes API 서버에 연결하고 인증하는 데 사용할
# kubeconfig 경로입니다. Kubernetes 클러스터 내부에서 tbot을 실행할 때는
# 인클러스터 자격 증명을 사용할 수 있으므로 이를 구성할 필요가 없습니다.
#
# 이는 Kubernetes 클러스터 외부에서 tbot을 실행하거나 tbot이 실행 중인
# 것과 다른 Kubernetes 클러스터에 시크릿을 작성해야 할 때 유용합니다.
#
# KUBECONFIG 환경 변수를 사용하여 설정할 수도 있습니다. 구성 파일 내의
# 값이 환경 변수보다 우선합니다.
kubeconfig_path: /opt/kube.yaml
# kubeconfig_context는 kubeconfig에서 사용할 컨텍스트를 재정의합니다.
#
# 기본 인클러스터 구성에 의존할 때는 효과가 없으며 KUBECONFIG 환경 변수
# 또는 `kubeconfig_path` 필드가 설정된 경우에만 사용할 수 있습니다.
#
# 지정하지 않으면 Kubernetes 구성 파일에 현재 설정된 컨텍스트가 사용됩니다.
kubeconfig_context: my-cluster
Bot 리소스#
bot 리소스는 머신 및 워크로드 아이덴티티 Bot을 관리하는 데 사용됩니다. Bot에 부여된 접근을 구성하는 데 사용됩니다.
kind: bot
version: v1
metadata:
# name is a unique identifier for the bot in the cluster.
name: robot
spec:
# roles is a list of roles that the bot should be able to generate credentials
# for.
roles:
- editor
# traits controls the traits applied to the Bot user. These are fed into the
# role templating system and can be used to grant a specific Bot access to
# specific resources without the creation of a new role.
traits:
- name: logins
values:
- root
tctl create -f ./bot.yaml을 사용하여 bot 리소스를 정의하는 YAML이 포함된 파일을 적용할 수 있습니다.
