Teleport로 웹 애플리케이션 보호하기
이 튜토리얼은 Teleport를 통해 애플리케이션에 대한 보안 접근을 구성하는 방법을 보여줍니다. 전반적으로, 애플리케이션에 대한 접근 구성에는 다음 단계가 포함됩니다: 이 가이드에서 설명하는 설정에서 Teleport Application Service는 보안 토큰으로 Teleport 클러스터에 참여합니다.
이 튜토리얼은 Teleport를 통해 애플리케이션에 대한 보안 접근을 구성하는 방법을 보여줍니다. 이 튜토리얼은 Docker 컨테이너나 Kubernetes 클러스터에서 추가 구성 없이 간단하게 설치하고 실행할 수 있기 때문에 Grafana를 샘플 애플리케이션으로 사용합니다. 다른 웹 애플리케이션에 대한 접근을 구성하려면 이 튜토리얼을 일반 가이드로 활용할 수 있습니다.
전반적으로, 애플리케이션에 대한 접근 구성에는 다음 단계가 포함됩니다:
- 환경이 사전 요구 사항을 충족하는지 확인합니다.
- Docker 컨테이너, Kubernetes 클러스터, 또는 다른 방법으로 애플리케이션을 실행할 수 있는지 확인합니다.
- 애플리케이션이 Teleport 클러스터에 참여할 수 있도록 단기 초대 토큰을 생성합니다.
- 애플리케이션 호스트에 Teleport를 설치하고 구성합니다.
- 애플리케이션 접근을 검증하기 위한 사용자를 추가합니다.
작동 원리#
이 가이드에서 설명하는 설정에서 Teleport Application Service는 보안 토큰으로 Teleport 클러스터에 참여합니다. 구성 파일을 사용하여 웹 애플리케이션을 보호하도록 Application Service를 구성합니다. Application Service가 클러스터에 참여한 후, Teleport Proxy Service는 최종 사용자의 요청을 Teleport Application Service로 라우팅하고, Application Service의 응답을 최종 사용자에게 다시 전달합니다.
Application Service는 Teleport Auth Service에서 관리하는 CA에 대해 요청의 JSON 웹 토큰(JWT)을 검증함으로써 사용자 요청을 인증합니다. 요청하는 사용자의 역할이 JWT에 인코딩되어 있어, Application Service가 사용자에게 Teleport로 보호된 애플리케이션에 요청할 권한이 있는지 확인할 수 있습니다.
사전 요구 사항#
이 튜토리얼을 위해 환경이 다음 요구 사항을 충족하는지 확인하십시오:
-
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.
- Teleport Application Service를 실행할 호스트.
- Grafana를 실행할 Docker 컨테이너 또는 Kubernetes 클러스터.
서브도메인과 애플리케이션#
Once the Teleport Application Service is proxying traffic to your web application, the Teleport Proxy Service makes the application available at the following URL:
https://
You can check the status of the Teleport Application Service with systemctl status teleport
and view its logs with journalctl -fu teleport.
