접근 요청 알림 라우팅
Teleport의 접근 모니터링 규칙을 사용하면 여러 조건에 따라 접근 요청 알림을 플러그인으로 라우팅할 수 있습니다. 접근 모니터링 규칙(AMR)은 특정 특성을 가진 감사 이벤트와 일치하고 이러한 이벤트를 수신할 때 Teleport 플러그인이 조치를 취하도록 지시하는 동적 Teleport 리소스입니다.
Teleport의 접근 모니터링 규칙을 사용하면 여러 조건에 따라 접근 요청 알림을 플러그인으로 라우팅할 수 있습니다. 예를 들어, 어떤 역할이나 리소스에 접근하는지, 또는 요청을 만드는 사용자가 누구인지에 따라 다른 Slack 채널로 알림을 보내고 싶을 수 있습니다.
작동 방식#
접근 모니터링 규칙(AMR)은 특정 특성을 가진 감사 이벤트와 일치하고 이러한 이벤트를 수신할 때 Teleport 플러그인이 조치를 취하도록 지시하는 동적 Teleport 리소스입니다. Teleport 플러그인은 Teleport Auth Service에 연결하고 AMR을 수신합니다. AMR이 플러그인과 일치하면 플러그인은 AMR을 로드하고 이를 사용하여 수신 이벤트를 처리합니다.
플러그인은 AMR 처리 로직을 서로 별도로 구현합니다. 현재 호스팅된 플러그인의 일부만 알림 라우팅 규칙을 지원합니다. 나머지 호스팅된 플러그인에 대한 지원을 확장하는 작업을 진행 중입니다. 새 플러그인에 대해 알아보려면 Teleport 변경 로그를 확인하세요.
전제 조건#
-
A running Teleport Enterprise Cloud 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:
-
- 접근 모니터링 규칙을 지원하는 Teleport 접근 플러그인이 최소 하나 등록되어 있어야 합니다.
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단계. 접근 모니터링 규칙 만들기#
두 가지 방법으로 접근 요청 알림 규칙을 정의할 수 있습니다:
- Web UI 대화상자 사용.
- 규칙 정의를 포함하는 YAML 리소스 파일 만들기.
Web UI를 통해 접근 모니터링 규칙 만들기#
Web UI를 통해 접근 모니터링 규칙을 만들려면, 먼저 접근 요청 페이지로 이동하고 View Notification Routing Rules를 클릭합니다.

그런 다음 Create Notification Rule을 클릭합니다.

접근 모니터링 규칙 기반 라우팅을 지원하는 플러그인이 등록되지 않은 경우 UI에서 하나를 등록하라는 메시지가 표시됩니다.
YAML 리소스를 사용하여 접근 모니터링 규칙 만들기#
다음은 접근 모니터링 규칙 예시입니다. 이 규칙은 역할 your_role_name이 포함된 접근 요청이 만들어지면 Slack 플러그인을 통해 your_slack_channel에 알림을 보냅니다.
kind: access_monitoring_rule
version: v1
metadata:
name: your-plugin-name
spec:
subjects: ['access_request']
condition: 'access_request.spec.roles.contains("your_role_name")'
notification:
name: 'slack'
recipients: ['your_slack_channel']
위의 라우팅 규칙은 명령줄에서 tctl create -f your-file-name.yaml을 사용하여 만들 수 있습니다.
접근 모니터링 규칙에 여러 수신자를 지정할 수 있습니다. 규칙의 condition 필드는 규칙을 적용하고자 하는 조건을 정의하는 조건 표현식으로 설정됩니다.
현재 지원되는 접근 요청 필드:
| 필드 | 설명 |
|---|---|
| access_request.spec.roles | 요청된 역할 세트. |
| access_request.spec.suggested_reviewers | 요청에 지정된 검토자 세트. |
| access_request.spec.system_annotations | 요청에 대한 시스템 주석 맵. |
| access_request.spec.user | 요청하는 사용자. |
| access_request.spec.request_reason | 요청 이유. |
| access_request.spec.creation_time | 요청의 생성 시간. |
| access_request.spec.expiry | 요청의 만료 시간. |
접근 모니터링 규칙의 condition에 사용되는 조건 표현식은 true 또는 false로 평가되어야 합니다.
condition 필드의 예시 값과 가능한 용도:
access_request.spec.user == "some_user"- 요청하는 사용자에 따른 라우팅.access_request.spec.roles.contains("some_role")- 요청된 역할에 따른 라우팅.access_request.spec.roles.contains_any(set("role_1", "role_2"))- 여러 역할에 따른 라우팅.
2/2단계. 새 접근 모니터링 규칙 테스트#
위의 Slack 플러그인 예시 규칙에서:
- 역할 "your_role_name"을 원하는 역할로 교체합니다.
- "your_slack_channel"을 플러그인이 접근할 수 있는 Slack 채널로 교체합니다.
그런 다음 규칙에 지정한 역할에 대한 접근 요청을 만듭니다.
그런 다음 접근 모니터링 규칙에 설정한 Slack 채널을 확인하여 알림이 전송되었는지 확인합니다.
