Oracle Cloud로 서비스 조인
Teleport v18.9이 가이드에서는 Oracle 조인 방법을 사용하여 Oracle Cloud Infrastructure (OCI) Compute 인스턴스에서 실행 중일 때 시크릿을 공유하지 않고 Teleport 프로세스가 Teleport 클러스터에 조인하도록 구성하는 방법을 설명합니다.
이 가이드에서는 Oracle 조인 방법을 사용하여 Oracle Cloud Infrastructure (OCI) Compute 인스턴스에서 실행 중일 때 시크릿을 공유하지 않고 Teleport 프로세스가 Teleport 클러스터에 조인하도록 구성하는 방법을 설명합니다.
작동 방식#
Oracle 조인 방법은 OCI Compute 인스턴스에서 실행 중인 모든 Teleport 프로세스에서 사용할 수 있습니다.
내부적으로 서비스는 서명된 OCI 인스턴스 신원 인증서와 인스턴스의 개인 키 소유권을 증명하는 암호화 서명을 Auth Service에 전송하여 OCI 테넌트에서 실행 중임을 증명합니다. Auth Service는 인스턴스 신원 인증서가 Oracle의 루트 CA에 의해 서명되었는지와 서명이 유효한지를 확인합니다. 인증서는 인스턴스의 테넌시, 컴파트먼트, 인스턴스 ID를 확인하고 Oracle 조인 토큰에 구성된 규칙과 대조합니다.
Teleport v18.4.0보다 오래된 버전을 실행하는 인스턴스는 인스턴스 신원 인증서를 전송하지 않으며, 대신 Auth Service가 실행할 OCI API에 대해 사전 서명된 자기 인증 요청을 전송합니다.
사전 요구 사항#
-
실행 중인 Teleport (v17.3.0 or higher) 클러스터. 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 서비스를 호스팅할 OCI Compute 인스턴스.
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단계. Oracle 조인 토큰 생성#
OCI 테넌트의 서비스가 Teleport 클러스터에 조인할 수 있도록 하는 특수 동적 토큰으로 Teleport Auth Service를 구성합니다.
OCI Compute 인스턴스가 실행될 Oracle 테넌트, 컴파트먼트, 리전을 지정하는 oracle.allow 규칙을 포함하여 다음 token.yaml 파일을 생성합니다.
Teleport v18.4.0 이상에서는 허용될 정확한 compute 인스턴스 OCID도 지정할 수 있습니다.
# token.yaml
kind: token
version: v2
metadata:
# The token name is not a secret because instances must prove that they are
# running in your Oracle tenant to use this token.
name: oracle-token
spec:
# Use the minimal set of roles required (e.g. Node, Proxy, App, Kube, DB, WindowsDesktop).
roles: [Node]
# Set the join method allowed for this token.
join_method: oracle
oracle:
allow:
# OCID of the tenancy to allow instances to join from. Required.
- tenancy: "ocid1.tenancy.oc1..<unique_ID>"
# (Optional) OCIDs of compartments to allow instances to join from. Only the direct parent
# compartment applies; i.e. nested compartments are not taken into account.
# If empty, instances can join from any compartment in the tenancy.
parent_compartments: ["ocid1.compartment.oc1..<unique_ID>"]
# (Optional) Regions to allow instances to join from. Both full names ("us-phoenix-1")
# and abbreviations ("phx") are allowed. If empty, instances can join from any region.
regions: ["example-region"]
# (Optional) OCIDs of specific compute instances that should be allowed to join.
# If empty, any instance matching the other fields is allowed.
# The instances field is supported in Teleport v18.4.0+.
instances: ["ocid1.instance.oc1.<region>.<unique_ID>"]
토큰을 생성하는 다음 명령을 실행합니다:
$ tctl create token.yaml
2단계/5단계. 권한 구성#
v18.4.0보다 오래된 Teleport 버전에서는 모든 OCI compute 인스턴스가 Oracle Cloud API로 자신을 인증하기 위한 IAM 권한이 필요합니다. 최신 Teleport 버전에서는 권한이 필요하지 않습니다. Auth Service 또는 조인하는 인스턴스 중 하나라도 v18.4.0보다 오래된 Teleport 버전을 실행하는 경우에만 권한이 필요합니다.
OCI IAM 권한 구성
동적 그룹 생성#
OCI 콘솔에서
Identity/Domains로 이동합니다.
현재 활성 도메인을 선택한 다음 Dynamic groups를 선택합니다. Create dynamic group을 클릭합니다. 다음 일치 규칙으로 그룹을 생성하고,
compartment-id에 인스턴스가 있는 컴파트먼트의 OCID를 지정합니다:
Any {instance.compartment.id = 'compartment-id'}

불필요한 권한을 최소화하려면 1단계에서 생성한 토큰의 규칙과 일치하도록 일치 규칙을 구성하세요.
그룹에 정책 추가#
OCI 콘솔에서
Identity/Domains/Policy로 이동합니다.
Create Policy를 클릭합니다. 다음 정책을 생성하고,
identity-domain에 선택한 신원 도메인의 이름을 지정합니다:
Allow dynamic-group 'identity-domain'/'join-teleport' to inspect authentication in tenancy

3단계/5단계. Teleport 설치#
OCI Compute 인스턴스에 Teleport를 설치합니다.
Linux 서버에 Teleport Agent를 설치하려면:
권장 설치 방법은 클러스터 설치 스크립트입니다. 이 스크립트는 클러스터에 맞는 올바른 버전, 에디션, 설치 모드를 선택합니다.
-
teleport.example.com:443에 Teleport 클러스터의 호스트명과 포트를 할당하되, 스킴(https://)은 포함하지 마십시오. -
클러스터의 설치 스크립트를 실행하십시오:
$ curl "https://teleport.example.com:443/scripts/install.sh" | sudo bash
4단계/5단계. 서비스 구성#
Oracle 조인 방법은 SSH (Node), Proxy, Kubernetes, Application, Database, 또는 Windows Desktop Services를 실행하는 Teleport 프로세스에서 사용할 수 있습니다. Teleport 프로세스는 OCI Compute 인스턴스에서 직접 실행되어야 합니다.
사용자 정의 teleport.yaml 파일로 Teleport 프로세스를 구성합니다. 1단계에서 생성한 토큰과 일치하는 token_name과 method: oracle을 포함한 join_params 섹션을 다음 예시 구성과 같이 사용합니다:
# /etc/teleport.yaml
version: v3
teleport:
join_params:
token_name: oracle-token
method: oracle
proxy_server: https://teleport.example.com:443
ssh_service:
enabled: true
auth_service:
enabled: false
proxy_service:
enabled: false
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를 시작한 후 서비스가 클러스터에 연결하고 조인할 수 있는지 확인합니다.
문제 해결#
oci api error: Not Found 오류로 조인 실패#
이 오류는 인스턴스에 필요한 권한이 없음을 의미할 수 있습니다. 동적 그룹을 생성한 신원 도메인에 Compute 서비스가 활성화되어 있는지 확인하세요. 활성화되어 있지 않으면 해당 서비스가 있는 도메인에서 그룹을 생성해 보세요.