InfoGrab Docs

Jira Access Request 플러그인 실행

요약

이 가이드는 Jira용 Teleport Access Request 플러그인을 설정하는 방법을 설명합니다. In Teleport Enterprise Cloud, Teleport manages the Jira integration for you, and you can enroll the Jira integration from the Teleport Web UI.

이 가이드는 Jira용 Teleport Access Request 플러그인을 설정하는 방법을 설명합니다. Teleport의 Jira 통합을 사용하면 Jira 이슈로 Access Request를 관리할 수 있습니다.

이 통합은 Teleport Cloud에서 호스팅됩니다

In Teleport Enterprise Cloud, Teleport manages the Jira integration for you, and you can enroll the Jira integration from the Teleport Web UI.

Visit the Teleport Web UI and on the left sidebar, click Add New followed by Integration:

Enroll an Access Request plugin

On the "Select Integration Type" menu, click the tile for your integration. You will see a page with instructions to set up the integration, as well as a form that you can use to configure the integration.

작동 방식#

Teleport Jira 플러그인은 Jira 프로젝트 보드를 Teleport 클러스터에서 처리된 Access Request와 동기화합니다. Teleport 내에서 Access Request 상태를 변경하면 플러그인이 보드를 업데이트합니다. 보드에서 Access Request 상태를 업데이트하면, 플러그인이 실행하는 Jira 웹훅에 알림이 전송되어 Teleport의 Access Request를 수정합니다.

사전 요구사항#

  • A running Teleport Enterprise 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:

Recommended: Configure Machine & Workload Identity to provide short-lived Teleport credentials to the plugin. Before following this guide, follow a Machine & Workload Identity deployment guide to run the tbot binary on your infrastructure.

  • 애플리케이션 및 웹훅을 생성할 권한이 있는 Jira 계정.

  • Jira 웹훅용 등록된 도메인 이름. Jira는 프로젝트 보드의 변경 사항을 웹훅에 알립니다.

  • Jira 플러그인을 실행할 환경. 다음 중 하나입니다:

    • 포트 808081이 열려 있고 호스트에 접근할 수 있는 수단(예: 워크스테이션에 SSH 포트가 노출된 OpenSSH)이 있는 Linux 가상 머신.
    • 클라우드 공급자를 통해 배포된 Kubernetes 클러스터. 이 가이드는 LoadBalancer 서비스를 통해 Jira 플러그인으로 트래픽을 허용하는 방법을 보여주므로, 환경이 이 유형의 서비스를 지원해야 합니다.
  • 플러그인이 실행하는 Jira 웹훅에 TLS 자격 증명을 제공하는 수단. TLS 인증서는 자체 서명이어서는 안 됩니다. 예를 들어, ACME 클라이언트를 사용하여 Let's Encrypt에서 웹훅의 TLS 자격 증명을 얻을 수 있습니다.

    • Linux 서버에서 플러그인을 실행하는 경우, 플러그인이 접근할 수 있는 디렉터리에 TLS 자격 증명을 제공해야 합니다.
    • Kubernetes에서 플러그인을 실행하는 경우, 플러그인이 읽을 수 있는 시크릿에 이 자격 증명을 써야 합니다. 이 가이드에서는 시크릿 이름이 teleport-plugin-jira-tls라고 가정합니다.

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/8단계. RBAC 리소스 정의#

Jira 플러그인을 설정하기 전에, Teleport 클러스터에서 Role Access Request를 활성화해야 합니다.

For the purpose of this guide, we will define an editor-requester role, which can request the built-in editor role, and an editor-reviewer role that can review requests for the editor role.

Create a file called editor-request-rbac.yaml with the following content:

kind: role
version: v7
metadata:
  name: editor-reviewer
spec:
  allow:
    review_requests:
      roles: ['editor']
---
kind: role
version: v7
metadata:
  name: editor-requester
spec:
  allow:
    request:
      roles: ['editor']
      thresholds:
        - approve: 1
          deny: 1

Create the roles you defined:

$ tctl create -f editor-request-rbac.yaml
role 'editor-reviewer' has been created
role 'editor-requester' has been created

(!docs/pages/includes/create-role-using-web.mdx!)

Allow yourself to review requests by users with the editor-requester role by assigning yourself the editor-reviewer role.

(!docs/pages/includes/add-role-to-user.mdx role="editor-reviewer"!)

Create a user called myuser who has the editor-requester role. This user cannot edit your cluster configuration unless they request the editor role:

$ tctl users add myuser --roles=editor-requester 

tctl will print an invitation URL to your terminal. Visit the URL and log in as myuser for the first time, registering credentials as configured for your Teleport cluster.

Later in this guide, you will have myuser request the editor role so you can review the request using the Teleport plugin.

2/8단계. Teleport Jira 플러그인 사용자 정의#

플러그인에 필요한 권한은 사전 설정된 access-plugin 역할에 구성되어 있습니다. 플러그인에 대한 자격 증명을 생성하려면, Machine ID 봇 사용자 또는 일반 Teleport 사용자를 정의합니다.

If you haven't set up a Machine ID bot yet, refer to the deployment guide to run the tbot binary on your infrastructure.

Next, allow the Machine ID bot to generate credentials for the access-plugin role. You can do this using tctl, replacing my-bot with the name of your bot:

$ tctl bots update my-bot --add-roles access-plugin

As with all Teleport users, the Teleport Auth Service authenticates the access-plugin user by issuing short-lived TLS credentials. In this case, we will need to request the credentials manually by impersonating the access-plugin role and user.

If you are running a self-hosted Teleport Enterprise deployment and are using tctl from the Auth Service host, you will already have impersonation privileges.

To grant your user impersonation privileges for access-plugin, define a user named access-plugin and a role named access-plugin-impersonator by adding the following YAML document into a file called access-plugin-impersonator.yaml:

kind: user
metadata:
  name: access-plugin
spec:
  roles: ['access-plugin']
version: v2
---
kind: role
version: v7
metadata:
  name: access-plugin-impersonator
spec:
  allow:
    impersonate:
      roles:
      - access-plugin
      users:
      - access-plugin

Create the user and role:

$ tctl create -f access-plugin-impersonator.yaml
user "access-plugin" has been created
role "access-plugin-impersonator" has been created

(!docs/pages/includes/create-role-using-web.mdx!)

Assign this role to the user you plan to use to generate credentials for the access-plugin role and user:

(!docs/pages/includes/add-role-to-user.mdx role="access-plugin-impersonator"!)

You will now be able to generate signed certificates for the access-plugin role and user.

3/8단계. 액세스 플러그인 ID 내보내기#

플러그인에 Teleport ID 파일 접근 권한을 부여합니다. 유출 시 위험도가 낮은 단기 ID 파일을 생성하기 위해 Machine ID를 사용하는 것을 권장하지만, 데모 배포에서는 tctl로 장기 ID 파일을 생성할 수 있습니다:

Configure tbot with an output that will produce the credentials needed by the plugin. As the plugin will be accessing the Teleport API, the correct output type to use is identity.

For this guide, the directory destination will be used. This will write these credentials to a specified directory on disk. Ensure that this directory can be written to by the Linux user that tbot runs as, and that it can be read by the Linux user that the plugin will run as.

Modify your tbot configuration to add an identity output.

If running tbot on a Linux server, use the directory output to write identity files to the /opt/machine-id directory:

services:
- type: identity
  destination:
    type: directory
    # For this guide, /opt/machine-id is used as the destination directory.
    # You may wish to customize this. Multiple outputs cannot share the same
    # destination.
    path: /opt/machine-id

If running tbot on Kubernetes, write the identity file to Kubernetes secret instead:

services:
  - type: identity
    destination:
      type: kubernetes_secret
      name: teleport-plugin-jira-identity

If operating tbot as a background service, restart it. If running tbot in one-shot mode, execute it now.

You should now see an identity file under /opt/machine-id or a Kubernetes secret named teleport-plugin-jira-identity. This contains the private key and signed certificates needed by the plugin to authenticate with the Teleport Auth Service.

Like all Teleport users, access-plugin needs signed credentials in order to connect to your Teleport cluster. You will use the tctl auth sign command to request these credentials.

The following tctl auth sign command impersonates the access-plugin user, generates signed credentials, and writes an identity file to the local directory:

$ tctl auth sign --user=access-plugin --out=identity

The plugin connects to the Teleport Auth Service's gRPC endpoint over TLS.

The identity file, identity, includes both TLS and SSH credentials. The plugin uses the SSH credentials to connect to the Proxy Service, which establishes a reverse tunnel connection to the Auth Service. The plugin uses this reverse tunnel, along with your TLS credentials, to connect to the Auth Service's gRPC endpoint.

Certificate Lifetime

By default, tctl auth sign produces certificates with a relatively short lifetime. For production deployments, we suggest using Machine & Workload Identity to programmatically issue and renew certificates for your plugin. See our Machine & Workload Identity getting started guide to learn more.

Note that you cannot issue certificates that are valid longer than your existing credentials. For example, to issue certificates with a 1000-hour TTL, you must be logged in with a session that is valid for at least 1000 hours. This means your user must have a role allowing a max_session_ttl of at least 1000 hours (60000 minutes), and you must specify a --ttl when logging in:

$ tsh login --proxy=teleport.example.com --ttl=60060

If you are running the plugin on a Linux server, create a data directory to hold certificate files for the plugin:

$ sudo mkdir -p /var/lib/teleport/plugins/api-credentials
$ sudo mv identity /var/lib/teleport/plugins/api-credentials

If you are running the plugin on Kubernetes, Create a Kubernetes secret that contains the Teleport identity file:

$ kubectl -n teleport create secret generic --from-file=identity teleport-plugin-jira-identity

Once the Teleport credentials expire, you will need to renew them by running the tctl auth sign command again.

4/8단계. Teleport Jira 플러그인 설치#

아래 지침에 따라 Teleport Jira 플러그인을 설치합니다. 플러그인을 호스트(예: EC2 인스턴스)에 배포하는지 Kubernetes 클러스터에 배포하는지에 따라 다릅니다.

Teleport Jira 플러그인은 Jira와 Teleport Proxy Service(또는 Teleport Enterprise Cloud 테넌트) 모두에 접근할 수 있는 호스트 또는 Kubernetes 클러스터에서 실행해야 합니다.

5/8단계. Jira 프로젝트 설정#

이 섹션에서는 Teleport 사용자가 Access Request를 생성하거나 업데이트할 때 Teleport 플러그인이 수정할 수 있는 Jira 프로젝트를 생성합니다. 그런 다음 플러그인은 Jira 웹훅을 사용하여 보드 상태를 모니터링하고 생성한 티켓의 변경 사항에 응답합니다.

Access Request 관리를 위한 프로젝트 생성#

Jira의 상단 탐색 바에서 프로젝트 -> 프로젝트 생성을 클릭합니다. 템플릿으로 Kanban을 선택한 다음 템플릿 사용을 클릭합니다. 회사 관리형 프로젝트 선택을 클릭합니다.

프로젝트 이름을 입력할 수 있는 화면이 표시됩니다. 이 가이드에서는 프로젝트가 "Teleport Access Requests"라고 가정하며, 기본적으로 키 TAR이 할당됩니다.

"저장소, 문서 등 연결"이 해제되어 있는지 확인한 다음 프로젝트 생성을 클릭합니다.

새 보드의 오른쪽 상단에 있는 세 점 메뉴에서 보드 설정을 클릭한 다음 을 클릭합니다. 다음 네 가지 상태가 포함되도록 보드의 상태를 편집합니다:

  1. Pending
  2. Approved
  3. Denied
  4. Expired

각 상태와 동일한 이름의 열을 생성합니다. 결과는 다음과 같아야 합니다:

Jira 보드 설정

Warning

프로젝트 보드에 이 열들이 (그리고 이 열들만) 없고 각각 동일한 이름의 상태가 없으면, Jira Access Request 플러그인이 예상치 못한 방식으로 동작합니다. 다른 모든 열과 상태를 제거하세요.

보드로 돌아가기를 클릭하여 변경 사항을 검토합니다.

Jira API 토큰 가져오기#

Access Request 플러그인이 Jira 프로젝트를 변경하는 데 사용할 API 토큰을 얻습니다. 화면 오른쪽 상단의 톱니바퀴 메뉴를 클릭한 다음 Atlassian 계정 설정을 클릭합니다. 보안 > API 토큰 생성 및 관리 > API 토큰 생성을 클릭합니다.

레이블을 선택하고 복사를 클릭합니다. 나중에 이 가이드에서 Jira 플러그인을 설정할 때 사용할 수 있도록 API 토큰을 편리한 위치(예: 비밀번호 관리자 또는 로컬 텍스트 문서)에 붙여넣습니다.

Jira 웹훅 설정#

Teleport Jira 플러그인이 프로젝트를 관리하는 데 사용할 API 키를 생성했으므로, 웹훅을 생성하여 프로젝트가 업데이트될 때 Jira가 Teleport Jira 플러그인에 알릴 수 있도록 활성화합니다.

Jira로 돌아갑니다. 화면 오른쪽 상단의 톱니바퀴 메뉴를 클릭합니다. 시스템 > WebHooks > WebHook 생성을 클릭합니다.

"Name" 필드에 "Teleport Access Request Plugin"을 입력합니다. "URL" 필드에 이전에 플러그인을 위해 생성한 도메인 이름과 포트 8081을 입력합니다.

"Name" 필드에 "Teleport Access Request Plugin"을 입력합니다. "URL" 필드에 이전에 플러그인을 위해 생성한 도메인 이름과 포트 443을 입력합니다.

웹훅은 이슈가 생성, 업데이트 또는 삭제될 때만 알림을 받아야 합니다. 다른 모든 박스는 비워 둘 수 있습니다.

생성을 클릭합니다.

6/8단계. Jira Access Request 플러그인 설정#

이전에 Jira 플러그인이 Teleport와 Jira API에 연결하는 데 사용하는 자격 증명을 가져왔습니다. 이제 이 자격 증명을 사용하고 이전에 설정한 주소에서 Jira 웹훅을 실행하도록 플러그인을 설정합니다.

설정 파일 생성#

Teleport Jira 플러그인은 TOML 형식의 설정 파일을 사용합니다. 다음 명령을 실행하여 기본 설정을 생성합니다 (플러그인은 설정 파일이 /etc/teleport-jira.toml에 없으면 실행되지 않습니다):

$ teleport-jira configure | sudo tee /etc/teleport-jira.toml > /dev/null

결과는 아래와 같은 설정 파일이어야 합니다:

<div class="admonition note"><div class="admonition-title">Note</div><p>이 섹션의 내용은 원문 문서를 참조하세요. (<code>teleport-jira-cloud.toml</code>)</p></div>

Jira 플러그인의 Helm 차트는 YAML 값 파일을 사용하여 플러그인을 설정합니다. 로컬 워크스테이션에서 다음 예시를 기반으로 teleport-jira-helm.yaml 파일을 생성합니다:

<div class="admonition note"><div class="admonition-title">Note</div><p>이 섹션의 내용은 원문 문서를 참조하세요. (<code>teleport-jira-helm-cloud.yaml</code>)</p></div>

설정 파일 편집#

Teleport Jira 플러그인을 위해 생성된 설정 파일을 열고 다음 필드를 업데이트합니다:

[teleport]

Jira 플러그인은 이 섹션을 사용하여 Teleport 클러스터에 연결합니다:

If you are providing credentials to the plugin using a tbot binary that runs on a Linux server, make sure the value of identity is the same as the path of the identity file you configured tbot to generate, /opt/machine-id/identity.

Configure the plugin to periodically reload the identity file, ensuring that it does not attempt to connect to the Teleport Auth Service with expired credentials.

Add the following to the teleport section of the configuration:

refresh_identity = true

jira#

url: Jira 테넌트의 URL, 예: https://[your-jira].atlassian.net.

username: API 토큰을 생성할 때 로그인한 사용자 이름.

api_token: 이전에 가져온 Jira API 토큰.

project: 프로젝트 키(이 경우 TAR).

issue_typeTask로 유지하거나 필드를 제거할 수 있습니다. Task가 기본값입니다.

http#

[http] 설정 블록은 플러그인의 웹훅 작동 방식을 설명합니다.

listen_addr는 플러그인이 수신 대기하는 주소를 나타내며 기본값은 :8081입니다. 가이드에서 권장한 대로 플러그인 호스트에서 포트 8081을 열었다면 이 옵션을 설정하지 않아도 됩니다.

public_addr는 웹훅의 공개 주소입니다. 이전에 생성한 DNS A 레코드에 추가한 도메인 이름입니다.

https_key_filehttps_cert_file은 이 가이드를 따르기 전에 얻은 개인 키 및 인증서에 해당합니다. 을 이전에 플러그인을 위해 생성한 도메인 이름으로 지정하여 다음 값을 사용합니다:

  • https_key_file:

    $ /var/teleport-jira/tls/certificates/acme-v02.api.letsencrypt.org-directory//.key
    
  • https_cert_file:

    $ /var/teleport-jira/tls/certificates/acme-v02.api.letsencrypt.org-directory//.crt
    

jira#

url: Jira 테넌트의 URL, 예: https://[your-jira].atlassian.net.

username: API 토큰을 생성할 때 로그인한 사용자 이름.

apiToken: 이전에 가져온 API 토큰.

project: 프로젝트 키(이 경우 TAR).

issueTypeTask로 유지하거나 필드를 제거할 수 있습니다. Task가 기본값입니다.

http#

http 설정 블록은 플러그인의 웹훅 작동 방식을 설명합니다.

publicAddress: 웹훅의 공개 주소. 웹훅을 위해 생성한 도메인 이름입니다. (나중에 이 도메인 이름의 DNS 레코드를 생성합니다.)

tlsFromSecret: 웹훅에 대한 TLS 자격 증명을 포함하는 Kubernetes 시크릿의 이름. teleport-plugin-jira-tls를 사용합니다.

7/8단계. Jira 플러그인 실행#

설정을 완료한 후, 이제 플러그인을 실행하고 Jira 기반 Access Request 흐름을 테스트할 수 있습니다:

Linux 호스트에서 다음을 실행합니다:

$ sudo teleport-jira start
INFO   Starting Teleport Jira Plugin 12.1.1: jira/app.go:112
INFO   Plugin is ready jira/app.go:142

Teleport Jira 플러그인의 Helm 차트를 설치합니다:

$ helm install teleport-plugin-jira teleport/teleport-plugin-jira \
  --namespace teleport \
  --values values.yaml \
  --version (=teleport.plugin.version=)

웹훅의 도메인 이름을 Jira 플러그인 Helm 차트가 생성한 로드 밸런서의 주소와 연결하는 DNS 레코드를 생성합니다.

로드 밸런서에 도메인 이름이 있는지 IP 주소가 있는지 확인합니다:

$ kubectl -n teleport get services/teleport-plugin-jira
NAME                   TYPE           CLUSTER-IP      EXTERNAL-IP                          PORT(S)                      AGE
teleport-plugin-jira   LoadBalancer   10.100.135.75   abc123.us-west-2.elb.amazonaws.com   80:30625/TCP,443:31672/TCP   134m

EXTERNAL-IP 필드에 도메인 이름이 있으면, 웹훅의 도메인 이름이 로드 밸런서의 도메인 이름을 가리키는 CNAME 레코드를 생성합니다.

EXTERNAL-IP 필드의 값이 IP 주소인 경우, DNS A 레코드를 대신 생성합니다.

그런 다음 Jira 플러그인에 대한 서명된 TLS 자격 증명을 생성할 수 있으며, 플러그인은 이를 Kubernetes 시크릿에 쓸 것으로 예상합니다.

웹훅 상태 확인#

/status 엔드포인트로 GET 요청을 보내 Jira 웹훅이 서비스를 시작했는지 확인합니다. 웹훅이 실행 중이면 문서 본문 없이 200 상태 코드를 반환합니다:

$ curl -v https://:8081/status 2>&1 | grep "^< HTTP/2"
< HTTP/2 200
$ curl -v https://:443/status 2>&1 | grep "^< HTTP/2"
< HTTP/2 200

Access Request 생성#

이전에 생성한 myuser 사용자로 클러스터에 로그인하고 Access Request를 생성합니다:

요청을 생성하면 Access Requests 보드의 "Pending" 열에 새 작업이 표시됩니다:

새 Access Request

요청 해결#

새 Access Request에 해당하는 카드를 "Denied" 열로 이동한 다음 카드를 클릭하고 Teleport로 이동합니다. Access Request가 거부된 것을 확인할 수 있습니다.

Access Request 감사

Jira 프로젝트 보드에 접근할 수 있는 모든 사람이 보드에 반영된 Access Request의 상태를 수정할 수 있습니다. Teleport 감사 로그를 확인하여 올바른 사용자가 올바른 요청을 검토하고 있는지 확인하세요.

Access Request 검토를 감사할 때, Teleport Web UI에서 Access Request Reviewed 유형의 이벤트를 확인합니다.

8/8단계. systemd 설정#

Tip

이 단계는 Linux 머신에서 Teleport Jira 플러그인을 실행하는 경우에만 적용됩니다.

프로덕션 환경에서는 systemd와 같은 init 시스템을 통해 Teleport 플러그인 데몬을 시작하는 것을 권장합니다. systemd를 위한 권장 Teleport 플러그인 서비스 유닛 파일은 다음과 같습니다:

<div class="admonition note"><div class="admonition-title">Note</div><p>이 섹션의 내용은 원문 문서를 참조하세요. (<code>teleport-jira.service</code>)</p></div>

이를 teleport-jira.service 또는 systemd가 지원하는 다른 유닛 파일 로드 경로에 저장합니다.

$ sudo systemctl enable teleport-jira
$ sudo systemctl start teleport-jira

문제 해결#

Note

이 섹션의 내용은 원문 문서를 참조하세요. (access-plugin-troubleshooting.mdx)

Jira Access Request 플러그인 실행

원문 보기
요약

이 가이드는 Jira용 Teleport Access Request 플러그인을 설정하는 방법을 설명합니다. In Teleport Enterprise Cloud, Teleport manages the Jira integration for you, and you can enroll the Jira integration from the Teleport Web UI.

이 가이드는 Jira용 Teleport Access Request 플러그인을 설정하는 방법을 설명합니다. Teleport의 Jira 통합을 사용하면 Jira 이슈로 Access Request를 관리할 수 있습니다.

이 통합은 Teleport Cloud에서 호스팅됩니다

In Teleport Enterprise Cloud, Teleport manages the Jira integration for you, and you can enroll the Jira integration from the Teleport Web UI.

Visit the Teleport Web UI and on the left sidebar, click Add New followed by Integration:

Enroll an Access Request plugin

On the "Select Integration Type" menu, click the tile for your integration. You will see a page with instructions to set up the integration, as well as a form that you can use to configure the integration.

작동 방식#

Teleport Jira 플러그인은 Jira 프로젝트 보드를 Teleport 클러스터에서 처리된 Access Request와 동기화합니다. Teleport 내에서 Access Request 상태를 변경하면 플러그인이 보드를 업데이트합니다. 보드에서 Access Request 상태를 업데이트하면, 플러그인이 실행하는 Jira 웹훅에 알림이 전송되어 Teleport의 Access Request를 수정합니다.

사전 요구사항#

  • A running Teleport Enterprise 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:

Recommended: Configure Machine & Workload Identity to provide short-lived Teleport credentials to the plugin. Before following this guide, follow a Machine & Workload Identity deployment guide to run the tbot binary on your infrastructure.

  • 애플리케이션 및 웹훅을 생성할 권한이 있는 Jira 계정.

  • Jira 웹훅용 등록된 도메인 이름. Jira는 프로젝트 보드의 변경 사항을 웹훅에 알립니다.

  • Jira 플러그인을 실행할 환경. 다음 중 하나입니다:

    • 포트 808081이 열려 있고 호스트에 접근할 수 있는 수단(예: 워크스테이션에 SSH 포트가 노출된 OpenSSH)이 있는 Linux 가상 머신.
    • 클라우드 공급자를 통해 배포된 Kubernetes 클러스터. 이 가이드는 LoadBalancer 서비스를 통해 Jira 플러그인으로 트래픽을 허용하는 방법을 보여주므로, 환경이 이 유형의 서비스를 지원해야 합니다.
  • 플러그인이 실행하는 Jira 웹훅에 TLS 자격 증명을 제공하는 수단. TLS 인증서는 자체 서명이어서는 안 됩니다. 예를 들어, ACME 클라이언트를 사용하여 Let's Encrypt에서 웹훅의 TLS 자격 증명을 얻을 수 있습니다.

    • Linux 서버에서 플러그인을 실행하는 경우, 플러그인이 접근할 수 있는 디렉터리에 TLS 자격 증명을 제공해야 합니다.
    • Kubernetes에서 플러그인을 실행하는 경우, 플러그인이 읽을 수 있는 시크릿에 이 자격 증명을 써야 합니다. 이 가이드에서는 시크릿 이름이 teleport-plugin-jira-tls라고 가정합니다.

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/8단계. RBAC 리소스 정의#

Jira 플러그인을 설정하기 전에, Teleport 클러스터에서 Role Access Request를 활성화해야 합니다.

For the purpose of this guide, we will define an editor-requester role, which can request the built-in editor role, and an editor-reviewer role that can review requests for the editor role.

Create a file called editor-request-rbac.yaml with the following content:

kind: role
version: v7
metadata:
  name: editor-reviewer
spec:
  allow:
    review_requests:
      roles: ['editor']
---
kind: role
version: v7
metadata:
  name: editor-requester
spec:
  allow:
    request:
      roles: ['editor']
      thresholds:
        - approve: 1
          deny: 1

Create the roles you defined:

$ tctl create -f editor-request-rbac.yaml
role 'editor-reviewer' has been created
role 'editor-requester' has been created

(!docs/pages/includes/create-role-using-web.mdx!)

Allow yourself to review requests by users with the editor-requester role by assigning yourself the editor-reviewer role.

(!docs/pages/includes/add-role-to-user.mdx role="editor-reviewer"!)

Create a user called myuser who has the editor-requester role. This user cannot edit your cluster configuration unless they request the editor role:

$ tctl users add myuser --roles=editor-requester 

tctl will print an invitation URL to your terminal. Visit the URL and log in as myuser for the first time, registering credentials as configured for your Teleport cluster.

Later in this guide, you will have myuser request the editor role so you can review the request using the Teleport plugin.

2/8단계. Teleport Jira 플러그인 사용자 정의#

플러그인에 필요한 권한은 사전 설정된 access-plugin 역할에 구성되어 있습니다. 플러그인에 대한 자격 증명을 생성하려면, Machine ID 봇 사용자 또는 일반 Teleport 사용자를 정의합니다.

If you haven't set up a Machine ID bot yet, refer to the deployment guide to run the tbot binary on your infrastructure.

Next, allow the Machine ID bot to generate credentials for the access-plugin role. You can do this using tctl, replacing my-bot with the name of your bot:

$ tctl bots update my-bot --add-roles access-plugin

As with all Teleport users, the Teleport Auth Service authenticates the access-plugin user by issuing short-lived TLS credentials. In this case, we will need to request the credentials manually by impersonating the access-plugin role and user.

If you are running a self-hosted Teleport Enterprise deployment and are using tctl from the Auth Service host, you will already have impersonation privileges.

To grant your user impersonation privileges for access-plugin, define a user named access-plugin and a role named access-plugin-impersonator by adding the following YAML document into a file called access-plugin-impersonator.yaml:

kind: user
metadata:
  name: access-plugin
spec:
  roles: ['access-plugin']
version: v2
---
kind: role
version: v7
metadata:
  name: access-plugin-impersonator
spec:
  allow:
    impersonate:
      roles:
      - access-plugin
      users:
      - access-plugin

Create the user and role:

$ tctl create -f access-plugin-impersonator.yaml
user "access-plugin" has been created
role "access-plugin-impersonator" has been created

(!docs/pages/includes/create-role-using-web.mdx!)

Assign this role to the user you plan to use to generate credentials for the access-plugin role and user:

(!docs/pages/includes/add-role-to-user.mdx role="access-plugin-impersonator"!)

You will now be able to generate signed certificates for the access-plugin role and user.

3/8단계. 액세스 플러그인 ID 내보내기#

플러그인에 Teleport ID 파일 접근 권한을 부여합니다. 유출 시 위험도가 낮은 단기 ID 파일을 생성하기 위해 Machine ID를 사용하는 것을 권장하지만, 데모 배포에서는 tctl로 장기 ID 파일을 생성할 수 있습니다:

Configure tbot with an output that will produce the credentials needed by the plugin. As the plugin will be accessing the Teleport API, the correct output type to use is identity.

For this guide, the directory destination will be used. This will write these credentials to a specified directory on disk. Ensure that this directory can be written to by the Linux user that tbot runs as, and that it can be read by the Linux user that the plugin will run as.

Modify your tbot configuration to add an identity output.

If running tbot on a Linux server, use the directory output to write identity files to the /opt/machine-id directory:

services:
- type: identity
  destination:
    type: directory
    # For this guide, /opt/machine-id is used as the destination directory.
    # You may wish to customize this. Multiple outputs cannot share the same
    # destination.
    path: /opt/machine-id

If running tbot on Kubernetes, write the identity file to Kubernetes secret instead:

services:
  - type: identity
    destination:
      type: kubernetes_secret
      name: teleport-plugin-jira-identity

If operating tbot as a background service, restart it. If running tbot in one-shot mode, execute it now.

You should now see an identity file under /opt/machine-id or a Kubernetes secret named teleport-plugin-jira-identity. This contains the private key and signed certificates needed by the plugin to authenticate with the Teleport Auth Service.

Like all Teleport users, access-plugin needs signed credentials in order to connect to your Teleport cluster. You will use the tctl auth sign command to request these credentials.

The following tctl auth sign command impersonates the access-plugin user, generates signed credentials, and writes an identity file to the local directory:

$ tctl auth sign --user=access-plugin --out=identity

The plugin connects to the Teleport Auth Service's gRPC endpoint over TLS.

The identity file, identity, includes both TLS and SSH credentials. The plugin uses the SSH credentials to connect to the Proxy Service, which establishes a reverse tunnel connection to the Auth Service. The plugin uses this reverse tunnel, along with your TLS credentials, to connect to the Auth Service's gRPC endpoint.

Certificate Lifetime

By default, tctl auth sign produces certificates with a relatively short lifetime. For production deployments, we suggest using Machine & Workload Identity to programmatically issue and renew certificates for your plugin. See our Machine & Workload Identity getting started guide to learn more.

Note that you cannot issue certificates that are valid longer than your existing credentials. For example, to issue certificates with a 1000-hour TTL, you must be logged in with a session that is valid for at least 1000 hours. This means your user must have a role allowing a max_session_ttl of at least 1000 hours (60000 minutes), and you must specify a --ttl when logging in:

$ tsh login --proxy=teleport.example.com --ttl=60060

If you are running the plugin on a Linux server, create a data directory to hold certificate files for the plugin:

$ sudo mkdir -p /var/lib/teleport/plugins/api-credentials
$ sudo mv identity /var/lib/teleport/plugins/api-credentials

If you are running the plugin on Kubernetes, Create a Kubernetes secret that contains the Teleport identity file:

$ kubectl -n teleport create secret generic --from-file=identity teleport-plugin-jira-identity

Once the Teleport credentials expire, you will need to renew them by running the tctl auth sign command again.

4/8단계. Teleport Jira 플러그인 설치#

아래 지침에 따라 Teleport Jira 플러그인을 설치합니다. 플러그인을 호스트(예: EC2 인스턴스)에 배포하는지 Kubernetes 클러스터에 배포하는지에 따라 다릅니다.

Teleport Jira 플러그인은 Jira와 Teleport Proxy Service(또는 Teleport Enterprise Cloud 테넌트) 모두에 접근할 수 있는 호스트 또는 Kubernetes 클러스터에서 실행해야 합니다.

5/8단계. Jira 프로젝트 설정#

이 섹션에서는 Teleport 사용자가 Access Request를 생성하거나 업데이트할 때 Teleport 플러그인이 수정할 수 있는 Jira 프로젝트를 생성합니다. 그런 다음 플러그인은 Jira 웹훅을 사용하여 보드 상태를 모니터링하고 생성한 티켓의 변경 사항에 응답합니다.

Access Request 관리를 위한 프로젝트 생성#

Jira의 상단 탐색 바에서 프로젝트 -> 프로젝트 생성을 클릭합니다. 템플릿으로 Kanban을 선택한 다음 템플릿 사용을 클릭합니다. 회사 관리형 프로젝트 선택을 클릭합니다.

프로젝트 이름을 입력할 수 있는 화면이 표시됩니다. 이 가이드에서는 프로젝트가 "Teleport Access Requests"라고 가정하며, 기본적으로 키 TAR이 할당됩니다.

"저장소, 문서 등 연결"이 해제되어 있는지 확인한 다음 프로젝트 생성을 클릭합니다.

새 보드의 오른쪽 상단에 있는 세 점 메뉴에서 보드 설정을 클릭한 다음 을 클릭합니다. 다음 네 가지 상태가 포함되도록 보드의 상태를 편집합니다:

  1. Pending
  2. Approved
  3. Denied
  4. Expired

각 상태와 동일한 이름의 열을 생성합니다. 결과는 다음과 같아야 합니다:

Jira 보드 설정

Warning

프로젝트 보드에 이 열들이 (그리고 이 열들만) 없고 각각 동일한 이름의 상태가 없으면, Jira Access Request 플러그인이 예상치 못한 방식으로 동작합니다. 다른 모든 열과 상태를 제거하세요.

보드로 돌아가기를 클릭하여 변경 사항을 검토합니다.

Jira API 토큰 가져오기#

Access Request 플러그인이 Jira 프로젝트를 변경하는 데 사용할 API 토큰을 얻습니다. 화면 오른쪽 상단의 톱니바퀴 메뉴를 클릭한 다음 Atlassian 계정 설정을 클릭합니다. 보안 > API 토큰 생성 및 관리 > API 토큰 생성을 클릭합니다.

레이블을 선택하고 복사를 클릭합니다. 나중에 이 가이드에서 Jira 플러그인을 설정할 때 사용할 수 있도록 API 토큰을 편리한 위치(예: 비밀번호 관리자 또는 로컬 텍스트 문서)에 붙여넣습니다.

Jira 웹훅 설정#

Teleport Jira 플러그인이 프로젝트를 관리하는 데 사용할 API 키를 생성했으므로, 웹훅을 생성하여 프로젝트가 업데이트될 때 Jira가 Teleport Jira 플러그인에 알릴 수 있도록 활성화합니다.

Jira로 돌아갑니다. 화면 오른쪽 상단의 톱니바퀴 메뉴를 클릭합니다. 시스템 > WebHooks > WebHook 생성을 클릭합니다.

"Name" 필드에 "Teleport Access Request Plugin"을 입력합니다. "URL" 필드에 이전에 플러그인을 위해 생성한 도메인 이름과 포트 8081을 입력합니다.

"Name" 필드에 "Teleport Access Request Plugin"을 입력합니다. "URL" 필드에 이전에 플러그인을 위해 생성한 도메인 이름과 포트 443을 입력합니다.

웹훅은 이슈가 생성, 업데이트 또는 삭제될 때만 알림을 받아야 합니다. 다른 모든 박스는 비워 둘 수 있습니다.

생성을 클릭합니다.

6/8단계. Jira Access Request 플러그인 설정#

이전에 Jira 플러그인이 Teleport와 Jira API에 연결하는 데 사용하는 자격 증명을 가져왔습니다. 이제 이 자격 증명을 사용하고 이전에 설정한 주소에서 Jira 웹훅을 실행하도록 플러그인을 설정합니다.

설정 파일 생성#

Teleport Jira 플러그인은 TOML 형식의 설정 파일을 사용합니다. 다음 명령을 실행하여 기본 설정을 생성합니다 (플러그인은 설정 파일이 /etc/teleport-jira.toml에 없으면 실행되지 않습니다):

$ teleport-jira configure | sudo tee /etc/teleport-jira.toml > /dev/null

결과는 아래와 같은 설정 파일이어야 합니다:

<div class="admonition note"><div class="admonition-title">Note</div><p>이 섹션의 내용은 원문 문서를 참조하세요. (<code>teleport-jira-cloud.toml</code>)</p></div>

Jira 플러그인의 Helm 차트는 YAML 값 파일을 사용하여 플러그인을 설정합니다. 로컬 워크스테이션에서 다음 예시를 기반으로 teleport-jira-helm.yaml 파일을 생성합니다:

<div class="admonition note"><div class="admonition-title">Note</div><p>이 섹션의 내용은 원문 문서를 참조하세요. (<code>teleport-jira-helm-cloud.yaml</code>)</p></div>

설정 파일 편집#

Teleport Jira 플러그인을 위해 생성된 설정 파일을 열고 다음 필드를 업데이트합니다:

[teleport]

Jira 플러그인은 이 섹션을 사용하여 Teleport 클러스터에 연결합니다:

If you are providing credentials to the plugin using a tbot binary that runs on a Linux server, make sure the value of identity is the same as the path of the identity file you configured tbot to generate, /opt/machine-id/identity.

Configure the plugin to periodically reload the identity file, ensuring that it does not attempt to connect to the Teleport Auth Service with expired credentials.

Add the following to the teleport section of the configuration:

refresh_identity = true

jira#

url: Jira 테넌트의 URL, 예: https://[your-jira].atlassian.net.

username: API 토큰을 생성할 때 로그인한 사용자 이름.

api_token: 이전에 가져온 Jira API 토큰.

project: 프로젝트 키(이 경우 TAR).

issue_typeTask로 유지하거나 필드를 제거할 수 있습니다. Task가 기본값입니다.

http#

[http] 설정 블록은 플러그인의 웹훅 작동 방식을 설명합니다.

listen_addr는 플러그인이 수신 대기하는 주소를 나타내며 기본값은 :8081입니다. 가이드에서 권장한 대로 플러그인 호스트에서 포트 8081을 열었다면 이 옵션을 설정하지 않아도 됩니다.

public_addr는 웹훅의 공개 주소입니다. 이전에 생성한 DNS A 레코드에 추가한 도메인 이름입니다.

https_key_filehttps_cert_file은 이 가이드를 따르기 전에 얻은 개인 키 및 인증서에 해당합니다. 을 이전에 플러그인을 위해 생성한 도메인 이름으로 지정하여 다음 값을 사용합니다:

  • https_key_file:

    $ /var/teleport-jira/tls/certificates/acme-v02.api.letsencrypt.org-directory//.key
    
  • https_cert_file:

    $ /var/teleport-jira/tls/certificates/acme-v02.api.letsencrypt.org-directory//.crt
    

jira#

url: Jira 테넌트의 URL, 예: https://[your-jira].atlassian.net.

username: API 토큰을 생성할 때 로그인한 사용자 이름.

apiToken: 이전에 가져온 API 토큰.

project: 프로젝트 키(이 경우 TAR).

issueTypeTask로 유지하거나 필드를 제거할 수 있습니다. Task가 기본값입니다.

http#

http 설정 블록은 플러그인의 웹훅 작동 방식을 설명합니다.

publicAddress: 웹훅의 공개 주소. 웹훅을 위해 생성한 도메인 이름입니다. (나중에 이 도메인 이름의 DNS 레코드를 생성합니다.)

tlsFromSecret: 웹훅에 대한 TLS 자격 증명을 포함하는 Kubernetes 시크릿의 이름. teleport-plugin-jira-tls를 사용합니다.

7/8단계. Jira 플러그인 실행#

설정을 완료한 후, 이제 플러그인을 실행하고 Jira 기반 Access Request 흐름을 테스트할 수 있습니다:

Linux 호스트에서 다음을 실행합니다:

$ sudo teleport-jira start
INFO   Starting Teleport Jira Plugin 12.1.1: jira/app.go:112
INFO   Plugin is ready jira/app.go:142

Teleport Jira 플러그인의 Helm 차트를 설치합니다:

$ helm install teleport-plugin-jira teleport/teleport-plugin-jira \
  --namespace teleport \
  --values values.yaml \
  --version (=teleport.plugin.version=)

웹훅의 도메인 이름을 Jira 플러그인 Helm 차트가 생성한 로드 밸런서의 주소와 연결하는 DNS 레코드를 생성합니다.

로드 밸런서에 도메인 이름이 있는지 IP 주소가 있는지 확인합니다:

$ kubectl -n teleport get services/teleport-plugin-jira
NAME                   TYPE           CLUSTER-IP      EXTERNAL-IP                          PORT(S)                      AGE
teleport-plugin-jira   LoadBalancer   10.100.135.75   abc123.us-west-2.elb.amazonaws.com   80:30625/TCP,443:31672/TCP   134m

EXTERNAL-IP 필드에 도메인 이름이 있으면, 웹훅의 도메인 이름이 로드 밸런서의 도메인 이름을 가리키는 CNAME 레코드를 생성합니다.

EXTERNAL-IP 필드의 값이 IP 주소인 경우, DNS A 레코드를 대신 생성합니다.

그런 다음 Jira 플러그인에 대한 서명된 TLS 자격 증명을 생성할 수 있으며, 플러그인은 이를 Kubernetes 시크릿에 쓸 것으로 예상합니다.

웹훅 상태 확인#

/status 엔드포인트로 GET 요청을 보내 Jira 웹훅이 서비스를 시작했는지 확인합니다. 웹훅이 실행 중이면 문서 본문 없이 200 상태 코드를 반환합니다:

$ curl -v https://:8081/status 2>&1 | grep "^< HTTP/2"
< HTTP/2 200
$ curl -v https://:443/status 2>&1 | grep "^< HTTP/2"
< HTTP/2 200

Access Request 생성#

이전에 생성한 myuser 사용자로 클러스터에 로그인하고 Access Request를 생성합니다:

요청을 생성하면 Access Requests 보드의 "Pending" 열에 새 작업이 표시됩니다:

새 Access Request

요청 해결#

새 Access Request에 해당하는 카드를 "Denied" 열로 이동한 다음 카드를 클릭하고 Teleport로 이동합니다. Access Request가 거부된 것을 확인할 수 있습니다.

Access Request 감사

Jira 프로젝트 보드에 접근할 수 있는 모든 사람이 보드에 반영된 Access Request의 상태를 수정할 수 있습니다. Teleport 감사 로그를 확인하여 올바른 사용자가 올바른 요청을 검토하고 있는지 확인하세요.

Access Request 검토를 감사할 때, Teleport Web UI에서 Access Request Reviewed 유형의 이벤트를 확인합니다.

8/8단계. systemd 설정#

Tip

이 단계는 Linux 머신에서 Teleport Jira 플러그인을 실행하는 경우에만 적용됩니다.

프로덕션 환경에서는 systemd와 같은 init 시스템을 통해 Teleport 플러그인 데몬을 시작하는 것을 권장합니다. systemd를 위한 권장 Teleport 플러그인 서비스 유닛 파일은 다음과 같습니다:

<div class="admonition note"><div class="admonition-title">Note</div><p>이 섹션의 내용은 원문 문서를 참조하세요. (<code>teleport-jira.service</code>)</p></div>

이를 teleport-jira.service 또는 systemd가 지원하는 다른 유닛 파일 로드 경로에 저장합니다.

$ sudo systemctl enable teleport-jira
$ sudo systemctl start teleport-jira

문제 해결#

Note

이 섹션의 내용은 원문 문서를 참조하세요. (access-plugin-troubleshooting.mdx)