셀프 호스팅 클러스터에서 Teleport Identity Security 실행
Teleport v18.9이 가이드는 셀프 호스팅 Teleport 클러스터에서 Teleport Access Graph를 설정하는 방법을 보여줍니다. Auth 서비스, 프록시 서비스, 에이전트 서비스와 같은 Teleport 서비스와 달리 Teleport Access Graph는 teleport 바이너리에서 실행되지 않고, Teleport에서 컨테이너 이미지로 제공되는 별도의 소프트웨어로 실행됩니다.
이 가이드는 셀프 호스팅 Teleport 클러스터에서 Teleport Access Graph를 설정하는 방법을 보여줍니다.
작동 방식#
Auth 서비스, 프록시 서비스, 에이전트 서비스와 같은 Teleport 서비스와 달리 Teleport Access
Graph는 teleport 바이너리에서 실행되지 않고, Teleport에서 컨테이너 이미지로 제공되는
별도의 소프트웨어로 실행됩니다. Teleport Access Graph는 TLS 자격 증명을 사용하여 Teleport
Auth 서비스에 인증합니다. 또한 백엔드 스토리지를 위해 PostgreSQL에 연결해야 합니다.
Teleport 클러스터에서 자격 증명을 얻은 후, Teleport Access Graph용 설정 파일을 생성하고
해당 설정 파일과 Teleport 자격 증명을 로드하는 컨테이너를 시작합니다.
사전 요구사항#
- 실행 중인 Teleport Enterprise 클러스터.
- Teleport Identity Security가 활성화된 최신 Teleport Enterprise 라이선스 파일.
- Docker v
[docker.version]이상. - PostgreSQL 데이터베이스 서버 v14 이상.
- Access Graph는 데이터를 저장하기 위한 전용 데이터베이스가 필요합니다.
Access Graph가 데이터베이스에 연결하는 데 사용하는 사용자는 이 데이터베이스의 소유자여야 하거나,
최소한
public스키마에 대한CREATE TABLE권한과CREATE SCHEMA권한과 같은 유사한 광범위한 권한을 가져야 합니다. - Amazon RDS for PostgreSQL을 지원합니다.
- 세션 녹화 검색을 사용하려면 Access Graph
v1.30.0 이상과
pg_trgm및pgvector확장을 사용할 수 있는 PostgreSQL 인스턴스가 필요합니다. Access Graph가 이러한 확장을 자동으로 활성화합니다.
- Access Graph는 데이터를 저장하기 위한 전용 데이터베이스가 필요합니다.
Access Graph가 데이터베이스에 연결하는 데 사용하는 사용자는 이 데이터베이스의 소유자여야 하거나,
최소한
- Access Graph 서비스용 TLS 인증서
- TLS 인증서는 "서버 인증(server authentication)" 키 사용 용도로 발급되어야 하며,
X.509 v3
subjectAltName확장에 Access Graph 서비스의 IP 또는 DNS 이름을 명시해야 합니다. - Access Graph 서비스 버전 1.20.4부터는 컨테이너가 기본적으로 루트가 아닌 사용자로 실행됩니다.
컨테이너를 실행하는 사용자가 인증서 파일을 읽을 수 있는지 확인하십시오. 다음 명령어로 올바른
권한을 설정할 수 있습니다.
$ sudo chown 65532 /etc/access_graph/tls.key
- TLS 인증서는 "서버 인증(server authentication)" 키 사용 용도로 발급되어야 하며,
X.509 v3
- Access Graph 서비스를 실행하는 노드는 Teleport Auth 서비스 및 프록시 서비스에서 접근 가능해야 합니다.
Docker를 이용한 배포는 테스트 및 개발 목적에 적합합니다. 프로덕션 배포의 경우 Kubernetes에 이 서비스를 배포하기 위해 Access Graph Helm 차트를 사용하는 것을 고려하십시오. 자세한 내용은 Access Graph용 Helm 차트를 참고하십시오.
1단계/3단계. Access Graph 설정#
Access Graph 서비스를 호스팅하는 머신에 Teleport 클러스터의 호스트 인증 기관(CA) 사본이 필요합니다. 이 서비스는 호스트 CA가 Auth 서비스와 프록시 서비스에 발급한 호스트 인증서를 통해 인증된 수신 연결만 허용하도록 요구합니다.
호스트 CA는 다음 방법 중 하나로 조회하여 파일에 저장할 수 있습니다.
$ sudo mkdir /etc/access_graph
$ curl -s 'https://teleport.example.com/webapi/auth/export?type=tls-host' | sudo tee /etc/access_graph/teleport_host_ca.pem
$ sudo mkdir /etc/access_graph
$ tsh login --proxy=teleport.example.com
$ tctl get cert_authorities --format=json \
| jq -r '.[] | select(.spec.type == "host") | .spec.active_keys.tls[].cert' \
| base64 -d | sudo tee /etc/access_graph/teleport_host_ca.pem
그런 다음 동일한 머신에서 다음과 유사한 Access Graph 서비스용 설정 파일을 생성합니다.
# Configuration for Teleport Access Graph service.
# Example: /etc/access_graph/config.yaml
backend:
postgres:
# This uses the PostgreSQL connection URI format, see https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING-URIS
# A stricter `sslmode` value is strongly recommended,
# e.g. `sslmode=verify-full&sslrootcert=/etc/access_graph/my_postgres_ca.crt`.
# For a full reference on possible parameters see https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS
connection: postgres://access_graph_user:my_password@db.example.com:5432/access_graph_db?sslmode=require
# When running on Amazon RDS, IAM auth via credentials set in the environment can be used as follows:
# iam:
# aws_region: us-west-2
# IP address (optional) and port for the Access Graph service to listen to.
# This is the default value. This key can be omitted to listen on port 50051 on all interfaces.
address: ":50051"
# Example Identity Activity Center configuration.
# identity_activity_center:
# region: eu-central-1
# database: example-db
# table: example-table
# s3: s3://example-long-term-bucket/data/
# s3_results: s3://example-transient-bucket/results/
# s3_large_files: s3://example-transient-bucket/large_files
# workgroup: example-workgroup
# sqs_queue_url: https://sqs.eu-central-1.amazonaws.com/aws-account-id/example-sqs-queue
# maxmind_geoip_city_db_path: "/etc/maxmindGeoIP/GeoLite2-City.mmdb" # optional
tls:
# File paths of PEM-encoded TLS certificate and private key for the Access Graph server.
cert: /etc/access_graph/tls.crt
key: /etc/access_graph/tls.key
# This lists the file paths for host CAs of Teleport clusters that are allowed to register with this Access Graph service.
# Several paths can be included to allow several Teleport clusters to connect to the Access Graph service.
registration_cas:
- /etc/access_graph/teleport_host_ca.pem # A full path to the file containing the Teleport cluster's host CA certificate.
마지막으로 다음과 같이 Docker를 사용하여 Access Graph 서비스를 시작합니다.
$ docker run -p 50051:50051 -v <path-to-config>:/app/config.yaml -v /etc/access_graph:/etc/access_graph public.ecr.aws/gravitational/access-graph:(=access_graph.version=)
2단계/3단계. Teleport Auth 서비스 설정 업데이트#
Auth 서비스의 YAML 설정에 Access Graph 설정을 위한 새로운 최상위 섹션을 추가합니다.
access_graph:
enabled: true
# host:port where the Access Graph service is listening
endpoint: access-graph.example.com:50051
# Specify a trusted CA we expect the Access Graph server certificate to be signed by.
# If not specified, the system trust store will be used.
ca: /etc/access_graph_ca.pem
다음 명령어를 사용하여 Auth 서비스 인스턴스를 재시작한 후 프록시 서비스 인스턴스를 재시작합니다.
$ sudo systemctl reload teleport
3단계/3단계. Graph Explorer에서 Access Graph 데이터 보기#
Access Graph 서비스의 데이터를 시각화하려면 웹 UI의 Graph Explorer를 사용합니다. Identity Security --> Graph Explorer를 클릭한 다음 Graph Explorer에서 볼 리소스를 선택합니다.
인터페이스에 접근하려면 사용자가 access_graph 리소스에 대해 list 및 read 동사를
허용하는 역할을 가지고 있어야 합니다. 예를 들면 다음과 같습니다.
kind: role
version: v7
metadata:
name: my-role
spec:
allow:
rules:
- resources:
- access_graph
verbs:
- list
- read
프리셋 editor 역할은 기본적으로 필요한 권한을 가지고 있습니다.