Oracle Cloud로 서비스 조인
이 가이드에서는 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에 대해 사전 서명된 자기 인증 요청을 전송합니다.
사전 요구 사항#
-
A running Teleport (v17.3.0 or higher) 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:
-
- Teleport 서비스를 호스팅할 OCI Compute 인스턴스.
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.
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을 클릭합니다. 다음 일치 규칙으로 그룹을 생성하고, 에 인스턴스가 있는 컴파트먼트의 OCID를 지정합니다:
Any {instance.compartment.id = ''}

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

3단계/5단계. Teleport 설치#
OCI Compute 인스턴스에 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
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 프로세스 시작#
Configure your Teleport instance to start automatically when the host boots up by creating a systemd service for it. The instructions depend on how you installed your Teleport instance.
You can check the status of your Teleport instance with systemctl status teleport
and view its logs with journalctl -fu teleport.
Teleport를 시작한 후 서비스가 클러스터에 연결하고 조인할 수 있는지 확인합니다.
문제 해결#
oci api error: Not Found 오류로 조인 실패#
이 오류는 인스턴스에 필요한 권한이 없음을 의미할 수 있습니다. 동적 그룹을 생성한 신원 도메인에 Compute 서비스가 활성화되어 있는지 확인하세요. 활성화되어 있지 않으면 해당 서비스가 있는 도메인에서 그룹을 생성해 보세요.
