InfoGrab Docs

Helm을 사용하여 셀프 호스팅 클러스터에서 Teleport Identity Security 실행

요약

셀프 호스팅 Teleport 클러스터에서 Teleport Identity Security와 Access Graph를 사용하려면 Access Graph 서비스를 설정해야 합니다. 이 가이드는 Helm 차트를 사용하여 Kubernetes 클러스터에 Access Graph 서비스를 설정하고 Teleport 클러스터에서 Access Graph 기능을 활성화하는 방법을 안내합니다.

셀프 호스팅 Teleport 클러스터에서 Teleport Identity Security와 Access Graph를 사용하려면 Access Graph 서비스를 설정해야 합니다. 이 서비스는 PostgreSQL을 백킹 스토리지로 사용하며 Auth Service 및 Proxy Service와 통신하여 리소스와 접근에 관한 정보를 수집합니다.

이 가이드는 Helm 차트를 사용하여 Kubernetes 클러스터에 Access Graph 서비스를 설정하고 Teleport 클러스터에서 Access Graph 기능을 활성화하는 방법을 안내합니다.

지원되는 파라미터의 전체 목록은 Helm 차트 참조에서 확인할 수 있습니다.

Access Graph는 Teleport Enterprise 고객에게만 제공되는 Identity Security 제품의 기능입니다.

작동 방식#

Auth Service, Proxy Service, 에이전트 서비스와 같은 Teleport 서비스와 달리, Teleport Access Graph는 teleport 바이너리에서 실행되지 않고 컨테이너 이미지로 Teleport에서 제공되는 별도의 소프트웨어로 실행됩니다. Teleport Access Graph는 TLS 자격 증명을 사용하여 Teleport Auth Service에 인증합니다. 또한 백킹 스토리지를 위해 PostgreSQL에 연결해야 합니다. Teleport 클러스터에서 자격 증명을 획득한 후, Teleport Access Graph에 대한 구성 파일을 만들고 teleport-access-graph Helm 차트를 설치합니다.

사전 조건#

  • Kubernetes >= v1.21
  • Helm >= [helm.version]
  • 실행 중인 Teleport Enterprise 클러스터 v18.0.0 이상.
  • Teleport Identity Security가 활성화된 업데이트된 Teleport Enterprise 라이선스 파일.
  • PostgreSQL 데이터베이스 서버 v14 이상.
    • Access Graph는 데이터를 저장할 전용 데이터베이스가 필요합니다. Access Graph가 데이터베이스에 연결하는 사용자는 이 데이터베이스의 소유자이거나 유사한 광범위한 권한이 있어야 합니다: public 스키마에 대한 최소 CREATE TABLE 권한, CREATE SCHEMA 권한.
    • Amazon RDS for PostgreSQL을 지원합니다.
    • 세션 녹화 검색은 Access Graph v1.30.0 이상과 pg_trgmpgvector 확장을 사용할 수 있는 PostgreSQL 인스턴스가 필요합니다. Access Graph가 이 확장을 자동으로 활성화합니다.
  • Access Graph 서비스에 대한 TLS 인증서
    • TLS 인증서는 "서버 인증" 키 사용으로 발급해야 하며, X.509 v3 subjectAltName 확장에 Access Graph의 Kubernetes 서비스 이름 (기본값: teleport-access-graph.teleport-access-graph.svc.cluster.local)을 포함해야 합니다.

1단계/4단계. Teleport Helm 차트 저장소 추가#

Configure Helm to fetch Teleport charts from the Teleport Helm repository:

$ helm repo add teleport (=teleport.helm_repo_url=)

Refresh the local Helm cache by fetching the latest charts:

$ helm repo update

2단계/4단계. Access Graph 설정#

Teleport 클러스터의 호스트 인증 기관(CA) 사본이 필요합니다. Access Graph는 호스트 CA가 Auth Service와 Proxy Service에 발급하는 호스트 인증서를 통해 들어오는 연결을 인증해야 합니다.

호스트 CA는 다음 방법 중 하나로 검색할 수 있습니다:

$ curl 'https:///webapi/auth/export?type=tls-host'
-----BEGIN CERTIFICATE-----
MIIDqjCCApKgAwIBAgIQMIK8/WiQ/rUOrjlmB0IHVTANBgkqhkiG9w0BAQsFADBv
<...>
-----END CERTIFICATE-----
$ tsh login --proxy=
$ tctl get cert_authorities --format=json \
    | jq -r '.[] | select(.spec.type == "host") | .spec.active_keys.tls[].cert' \
    | base64 -d
-----BEGIN CERTIFICATE-----
MIIDqjCCApKgAwIBAgIQMIK8/WiQ/rUOrjlmB0IHVTANBgkqhkiG9w0BAQsFADBv
<...>
-----END CERTIFICATE-----

그런 다음 Access Graph 배포를 위한 네임스페이스와 필요한 시크릿을 만듭니다. cert-manager를 사용하여 인증서를 발급하거나 Kubernetes 클러스터에서 Access Graph용 TLS 인증서를 이미 프로비저닝한 경우 마지막 명령은 건너뛸 수 있습니다.

$ kubectl create namespace teleport-access-graph
$ kubectl -n teleport-access-graph create secret generic teleport-access-graph-postgres \
    --from-literal uri="postgres://access_graph_user:my_password@db.example.com:5432/access_graph_db?sslmode=require"
$ kubectl -n teleport-access-graph create secret tls teleport-access-graph-tls --cert=./certs/cert.crt --key=./certs/cert.key

위 명령은 TLS 인증서와 Access Graph 서버의 개인 키가 ./certs 디렉터리에 저장되어 있다고 가정합니다.

개발용 TLS 인증서 생성 다음 스크립트를 사용하여 Access Graph 배포를 위한 인증 기관과 서버 TLS 인증서를 빠르게 생성할 수 있습니다.
#!/usr/bin/env bash

set -e

mkdir -p ./certs
cd ./certs

openssl genrsa -aes256 -out ca.key 4096
openssl req -x509 -new -key ca.key -sha256 -days 3652 -out ca.crt -subj '/CN=root'
openssl req -new -out cert.csr -newkey rsa:4096 -nodes -keyout cert.key -subj '/CN=Access Graph'
openssl x509 -req -in cert.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out cert.crt -days 3652 -sha256 \
  -extfile <(printf 'extendedKeyUsage = serverAuth, clientAuth\nsubjectAltName = DNS:teleport-access-graph.teleport-access-graph.svc.cluster.local')

echo "Certificates issued successfully"

스크립트는 동일한 비밀번호를 4번 입력하도록 요청합니다: CA 개인 키 자료를 암호화할 비밀번호를 생성 및 확인하기 위해 두 번, 그런 다음 개인 키를 사용하여 CA 인증서에 자체 서명하기 위해 한 번, 마지막으로 Access Graph 서버 인증서에 서명하기 위해 한 번.

이 스크립트는 개념 증명 배포용으로만 제공되며 최고의 보안 관행을 따르지 않을 수 있습니다.

시크릿을 프로비저닝한 후 Access Graph 배포를 위한 tag-values.yaml 파일을 만듭니다. clusterHostCAs 키 아래의 값을 이전에 검색한 Teleport 호스트 CA 인증서로 교체하세요.

postgres:
  secretName: "teleport-access-graph-postgres"

tls:
  # cert-manager 또는 다른 수단을 사용하여 Kubernetes 워크로드에 대한 TLS 인증서를
  # 프로비저닝하는 경우 이 값을 변경해야 할 수 있습니다.
  existingSecretName: "teleport-access-graph-tls"

clusterHostCAs:
  # 이것을 1단계에서 검색한 인증서로 교체하세요.
  # `clusterHostCAs`는 여러 줄 YAML 문자열의 배열입니다. `- |`를 제거하지 말고 들여쓰기를 유지해야 합니다.
  - |
    -----BEGIN CERTIFICATE-----
    MIIDqjCCApKgAwIBAgIQMIK8/WiQ/rUOrjlmB0IHVTANBgkqhkiG9w0BAQsFADBv
    <...>
    -----END CERTIFICATE-----

마지막으로 Helm을 사용하여 Access Graph 서비스를 배포합니다:

$ helm install -n teleport-access-graph -f tag-values.yaml --version (=access_graph.version=) teleport-access-graph teleport/teleport-access-graph
$ kubectl -n teleport-access-graph rollout status deployment/teleport-access-graph # Wait for the deployment to succeed

3단계/4단계. Teleport Auth Service 구성 업데이트#

Teleport Auth Service와 Access Graph Service 간의 연결을 활성화하려면 Auth Service 구성을 다음으로 업데이트해야 합니다:

  • Access Graph 서비스 주소
  • Access Graph 서비스 TLS 인증서를 발급한 CA의 경로.
    • 이 경로는 Teleport 파드에 마운트된 CA가 포함된 볼륨을 참조해야 합니다.
    • Teleport 클러스터에서 이미 신뢰하는 CA를 사용하는 경우 (예: tls.existingCASecretName 옵션을 통해), 또는 Mozilla CA 인증서 목록에 포함된 CA가 인증서를 발급한 경우 CA 인증서 파일 지정을 건너뛸 수 있습니다.

다음과 같이 CA 인증서가 포함된 ConfigMap을 만듭니다:

$ kubectl -n  create configmap teleport-access-graph-ca \
    --from-file=ca.pem=./certs/ca.crt

그런 다음 teleport-cluster Helm 차트 배포의 값을 다음과 같이 업데이트합니다:

auth:
  teleportConfig:
    # <...>

    # Access Graph 연결을 구성하는 섹션을 추가합니다.
    access_graph:
      enabled: true
      endpoint: teleport-access-graph.teleport-access-graph.svc.cluster.local:443
      # Teleport 클러스터에서 이미 발급 CA를 신뢰하는 경우 `ca` 키를 생략합니다.
      ca: /var/run/access-graph/ca.pem

# Teleport Auth Service에 Access Graph CA를 볼륨으로 제공합니다.
# Teleport 클러스터에서 이미 발급 CA를 신뢰하는 경우 아래 내용을 모두 생략합니다.
extraVolumes:
  - name: tag-ca
    configMap:
      name: teleport-access-graph-ca

extraVolumeMounts:
  - name: tag-ca
    mountPath: /var/run/access-graph

teleport-cluster Helm 차트를 사용하지 않는 경우 Teleport 클러스터 배포에 동일한 변경을 수행해야 합니다:

  • Teleport Auth Service의 YAML 구성 파일 최상위 수준에 access_graph: 섹션을 추가합니다.
  • Auth Service가 CA 인증서를 읽을 수 있도록 생성된 ConfigMap을 볼륨으로 마운트합니다.

마지막으로 Helm 차트를 재배포합니다(values-teleport.yaml에 값이 저장되어 있다고 가정). Auth Service 변경이 성공하면 Proxy Service를 재시작합니다. 에 teleport-cluster 배포의 이름을 할당합니다:

$ helm upgrade -n  -f values-teleport.yaml \
  --version <version>  teleport/teleport-cluster
$ kubectl -n  rollout status deployment/teleport-auth   # Wait for the deployment to succeed
$ kubectl -n  rollout restart deployment/teleport-proxy
$ kubectl -n  rollout status deployment/teleport-proxy  # Wait for the deployment to succeed

4단계/4단계. Graph Explorer에서 Access Graph 데이터 보기#

Access Graph 서비스의 데이터를 시각화하려면 Web UI의 Graph Explorer를 사용합니다. Identity Security --> Graph Explorer를 클릭한 다음 Graph Explorer에서 볼 리소스를 선택합니다.

인터페이스에 접근하려면 사용자에게 access_graph 리소스에 대한 listread 동사를 허용하는 역할이 있어야 합니다. 예:

kind: role
version: v7
metadata:
  name: my-role
spec:
  allow:
    rules:
    - resources:
      - access_graph
      verbs:
      - list
      - read

기본 설정 editor 역할에는 기본적으로 필요한 권한이 있습니다.

다음 단계#

Helm을 사용하여 셀프 호스팅 클러스터에서 Teleport Identity Security 실행

원문 보기
요약

셀프 호스팅 Teleport 클러스터에서 Teleport Identity Security와 Access Graph를 사용하려면 Access Graph 서비스를 설정해야 합니다. 이 가이드는 Helm 차트를 사용하여 Kubernetes 클러스터에 Access Graph 서비스를 설정하고 Teleport 클러스터에서 Access Graph 기능을 활성화하는 방법을 안내합니다.

셀프 호스팅 Teleport 클러스터에서 Teleport Identity Security와 Access Graph를 사용하려면 Access Graph 서비스를 설정해야 합니다. 이 서비스는 PostgreSQL을 백킹 스토리지로 사용하며 Auth Service 및 Proxy Service와 통신하여 리소스와 접근에 관한 정보를 수집합니다.

이 가이드는 Helm 차트를 사용하여 Kubernetes 클러스터에 Access Graph 서비스를 설정하고 Teleport 클러스터에서 Access Graph 기능을 활성화하는 방법을 안내합니다.

지원되는 파라미터의 전체 목록은 Helm 차트 참조에서 확인할 수 있습니다.

Access Graph는 Teleport Enterprise 고객에게만 제공되는 Identity Security 제품의 기능입니다.

작동 방식#

Auth Service, Proxy Service, 에이전트 서비스와 같은 Teleport 서비스와 달리, Teleport Access Graph는 teleport 바이너리에서 실행되지 않고 컨테이너 이미지로 Teleport에서 제공되는 별도의 소프트웨어로 실행됩니다. Teleport Access Graph는 TLS 자격 증명을 사용하여 Teleport Auth Service에 인증합니다. 또한 백킹 스토리지를 위해 PostgreSQL에 연결해야 합니다. Teleport 클러스터에서 자격 증명을 획득한 후, Teleport Access Graph에 대한 구성 파일을 만들고 teleport-access-graph Helm 차트를 설치합니다.

사전 조건#

  • Kubernetes >= v1.21
  • Helm >= [helm.version]
  • 실행 중인 Teleport Enterprise 클러스터 v18.0.0 이상.
  • Teleport Identity Security가 활성화된 업데이트된 Teleport Enterprise 라이선스 파일.
  • PostgreSQL 데이터베이스 서버 v14 이상.
    • Access Graph는 데이터를 저장할 전용 데이터베이스가 필요합니다. Access Graph가 데이터베이스에 연결하는 사용자는 이 데이터베이스의 소유자이거나 유사한 광범위한 권한이 있어야 합니다: public 스키마에 대한 최소 CREATE TABLE 권한, CREATE SCHEMA 권한.
    • Amazon RDS for PostgreSQL을 지원합니다.
    • 세션 녹화 검색은 Access Graph v1.30.0 이상과 pg_trgmpgvector 확장을 사용할 수 있는 PostgreSQL 인스턴스가 필요합니다. Access Graph가 이 확장을 자동으로 활성화합니다.
  • Access Graph 서비스에 대한 TLS 인증서
    • TLS 인증서는 "서버 인증" 키 사용으로 발급해야 하며, X.509 v3 subjectAltName 확장에 Access Graph의 Kubernetes 서비스 이름 (기본값: teleport-access-graph.teleport-access-graph.svc.cluster.local)을 포함해야 합니다.

1단계/4단계. Teleport Helm 차트 저장소 추가#

Configure Helm to fetch Teleport charts from the Teleport Helm repository:

$ helm repo add teleport (=teleport.helm_repo_url=)

Refresh the local Helm cache by fetching the latest charts:

$ helm repo update

2단계/4단계. Access Graph 설정#

Teleport 클러스터의 호스트 인증 기관(CA) 사본이 필요합니다. Access Graph는 호스트 CA가 Auth Service와 Proxy Service에 발급하는 호스트 인증서를 통해 들어오는 연결을 인증해야 합니다.

호스트 CA는 다음 방법 중 하나로 검색할 수 있습니다:

$ curl 'https:///webapi/auth/export?type=tls-host'
-----BEGIN CERTIFICATE-----
MIIDqjCCApKgAwIBAgIQMIK8/WiQ/rUOrjlmB0IHVTANBgkqhkiG9w0BAQsFADBv
<...>
-----END CERTIFICATE-----
$ tsh login --proxy=
$ tctl get cert_authorities --format=json \
    | jq -r '.[] | select(.spec.type == "host") | .spec.active_keys.tls[].cert' \
    | base64 -d
-----BEGIN CERTIFICATE-----
MIIDqjCCApKgAwIBAgIQMIK8/WiQ/rUOrjlmB0IHVTANBgkqhkiG9w0BAQsFADBv
<...>
-----END CERTIFICATE-----

그런 다음 Access Graph 배포를 위한 네임스페이스와 필요한 시크릿을 만듭니다. cert-manager를 사용하여 인증서를 발급하거나 Kubernetes 클러스터에서 Access Graph용 TLS 인증서를 이미 프로비저닝한 경우 마지막 명령은 건너뛸 수 있습니다.

$ kubectl create namespace teleport-access-graph
$ kubectl -n teleport-access-graph create secret generic teleport-access-graph-postgres \
    --from-literal uri="postgres://access_graph_user:my_password@db.example.com:5432/access_graph_db?sslmode=require"
$ kubectl -n teleport-access-graph create secret tls teleport-access-graph-tls --cert=./certs/cert.crt --key=./certs/cert.key

위 명령은 TLS 인증서와 Access Graph 서버의 개인 키가 ./certs 디렉터리에 저장되어 있다고 가정합니다.

개발용 TLS 인증서 생성 다음 스크립트를 사용하여 Access Graph 배포를 위한 인증 기관과 서버 TLS 인증서를 빠르게 생성할 수 있습니다.
#!/usr/bin/env bash

set -e

mkdir -p ./certs
cd ./certs

openssl genrsa -aes256 -out ca.key 4096
openssl req -x509 -new -key ca.key -sha256 -days 3652 -out ca.crt -subj '/CN=root'
openssl req -new -out cert.csr -newkey rsa:4096 -nodes -keyout cert.key -subj '/CN=Access Graph'
openssl x509 -req -in cert.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out cert.crt -days 3652 -sha256 \
  -extfile <(printf 'extendedKeyUsage = serverAuth, clientAuth\nsubjectAltName = DNS:teleport-access-graph.teleport-access-graph.svc.cluster.local')

echo "Certificates issued successfully"

스크립트는 동일한 비밀번호를 4번 입력하도록 요청합니다: CA 개인 키 자료를 암호화할 비밀번호를 생성 및 확인하기 위해 두 번, 그런 다음 개인 키를 사용하여 CA 인증서에 자체 서명하기 위해 한 번, 마지막으로 Access Graph 서버 인증서에 서명하기 위해 한 번.

이 스크립트는 개념 증명 배포용으로만 제공되며 최고의 보안 관행을 따르지 않을 수 있습니다.

시크릿을 프로비저닝한 후 Access Graph 배포를 위한 tag-values.yaml 파일을 만듭니다. clusterHostCAs 키 아래의 값을 이전에 검색한 Teleport 호스트 CA 인증서로 교체하세요.

postgres:
  secretName: "teleport-access-graph-postgres"

tls:
  # cert-manager 또는 다른 수단을 사용하여 Kubernetes 워크로드에 대한 TLS 인증서를
  # 프로비저닝하는 경우 이 값을 변경해야 할 수 있습니다.
  existingSecretName: "teleport-access-graph-tls"

clusterHostCAs:
  # 이것을 1단계에서 검색한 인증서로 교체하세요.
  # `clusterHostCAs`는 여러 줄 YAML 문자열의 배열입니다. `- |`를 제거하지 말고 들여쓰기를 유지해야 합니다.
  - |
    -----BEGIN CERTIFICATE-----
    MIIDqjCCApKgAwIBAgIQMIK8/WiQ/rUOrjlmB0IHVTANBgkqhkiG9w0BAQsFADBv
    <...>
    -----END CERTIFICATE-----

마지막으로 Helm을 사용하여 Access Graph 서비스를 배포합니다:

$ helm install -n teleport-access-graph -f tag-values.yaml --version (=access_graph.version=) teleport-access-graph teleport/teleport-access-graph
$ kubectl -n teleport-access-graph rollout status deployment/teleport-access-graph # Wait for the deployment to succeed

3단계/4단계. Teleport Auth Service 구성 업데이트#

Teleport Auth Service와 Access Graph Service 간의 연결을 활성화하려면 Auth Service 구성을 다음으로 업데이트해야 합니다:

  • Access Graph 서비스 주소
  • Access Graph 서비스 TLS 인증서를 발급한 CA의 경로.
    • 이 경로는 Teleport 파드에 마운트된 CA가 포함된 볼륨을 참조해야 합니다.
    • Teleport 클러스터에서 이미 신뢰하는 CA를 사용하는 경우 (예: tls.existingCASecretName 옵션을 통해), 또는 Mozilla CA 인증서 목록에 포함된 CA가 인증서를 발급한 경우 CA 인증서 파일 지정을 건너뛸 수 있습니다.

다음과 같이 CA 인증서가 포함된 ConfigMap을 만듭니다:

$ kubectl -n  create configmap teleport-access-graph-ca \
    --from-file=ca.pem=./certs/ca.crt

그런 다음 teleport-cluster Helm 차트 배포의 값을 다음과 같이 업데이트합니다:

auth:
  teleportConfig:
    # <...>

    # Access Graph 연결을 구성하는 섹션을 추가합니다.
    access_graph:
      enabled: true
      endpoint: teleport-access-graph.teleport-access-graph.svc.cluster.local:443
      # Teleport 클러스터에서 이미 발급 CA를 신뢰하는 경우 `ca` 키를 생략합니다.
      ca: /var/run/access-graph/ca.pem

# Teleport Auth Service에 Access Graph CA를 볼륨으로 제공합니다.
# Teleport 클러스터에서 이미 발급 CA를 신뢰하는 경우 아래 내용을 모두 생략합니다.
extraVolumes:
  - name: tag-ca
    configMap:
      name: teleport-access-graph-ca

extraVolumeMounts:
  - name: tag-ca
    mountPath: /var/run/access-graph

teleport-cluster Helm 차트를 사용하지 않는 경우 Teleport 클러스터 배포에 동일한 변경을 수행해야 합니다:

  • Teleport Auth Service의 YAML 구성 파일 최상위 수준에 access_graph: 섹션을 추가합니다.
  • Auth Service가 CA 인증서를 읽을 수 있도록 생성된 ConfigMap을 볼륨으로 마운트합니다.

마지막으로 Helm 차트를 재배포합니다(values-teleport.yaml에 값이 저장되어 있다고 가정). Auth Service 변경이 성공하면 Proxy Service를 재시작합니다. 에 teleport-cluster 배포의 이름을 할당합니다:

$ helm upgrade -n  -f values-teleport.yaml \
  --version <version>  teleport/teleport-cluster
$ kubectl -n  rollout status deployment/teleport-auth   # Wait for the deployment to succeed
$ kubectl -n  rollout restart deployment/teleport-proxy
$ kubectl -n  rollout status deployment/teleport-proxy  # Wait for the deployment to succeed

4단계/4단계. Graph Explorer에서 Access Graph 데이터 보기#

Access Graph 서비스의 데이터를 시각화하려면 Web UI의 Graph Explorer를 사용합니다. Identity Security --> Graph Explorer를 클릭한 다음 Graph Explorer에서 볼 리소스를 선택합니다.

인터페이스에 접근하려면 사용자에게 access_graph 리소스에 대한 listread 동사를 허용하는 역할이 있어야 합니다. 예:

kind: role
version: v7
metadata:
  name: my-role
spec:
  allow:
    rules:
    - resources:
      - access_graph
      verbs:
      - list
      - read

기본 설정 editor 역할에는 기본적으로 필요한 권한이 있습니다.

다음 단계#