InfoGrab Docs

세션 및 아이덴티티 잠금

요약

시스템 관리자는 침해된 사용자나 Teleport 에이전트를 비활성화하거나, 클러스터 유지보수 중 접근을 방지하기 위해 세션, 사용자 또는 호스트 아이덴티티에 잠금을 설정할 수 있습니다. Teleport는 새 API 요청을 거부하고 잠금의 대상과 일치하는 SSH, 애플리케이션, 데이터베이스, 데스크톱, Kubernetes 세션에 대한 활성 연결을 종료합니다.

시스템 관리자는 침해된 사용자나 Teleport 에이전트를 비활성화하거나, 클러스터 유지보수 중 접근을 방지하기 위해 세션, 사용자 또는 호스트 아이덴티티에 잠금을 설정할 수 있습니다.

Teleport는 새 API 요청을 거부하고 잠금의 대상과 일치하는 SSH, 애플리케이션, 데이터베이스, 데스크톱, Kubernetes 세션에 대한 활성 연결을 종료합니다.

잠금은 다음 객체 또는 속성을 대상으로 할 수 있습니다:

  • 사용자 이름으로 Teleport 사용자
  • 역할 이름으로 Teleport RBAC 역할
  • 디바이스 ID로 Teleport 신뢰 디바이스
  • 디바이스의 UUID로 MFA 디바이스
  • OS/UNIX 로그인
  • 에이전트의 서버 UUID로 Teleport 에이전트 (클러스터에서 효과적으로 등록 해제됨)
  • 데스크톱 이름으로 Windows 데스크톱
  • UUID로 접근 요청
  • 봇 인스턴스 ID (머신 및 워크로드 아이덴티티 봇)
  • 조인 토큰 이름 (위임된 조인 방법을 사용하는 머신 및 워크로드 아이덴티티 봇)

작동 방식#

잠금은 Teleport Auth Service 백엔드에 저장된 동적 Teleport 리소스입니다. Teleport 서비스는 잠금 생성과 관련된 Auth Service 이벤트를 구독하는 잠금 감시자를 구현합니다. 이러한 서비스가 잠금이 생성되거나 수정되었다는 알림을 받으면, 잠긴 사용자의 접근 방지와 같은 다양한 작업을 방지하는 보호 조치를 취합니다.

사전 조건#

  • 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 tctl and tsh clients.

    Installing `tctl` and `tsh` clients
    1. Determine the version of your Teleport cluster. The tctl and tsh clients must be at most one major version behind your Teleport cluster version. Send a GET request to the Proxy Service at /v1/webapi/find and 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')"
      
    2. Follow the instructions for your platform to install tctl and tsh clients:

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단계/2단계. 잠금 만들기#

tctl lock 명령으로 새 잠금을 만들 수 있습니다. 다음 옵션 중 하나로 잠금 대상을 지정합니다:

$ tctl lock --user=foo@example.com --message="Suspicious activity." --ttl=10h
# Created a lock with name "dc7cee9d-fe5e-4534-a90d-db770f0234a1".

대상 역할과 일치하는 역할이 할당된 모든 사용자가 잠깁니다.

$ tctl lock --role=contractor --message="All contractor access is disabled for 10h." --ttl=10h
# Created a lock with name "dc7cee9d-fe5e-4534-a90d-db770f0234a1".

디바이스 ID와 일치하는 디바이스에서 시작된 모든 연결이 잠깁니다.

$ tctl lock --device 9cdfc0ad-64b7-4d9c-9342-50e97f418ba0 --message="Compromised device" --ttl=48h
Created a lock with name "5444970a-39a0-4814-968d-e58b4a8fa686".

디바이스 ID와 일치하는 세션별 MFA로 시작된 모든 연결이 잠깁니다.

$ tctl lock --mfa-device=d6c06a18-e147-4232-9dfe-6f83a28d5850 --message="All contractor access is disabled for 10h." --ttl=10h
# Created a lock with name "d6c06a18-e147-4232-9dfe-6f83a28d5850".

지정된 에이전트에 대한 모든 연결이 잠기고 에이전트가 Teleport 클러스터에서 제외됩니다.

$ tctl lock --server-id=363256df-f78a-4d99-803c-bae19da9ede4 --message="The server running the Kubernetes Service and Database Service is under investigation." --ttl=10h
# Created a lock with name "dc7cee9d-fe5e-4534-a90d-db770f0234a1".

지정된 Windows 데스크톱에 대한 모든 연결이 잠깁니다.

$ tctl lock --windows-desktop=WIN-FMPFM5UF1SS-teleport-example-com --ttl=10h
# Created a lock with name "dc7cee9d-fe5e-4534-a90d-db770f0234a1".

일치하는 접근 요청으로 상승된 권한을 사용하는 모든 연결이 잠깁니다.

$ tctl lock --access-request=261e80c5-357b-4c43-9b67-40a6bc4c6e4d --ttl=24h
# Created a lock with name "dc7cee9d-fe5e-4534-a90d-db770f0234a1".

머신 및 워크로드 아이덴티티 봇에 대한 가장 적절한 잠금 대상은 조인 방법에 따라 다릅니다.

위임된 조인 방법의 경우, 봇이 조인하는 데 사용하는 특정 조인 토큰을 대상으로 하는 것이 가장 좋습니다:

$ tctl lock --join-token=example-token-name

조인 토큰 이름은 token 조인 방법을 사용하여 조인된 봇에는 적용할 수 없으므로, 봇 인스턴스 ID를 사용하는 것이 좋습니다:

$ tctl lock --bot-instance-id aabbccdd-1234-5678-0000-3b04d7d03acc

모든 경우에, 동일한 기본 사용자를 공유하는 봇의 모든 인스턴스를 잠그는 봇 사용자도 대상으로 지정할 수 있습니다:

$ tctl lock --user bot-example
문제 해결: 잠금 생성에 실패했나요?

사용자에게 잠금 권한이 없으면 잠금 생성 시 오류가 발생합니다:

ERROR: access denied to perform action "create" on "lock"

locksmith 역할을 정의합니다:

kind: role
version: v5
metadata:
  name: locksmith
spec:
  allow:
    rules:
      - resources: [lock]
        verbs: [list, create, read, update, delete]

역할 만들기:

$ tctl create -f locksmith.yaml
# role 'locksmith' has been created

Assign the locksmith role to your Teleport user by running the appropriate commands for your authentication provider:

잠금이 적용되면 잠금의 대상과 관련된 모든 기존 연결이 종료되고 새로운 요청은 거부됩니다.

이 상황에서 반환되는 오류와 기록되는 경고에는 다음과 같은 형태의 메시지가 포함됩니다:

lock targeting User:"foo@example.com" is in force: Suspicious activity.
Note

--message 매개변수로 사용자에게 반환되는 메시지를 조정할 수 있습니다:

$ tctl lock --user=foo@example.com --message="Please come back tomorrow." --ttl=24h
내부 동작: 잠금 리소스 및 만료 `--ttl` 또는 `--expires`를 지정하지 않으면 생성된 잠금은 `tctl rm`으로 명시적으로 제거할 때까지 유효합니다. 지원되는 모든 매개변수 목록은 `tctl lock --help`를 참조하세요.

내부적으로 tctl lock은 리소스를 만듭니다:

kind: lock
version: v2
metadata:
  name: dc7cee9d-fe5e-4534-a90d-db770f0234a1
spec:
  target:
    user: foo@example.com
  message: "Suspicious activity."
  expires: "2021-08-14T22:27:00Z"  # RFC3339 format

kind: lock 리소스는 일반적인 방법으로 tctl create를 사용하여 만들거나 업데이트할 수도 있습니다. 자세한 내용은 관리 가이드를 참조하세요.

2단계/2단계. 활성 잠금 목록 및 삭제#

tctl get 명령으로 모든 활성 잠금을 나열합니다:

$ tctl get locks

잠금 리소스 삭제:

$ tctl rm locks/24679348-baff-4987-a2cd-e820ab7f9d2b
lock "24679348-baff-4987-a2cd-e820ab7f9d2b" has been deleted

잠금을 삭제하면 새로운 세션이나 호스트 연결이 허용됩니다.

다음 단계: 잠금 모드#

Teleport 노드나 Proxy Service가 백엔드와 로컬 잠금 보기를 적절히 동기화할 수 없는 경우, 마지막으로 알려진 잠금에 의존할지 여부를 결정해야 합니다. 이 결정 전략은 두 가지 모드 중 하나로 인코딩됩니다:

  • strict 모드는 잠금이 최신 상태임을 보장할 수 없을 때 모든 상호작용을 종료합니다
  • best_effort 모드는 가장 최근의 잠금에 계속 의존합니다

클러스터 전체 모드의 기본값은 best_effort입니다. API 또는 CLI를 통해 cluster_auth_preference 리소스 또는 정적 구성 파일을 사용하여 기본 잠금 모드를 설정할 수 있습니다.

Auth Service 구성 파일(/etc/teleport.yaml, 기본값)에 auth_service.authentication 섹션이 포함된 경우, 다음 내용이 포함되도록 Teleport 구성 파일을 편집합니다:

auth_service:
    authentication:
        locking_mode: best_effort

변경 사항을 적용하려면 Auth Service를 재시작하거나 재배포합니다.

그렇지 않은 경우 클러스터 인증 기본 설정 리소스를 편집합니다:

$ tctl edit cap

에디터에서 파일을 다음과 같이 조정합니다:

kind: cluster_auth_preference
metadata:
  name: cluster-auth-preference
spec:
  locking_mode: best_effort
version: v2

에디터를 저장하고 닫아 변경 사항을 적용합니다.

클러스터 전체 모드의 기본값은 best_effort입니다. API 또는 CLI를 통해 cluster_auth_preference 리소스를 사용하여 기본 잠금 모드를 설정할 수 있습니다:

$ tctl edit cap

에디터에서 파일을 다음과 같이 조정합니다:

kind: cluster_auth_preference
metadata:
  name: cluster-auth-preference
spec:
  locking_mode: best_effort
version: v2

에디터를 저장하고 닫아 변경 사항을 적용합니다.

특정 역할에 대한 잠금 모드를 구성할 수도 있습니다:

kind: role
version: v5
metadata:
    name: example-role-with-strict-locking
spec:
    options:
       lock: strict

상호작용에 관여된 역할 중 어떤 역할도 모드를 지정하지 않거나 관련된 사용자가 없는 경우, 모드는 클러스터 전체 설정에서 가져옵니다.

여러 가지 잠금 모드가 충돌할 수 있는 경우(클러스터 전체 기본값과 개별 역할별 설정), strict가 한 번만 발생해도 로컬 잠금 보기가 엄격하게 평가됩니다.

세션 및 아이덴티티 잠금

원문 보기
요약

시스템 관리자는 침해된 사용자나 Teleport 에이전트를 비활성화하거나, 클러스터 유지보수 중 접근을 방지하기 위해 세션, 사용자 또는 호스트 아이덴티티에 잠금을 설정할 수 있습니다. Teleport는 새 API 요청을 거부하고 잠금의 대상과 일치하는 SSH, 애플리케이션, 데이터베이스, 데스크톱, Kubernetes 세션에 대한 활성 연결을 종료합니다.

시스템 관리자는 침해된 사용자나 Teleport 에이전트를 비활성화하거나, 클러스터 유지보수 중 접근을 방지하기 위해 세션, 사용자 또는 호스트 아이덴티티에 잠금을 설정할 수 있습니다.

Teleport는 새 API 요청을 거부하고 잠금의 대상과 일치하는 SSH, 애플리케이션, 데이터베이스, 데스크톱, Kubernetes 세션에 대한 활성 연결을 종료합니다.

잠금은 다음 객체 또는 속성을 대상으로 할 수 있습니다:

  • 사용자 이름으로 Teleport 사용자
  • 역할 이름으로 Teleport RBAC 역할
  • 디바이스 ID로 Teleport 신뢰 디바이스
  • 디바이스의 UUID로 MFA 디바이스
  • OS/UNIX 로그인
  • 에이전트의 서버 UUID로 Teleport 에이전트 (클러스터에서 효과적으로 등록 해제됨)
  • 데스크톱 이름으로 Windows 데스크톱
  • UUID로 접근 요청
  • 봇 인스턴스 ID (머신 및 워크로드 아이덴티티 봇)
  • 조인 토큰 이름 (위임된 조인 방법을 사용하는 머신 및 워크로드 아이덴티티 봇)

작동 방식#

잠금은 Teleport Auth Service 백엔드에 저장된 동적 Teleport 리소스입니다. Teleport 서비스는 잠금 생성과 관련된 Auth Service 이벤트를 구독하는 잠금 감시자를 구현합니다. 이러한 서비스가 잠금이 생성되거나 수정되었다는 알림을 받으면, 잠긴 사용자의 접근 방지와 같은 다양한 작업을 방지하는 보호 조치를 취합니다.

사전 조건#

  • 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 tctl and tsh clients.

    Installing `tctl` and `tsh` clients
    1. Determine the version of your Teleport cluster. The tctl and tsh clients must be at most one major version behind your Teleport cluster version. Send a GET request to the Proxy Service at /v1/webapi/find and 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')"
      
    2. Follow the instructions for your platform to install tctl and tsh clients:

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단계/2단계. 잠금 만들기#

tctl lock 명령으로 새 잠금을 만들 수 있습니다. 다음 옵션 중 하나로 잠금 대상을 지정합니다:

$ tctl lock --user=foo@example.com --message="Suspicious activity." --ttl=10h
# Created a lock with name "dc7cee9d-fe5e-4534-a90d-db770f0234a1".

대상 역할과 일치하는 역할이 할당된 모든 사용자가 잠깁니다.

$ tctl lock --role=contractor --message="All contractor access is disabled for 10h." --ttl=10h
# Created a lock with name "dc7cee9d-fe5e-4534-a90d-db770f0234a1".

디바이스 ID와 일치하는 디바이스에서 시작된 모든 연결이 잠깁니다.

$ tctl lock --device 9cdfc0ad-64b7-4d9c-9342-50e97f418ba0 --message="Compromised device" --ttl=48h
Created a lock with name "5444970a-39a0-4814-968d-e58b4a8fa686".

디바이스 ID와 일치하는 세션별 MFA로 시작된 모든 연결이 잠깁니다.

$ tctl lock --mfa-device=d6c06a18-e147-4232-9dfe-6f83a28d5850 --message="All contractor access is disabled for 10h." --ttl=10h
# Created a lock with name "d6c06a18-e147-4232-9dfe-6f83a28d5850".

지정된 에이전트에 대한 모든 연결이 잠기고 에이전트가 Teleport 클러스터에서 제외됩니다.

$ tctl lock --server-id=363256df-f78a-4d99-803c-bae19da9ede4 --message="The server running the Kubernetes Service and Database Service is under investigation." --ttl=10h
# Created a lock with name "dc7cee9d-fe5e-4534-a90d-db770f0234a1".

지정된 Windows 데스크톱에 대한 모든 연결이 잠깁니다.

$ tctl lock --windows-desktop=WIN-FMPFM5UF1SS-teleport-example-com --ttl=10h
# Created a lock with name "dc7cee9d-fe5e-4534-a90d-db770f0234a1".

일치하는 접근 요청으로 상승된 권한을 사용하는 모든 연결이 잠깁니다.

$ tctl lock --access-request=261e80c5-357b-4c43-9b67-40a6bc4c6e4d --ttl=24h
# Created a lock with name "dc7cee9d-fe5e-4534-a90d-db770f0234a1".

머신 및 워크로드 아이덴티티 봇에 대한 가장 적절한 잠금 대상은 조인 방법에 따라 다릅니다.

위임된 조인 방법의 경우, 봇이 조인하는 데 사용하는 특정 조인 토큰을 대상으로 하는 것이 가장 좋습니다:

$ tctl lock --join-token=example-token-name

조인 토큰 이름은 token 조인 방법을 사용하여 조인된 봇에는 적용할 수 없으므로, 봇 인스턴스 ID를 사용하는 것이 좋습니다:

$ tctl lock --bot-instance-id aabbccdd-1234-5678-0000-3b04d7d03acc

모든 경우에, 동일한 기본 사용자를 공유하는 봇의 모든 인스턴스를 잠그는 봇 사용자도 대상으로 지정할 수 있습니다:

$ tctl lock --user bot-example
문제 해결: 잠금 생성에 실패했나요?

사용자에게 잠금 권한이 없으면 잠금 생성 시 오류가 발생합니다:

ERROR: access denied to perform action "create" on "lock"

locksmith 역할을 정의합니다:

kind: role
version: v5
metadata:
  name: locksmith
spec:
  allow:
    rules:
      - resources: [lock]
        verbs: [list, create, read, update, delete]

역할 만들기:

$ tctl create -f locksmith.yaml
# role 'locksmith' has been created

Assign the locksmith role to your Teleport user by running the appropriate commands for your authentication provider:

잠금이 적용되면 잠금의 대상과 관련된 모든 기존 연결이 종료되고 새로운 요청은 거부됩니다.

이 상황에서 반환되는 오류와 기록되는 경고에는 다음과 같은 형태의 메시지가 포함됩니다:

lock targeting User:"foo@example.com" is in force: Suspicious activity.
Note

--message 매개변수로 사용자에게 반환되는 메시지를 조정할 수 있습니다:

$ tctl lock --user=foo@example.com --message="Please come back tomorrow." --ttl=24h
내부 동작: 잠금 리소스 및 만료 `--ttl` 또는 `--expires`를 지정하지 않으면 생성된 잠금은 `tctl rm`으로 명시적으로 제거할 때까지 유효합니다. 지원되는 모든 매개변수 목록은 `tctl lock --help`를 참조하세요.

내부적으로 tctl lock은 리소스를 만듭니다:

kind: lock
version: v2
metadata:
  name: dc7cee9d-fe5e-4534-a90d-db770f0234a1
spec:
  target:
    user: foo@example.com
  message: "Suspicious activity."
  expires: "2021-08-14T22:27:00Z"  # RFC3339 format

kind: lock 리소스는 일반적인 방법으로 tctl create를 사용하여 만들거나 업데이트할 수도 있습니다. 자세한 내용은 관리 가이드를 참조하세요.

2단계/2단계. 활성 잠금 목록 및 삭제#

tctl get 명령으로 모든 활성 잠금을 나열합니다:

$ tctl get locks

잠금 리소스 삭제:

$ tctl rm locks/24679348-baff-4987-a2cd-e820ab7f9d2b
lock "24679348-baff-4987-a2cd-e820ab7f9d2b" has been deleted

잠금을 삭제하면 새로운 세션이나 호스트 연결이 허용됩니다.

다음 단계: 잠금 모드#

Teleport 노드나 Proxy Service가 백엔드와 로컬 잠금 보기를 적절히 동기화할 수 없는 경우, 마지막으로 알려진 잠금에 의존할지 여부를 결정해야 합니다. 이 결정 전략은 두 가지 모드 중 하나로 인코딩됩니다:

  • strict 모드는 잠금이 최신 상태임을 보장할 수 없을 때 모든 상호작용을 종료합니다
  • best_effort 모드는 가장 최근의 잠금에 계속 의존합니다

클러스터 전체 모드의 기본값은 best_effort입니다. API 또는 CLI를 통해 cluster_auth_preference 리소스 또는 정적 구성 파일을 사용하여 기본 잠금 모드를 설정할 수 있습니다.

Auth Service 구성 파일(/etc/teleport.yaml, 기본값)에 auth_service.authentication 섹션이 포함된 경우, 다음 내용이 포함되도록 Teleport 구성 파일을 편집합니다:

auth_service:
    authentication:
        locking_mode: best_effort

변경 사항을 적용하려면 Auth Service를 재시작하거나 재배포합니다.

그렇지 않은 경우 클러스터 인증 기본 설정 리소스를 편집합니다:

$ tctl edit cap

에디터에서 파일을 다음과 같이 조정합니다:

kind: cluster_auth_preference
metadata:
  name: cluster-auth-preference
spec:
  locking_mode: best_effort
version: v2

에디터를 저장하고 닫아 변경 사항을 적용합니다.

클러스터 전체 모드의 기본값은 best_effort입니다. API 또는 CLI를 통해 cluster_auth_preference 리소스를 사용하여 기본 잠금 모드를 설정할 수 있습니다:

$ tctl edit cap

에디터에서 파일을 다음과 같이 조정합니다:

kind: cluster_auth_preference
metadata:
  name: cluster-auth-preference
spec:
  locking_mode: best_effort
version: v2

에디터를 저장하고 닫아 변경 사항을 적용합니다.

특정 역할에 대한 잠금 모드를 구성할 수도 있습니다:

kind: role
version: v5
metadata:
    name: example-role-with-strict-locking
spec:
    options:
       lock: strict

상호작용에 관여된 역할 중 어떤 역할도 모드를 지정하지 않거나 관련된 사용자가 없는 경우, 모드는 클러스터 전체 설정에서 가져옵니다.

여러 가지 잠금 모드가 충돌할 수 있는 경우(클러스터 전체 기본값과 개별 역할별 설정), strict가 한 번만 발생해도 로컬 잠금 보기가 엄격하게 평가됩니다.