세션별 MFA
Teleport는 새로운 세션 시작 시 추가 다중 인증 검사를 요구하는 것을 지원합니다: 이것은 사람 사용자의 디스크 상의 Teleport 인증서 침해로부터 보호하는 고급 보안 기능입니다. 세션별 MFA 검사는 webauthn 장치로 충족하거나 MFA 검사를 IdP에 위임하여 충족할 수 있습니다.
Teleport는 새로운 세션 시작 시 추가 다중 인증 검사를 요구하는 것을 지원합니다:
- SSH 연결 (단일
tsh ssh호출, 웹 UI SSH 세션 또는 Teleport Connect SSH 세션) - Kubernetes 세션 (단일
kubectl호출 또는 단일tsh proxy kube실행) - 데이터베이스 세션 (단일
tsh db connect호출, 단일tsh db exec호출 또는 단일tsh proxy db --tunnel실행) - 애플리케이션 세션
- 데스크톱 세션
이것은 사람 사용자의 디스크 상의 Teleport 인증서 침해로부터 보호하는 고급 보안 기능입니다.
세션별 MFA 검사는 webauthn 장치로 충족하거나 MFA 검사를 IdP에 위임하여 충족할 수 있습니다.
세션별 MFA 외에도 SSO 공급자 및/또는 모든 로컬 Teleport 사용자에 대해 로그인 MFA를 활성화하여 보안을 강화하세요.
사전 요구 사항#
-
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.
- 이 클러스터에서 WebAuthn이 구성됨
- YubiKey 또는 SoloKey와 같은 다중 인증용 하드웨어 장치
- Teleport 웹 UI에서 SSH 또는 데스크톱 세션을 사용하는 경우 WebAuthn 지원이 있는 웹 브라우저
세션별 MFA 구성#
세션별 MFA는 클러스터 전체 또는 일부 특정 역할에 대해서만 적용할 수 있습니다.
클러스터 전체#
모든 역할에 대해 MFA 검사를 적용하려면 클러스터 인증 구성을 편집합니다.
cluster_auth_preference 리소스를 편집합니다:
$ tctl edit cap
리소스에 다음 내용이 포함되어 있는지 확인합니다:
kind: cluster_auth_preference
metadata:
name: cluster-auth-preference
spec:
require_session_mfa: true
version: v2
편집기에서 파일을 저장하고 닫아 변경 사항을 적용합니다.
역할별#
특정 역할에 대해 MFA 검사를 적용하려면 역할을 업데이트하여 다음을 포함합니다:
kind: role
version: v7
metadata:
name: example-role-with-mfa
spec:
options:
# require per-session MFA for this role
require_session_mfa: true
allow:
...
deny:
...
역할별 적용은 역할의 allow 섹션과 일치하는 리소스에 접근할 때만 적용됩니다.
역할 예제#
역할에 대한 세션별 MFA 검사 설정 예제를 살펴보겠습니다.
Jerry는 회사 인프라에 접근할 수 있는 엔지니어입니다. 인프라는 개발 환경과 프로덕션 환경으로 나뉩니다. 보안 엔지니어 Olga는 프로덕션 서버 접근 시 MFA 검사를 적용하고 싶습니다. 개발 서버는 엔지니어의 마찰을 줄이기 위해 이를 요구하지 않습니다.
Olga는 두 가지 Teleport 역할을 정의합니다: access-dev와 access-prod:
# access-dev.yaml
kind: role
version: v7
metadata:
name: access-dev
spec:
allow:
node_labels:
env: dev
logins:
- jerry
---
# access-prod.yaml
kind: role
version: v7
metadata:
name: access-prod
spec:
options:
# require per-session MFA for production access
require_session_mfa: true
allow:
node_labels:
env: prod
logins:
- jerry
deny: {}
Olga는 Jerry를 포함한 모든 엔지니어에게 두 역할을 할당합니다.
Jerry가 로그인 jerry로 노드 dev1.example.com(레이블 env: dev 포함)에 로그인하면 특별한 일이 발생하지 않습니다:
$ tsh ssh jerry@dev1.example.com
# jerry@dev1.example.com >
하지만 Jerry가 로그인 jerry로 노드 rod3.example.com(레이블 env: prod 포함)에 로그인하면 MFA 검사를 요청받습니다:
$ tsh ssh jerry@prod3.example.com
# Tap any security key <tap>
# jerry@prod3.example.com >
세션별 MFA가 클러스터 전체에서 활성화된 경우 Jerry는 dev1.example.com에 로그인할 때도 MFA를 요청받습니다.
데이터베이스 접근에 대한 세션별 MFA#
Teleport 데이터베이스 서비스는 연결별 MFA를 지원합니다. Jerry가 데이터베이스 prod-mysql-instance(레이블 env: prod 포함)에 연결하면 각 tsh db connect 또는 tsh proxy db 호출마다 MFA 검사를 요청받습니다:
$ tsh db connect prod-mysql-instance
# Tap any security key
# Welcome to the MySQL monitor. Commands end with ; or \g.
# Your MySQL connection id is 10002
# Server version: 8.0.0-Teleport (Ubuntu)
#
# Copyright (c) 2000, 2021, Oracle and/or its affiliates.
#
# Oracle is a registered trademark of Oracle Corporation and/or its
# affiliates. Other names may be trademarks of their respective
# owners.
#
# Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
#
# mysql>
Jerry는 tsh db exec 명령을 사용하여 단일 MFA 검사로 여러 데이터베이스에 대해 쿼리를 실행할 수도 있습니다:
$ tsh db exec "select 1" --labels env=prod --db-user teleport-user --output-dir=logs
Searching databases ...
Found 2 database(s):
Name Description Protocol Labels
--------------------- ----------- -------- --------
prod-mysql-instance-1 mysql env=prod
prod-mysql-instance-2 mysql env=prod
Do you want to proceed with 2 database(s)? [y/N]: y
Executing command for "prod-mysql-instance-1". Output will be saved at "logs/prod-mysql-instance-1.output".
MFA is required to access Database "prod-mysql-instance-1"
Tap any security key
Detected security key tap
Executing command for "prod-mysql-instance-2". Output will be saved at "logs/prod-mysql-instance-2.output".
Summary: 2 of 2 succeeded.
Summary is saved at "logs/summary.json".
각 MFA 검사는 최대 5분 동안 유효합니다. 5분 창이 지나면 새 연결에 대해 새 MFA 검사가 요청됩니다.
Jerry가 자주 반복되는 MFA 인증을 피하고 싶다면 tsh proxy db --tunnel 명령을 사용하여 로컬 프록시 터널을 시작할 수 있습니다. 그러면 터널을 설정할 때만 MFA를 수행하면 됩니다.
$ tsh proxy db --tunnel prod-postgres-instance --db-user=my-prod-user --db-name=my-prod-db
Started authenticated tunnel for the PostgreSQL database "prod-postgres-instance" in cluster "example.com" on 127.0.0.1:65282.
To avoid port randomization, you can choose the listening port using the --port flag.
Teleport Connect is a desktop app that can manage database proxies for you.
Learn more at https://goteleport.com/docs/connect-your-client/teleport-connect/#connecting-to-a-database
Use the following command to connect to the database or to the address above using other database GUI/CLI clients:
$ psql postgres://my-prod-user@localhost:65282/my-prod-db
MFA is required to access Database "prod-postgres-instance"
Available MFA methods [WEBAUTHN, BROWSER]. Continuing with WEBAUTHN.
If you wish to perform MFA with another method, specify with flag --mfa-mode=<webauthn,browser> or environment variable TELEPORT_MFA_MODE=<webauthn,browser>.
Tap any security key <tap>
Detected security key tap
tsh proxy db는 이제 데이터베이스에 연결하는 데 사용할 수 있는 명령을 출력합니다. Jerry는 이후 연결에서 MFA 없이 데이터베이스에 접속할 수 있습니다:
$ psql postgres://my-prod-user@localhost:65282/my-prod-db
psql (17.5)
Type "help" for help.
my-prod-db=#
Kubernetes 접근에 대한 세션별 MFA#
세션별 MFA가 필요한 경우 Jerry가 실행하는 각 kubectl 명령에서 MFA 장치를 사용한 확인이 필요합니다.
$ tsh kube login prod-kube-cluster
Logged into Kubernetes cluster "prod-kube-cluster". Try 'kubectl version' to test the connection.
$ kubectl version
MFA is required to access Kubernetes cluster "prod-kube-cluster"
Available MFA methods [WEBAUTHN, BROWSER]. Continuing with WEBAUTHN.
If you wish to perform MFA with another method, specify with flag --mfa-mode=<webauthn,browser> or environment variable TELEPORT_MFA_MODE=<webauthn,browser>.
Tap any security key <tap>
Detected security key tap
Client Version: v1.34.1
Kustomize Version: v5.7.1
Server Version: v1.35.0
명령마다 확인하는 것이 번거로워지면 Jerry는 로컬 프록시를 시작할 수 있습니다. 그러면 모든 명령을 확인할 필요 없이 프록시 자체에서 MFA 확인이 요구됩니다.
$ tsh proxy kube --exec
Preparing the following Teleport Kubernetes clusters from the default kubeconfig:
Teleport Cluster Name Kube Cluster Name Context Name
--------------------- ----------------- -----------------------------
example.com prod-kube-cluster example.com-prod-kube-cluster
MFA is required to access Kubernetes cluster "prod-kube-cluster"
Available MFA methods [WEBAUTHN, BROWSER]. Continuing with WEBAUTHN.
If you wish to perform MFA with another method, specify with flag --mfa-mode=<webauthn,browser> or environment variable TELEPORT_MFA_MODE=<webauthn,browser>.
Tap any security key <tap>
Detected security key tap
Started local proxy for Kubernetes Access in the background.
Warning! Teleport will initiate a new shell configured with kubectl for local proxy access.
To conclude the session, simply use the "exit" command. Upon exiting, your original shell will be restored,
the local proxy will be closed, and future access through this headless session won't be possible.
Try issuing a command, for example "kubectl version".
tsh proxy kube --exec 명령은 MFA 인증을 수행하고 지정된 클러스터에 kubectl로 접근하도록 구성된 셸을 엽니다. Jerry는 이제 추가 MFA 없이 이 명령을 실행할 수 있습니다:
$ kubectl version
Client Version: v1.34.1
Kustomize Version: v5.7.1
Server Version: v1.35.0
kubectl 호출은 로컬 프록시가 제공하는 이미 인증된 연결을 사용합니다.
제한 사항#
이 기능의 현재 제한 사항:
- OpenSSH 클라이언트(
ssh,scp)를 사용할 때 세션별 MFA는 VNet SSH를 사용해야 합니다. - Kubernetes의 경우
kubectl만 세션별 WebAuthn 인증을 지원합니다. - VNet을 통해 다중 포트 TCP 애플리케이션에 접근할 때 각 포트의 첫 번째 연결이 MFA 검사를 트리거합니다.
tsh db exec명령의 경우 WebAuthn 장치만 지원됩니다.
