> For the complete documentation index, see [llms.txt](https://docs.panther.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.panther.com/ko/alerts/destinations/pubsub.md).

# Google Pub/Sub 대상

## 개요

대상은 룰, 정책, 시스템 상태 알러트, 그리고 룰 오류로부터 알러트를 받는 통합입니다. Panther는 다음을 구성하는 것을 지원합니다 [Google Pub/Sub](https://cloud.google.com/pubsub?hl=en) 토픽을 알러트를 받게 될 대상으로 사용합니다.

## Panther에서 Google Pub/Sub 알러트 대상 설정 방법

### **1단계: 생성** 필수 Google Cloud Platform(GCP) 인프라

Panther가 알러트를 Pub/Sub 토픽에 메시지로 게시하도록 하려면, 토픽(새 토픽이든 기존 토픽이든)과 자격 증명 파일이 필요합니다. Panther는 GCP에 인증하기 위해 Google Cloud [Workload Identity Federation](https://cloud.google.com/iam/docs/workload-identity-federation) 또는 [서비스 계정](https://cloud.google.com/iam/docs/service-account-overview).

{% tabs %}
{% tab title="서비스 계정 인증" %}

1. 아직 없다면, [Pub/Sub 토픽을 생성하세요](https://cloud.google.com/pubsub/docs/create-topic#creating_a_topic) 알림을 위해.
   * 다음을 사용하여 토픽을 만들 수 있습니다: `gcloud` CLI 도구와 다음 명령 형식을 사용합니다: `gcloud pubsub topics create $TOPIC_ID`
2. [IAM API를 사용 설정합니다](https://console.cloud.google.com/apis/library/iam.googleapis.com).
3. [새 Google Cloud 서비스 계정을 만듭니다](https://cloud.google.com/iam/docs/creating-managing-service-accounts). 계정을 다음을 사용하여 만들려면 `gcloud` CLI 도구를 사용하여 다음 명령 형식을 사용합니다:

   ```
   gcloud iam service-accounts create SA-NAME \
       --description="DESCRIPTION" \
       --display-name="DISPLAY_NAME"
   ```

   * Panther가 이 GCS 통합을 위해 만든 인프라에 액세스할 때 이 이메일을 사용하므로, 계정 이메일 주소를 반드시 메모해 두세요.
4. 계정에 필요한 IAM 역할을 할당합니다.
   * 다음 권한은 Pub/Sub 구독과 토픽이 있는 프로젝트에 필요합니다:

     <table data-header-hidden><thead><tr><th width="327.374982940047" align="center">필수 권한</th><th width="294.15662026309724" align="center">역할</th><th width="208" align="center">조건</th></tr></thead><tbody><tr><td align="center"><code>pubsub.topics.publish</code></td><td align="center"><code>roles/pubsub.publisher</code></td><td align="center"><em>토픽 이름</em></td></tr></tbody></table>

     * **참고:** 특정 리소스의 권한에 대해 조건 또는 IAM 정책을 설정할 수 있습니다. 이는 서비스 계정의 IAM 페이지(아래 예시 스크린샷 참조) 또는 특정 리소스의 페이지에서 수행할 수 있습니다.\
       ![There are two section titles, "Service account details" and "Grant this service account access to project"](/files/4faa9ad468d917bac9ce037e0f0a804ca3cb9924)
     * **참고:** 다음을 사용하여 권한을 만들 수 있습니다: `gcloud` CLI 도구:
       * `gcloud projects add-iam-policy-binding $PROJECT_ID --member="serviceAccount:$SERVICE_ACCOUNT_EMAIL" --role="roles/pubsub.publisher"`
5. [JSON 키 파일 생성](https://cloud.google.com/iam/docs/creating-managing-service-account-keys) 서비스 계정용으로, Panther에서 GCP 인프라에 인증하는 데 사용됩니다.
   * gcloud CLI 도구를 사용하여 JSON 키 파일을 만들려면 다음 명령 형식을 실행합니다:\
     `gcloud iam service-accounts keys create $KEYFILE_PATH --iam-account=$SERVICE_ACCOUNT_EMAIL`
   * 대안: 위 명령을 로컬 대신 GCP의 터미널에서 실행할 수 있습니다:
     1. 오른쪽 상단의 3개 점 아이콘 메뉴를 클릭한 다음 **다운로드**.
        * ![A dropdown menu is shown below a three-dots icon.](/files/3795f2e6340c4cbf7221fc15a478e410d67cc099)
     2. 찾아보기를 위해 폴더 아이콘을 클릭합니다.
     3. 키 파일로 이동하여 선택한 다음 **다운로드**.
        {% endtab %}

{% tab title="Workload Identity Federation 인증" %}

1. 아직 없다면, [Pub/Sub 토픽을 생성하세요](https://cloud.google.com/pubsub/docs/admin#creating\\\\\\_a\\\\\\_topic) 알림을 위해.
   * 다음을 사용하여 토픽을 만들 수 있습니다: `gcloud` CLI 도구와 다음 명령 형식을 사용합니다: `gcloud pubsub topics create $TOPIC_ID`
2. [IAM API를 사용 설정합니다](https://console.cloud.google.com/apis/library/iam.googleapis.com).
3. [AWS로 Workload Identity Federation 구성](https://cloud.google.com/iam/docs/workload-identity-federation-with-other-clouds):
   1. 다음을 [속성 매핑 및 조건을 정의하는](https://cloud.google.com/iam/docs/workload-identity-federation-with-other-clouds#mappings-and-conditions)동안 다음 예를 참고하세요:
      * 예시 [속성 매핑](https://cloud.google.com/iam/docs/workload-identity-federation#mapping):

<table><thead><tr><th width="250.04296875">Google</th><th width="437.63671875">AWS</th><th data-hidden></th></tr></thead><tbody><tr><td>google.subject</td><td>assertion.arn.extract('arn:aws:sts::{account_id}:')+":"+assertion.arn.extract('assumed-role/{role_and_session}').extract('/{session}')</td><td></td></tr><tr><td>attribute.account</td><td>assertion.account</td><td></td></tr></tbody></table>

* 예시 [속성 조건](https://cloud.google.com/iam/docs/workload-identity-federation#conditions): `attribute.account=="<PANTHER_AWS_ACCOUNT_ID>"`

{% hint style="warning" %}
다음의 값은 `google.subject` 속성 [은 127자를 초과할 수 없습니다](https://cloud.google.com/iam/docs/workload-identity-federation#mapping). 다음을 사용할 수 있습니다 [공통 표현 언어(CEL) 표현식](https://cloud.google.com/iam/docs/workload-identity-federation#mapping) AWS가 발급한 토큰의 속성을 변환하거나 결합하기 위해서입니다. 위에서 제안한 표현식은 이를 고려하며, arn을 Panther 엔티티를 고유하게 식별하는 값으로 "추출"하려는 시도입니다. AWS 속성에 관한 자세한 내용은 "Example 2 - Called by user created with AssumeRole"에서 [이 페이지](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html).
{% endhint %}

4. 당신이 [아이덴티티 풀에 제공자를 추가할 때](https://cloud.google.com/iam/docs/workload-identity-federation-with-other-clouds#aws), 다음을 선택합니다: **AWS**.
5. 계정에 필요한 IAM 역할을 할당합니다.

* 다음 권한은 Pub/Sub 구독과 토픽이 있는 프로젝트에 필요합니다:

  <table data-header-hidden><thead><tr><th width="327.374982940047" align="center">필수 권한</th><th width="294.15662026309724" align="center">역할</th><th width="208" align="center">조건</th></tr></thead><tbody><tr><td align="center"><strong>필요한 권한</strong></td><td align="center"><strong>역할</strong></td><td align="center"><strong>범위</strong></td></tr><tr><td align="center"><code>pubsub.topics.publish</code></td><td align="center"><code>roles/pubsub.publisher</code></td><td align="center"><em>토픽 이름</em></td></tr></tbody></table>

  * **참고:** 특정 리소스의 권한에 대해 조건 또는 IAM 정책을 설정할 수 있습니다. 이는 GCP의 IAM 섹션(아래 예시 스크린샷 참조) 또는 특정 리소스의 페이지에서 수행할 수 있습니다.\
    ![In the Google Cloud console, an "IAM" navigation item is circled. In a slide-out panel, sections titled, "Add principals" and "Assign roles" are circled.](/files/73836bc6de4366699cadd9a43a19afd28d5eb5d7)
  * **참고:** 다음을 사용하여 권한을 만들 수 있습니다: `gcloud` CLI 도구, 여기서 `$PRINCIPAL_ID` 는 다음과 같을 수 있습니다:\
    `principalSet://iam.googleapis.com/projects/<THE_ACTUAL_GOOGLE_PROJECT_NUMBER>/locations/global/workloadIdentityPools/<THE_ACTUAL_POOL_ID>/attribute.account/<THE_ACTUAL_PANTHER_AWS_ACCOUNT_ID>`
    * `gcloud projects add-iam-policy-binding $PROJECT_ID --member="$PRINCIPAL_ID" --role="roles/pubsub.publisher"`

6. [자격 증명 구성 파일 다운로드](https://cloud.google.com/iam/docs/workload-download-cred-and-grant-access), Panther에서 GCP 인프라에 인증하는 데 사용됩니다.

* gcloud CLI 도구를 사용하여 자격 증명 구성 파일을 생성하려면 다음 명령 형식을 사용합니다:\
  `gcloud iam workload-identity-pools create-cred-config projects/$PROJECT_NUMBER/locations/global/workloadIdentityPools/$POOL_ID/providers/$PROVIDER_ID --aws --output-file=config.json`
  {% endtab %}
  {% endtabs %}

### 2단계: Panther에서 Google Pub/Sub 알러트 대상 구성

1. Panther Console에서 다음으로 이동합니다 **구성** > **알러트 대상.**
2. 다음을 클릭합니다: **+ 첫 번째 대상 추가**.
   * 이미 대상을 생성한 경우, 클릭하세요 **새로 만들기** 페이지 오른쪽 상단에서 새 대상을 추가하세요.
3. 다음을 클릭합니다: **Google Pub/Sub**.
4. Google Pub/Sub 대상을 구성하려면 양식을 작성하세요:
   * **표시 이름**: 설명적인 이름을 입력하세요.
   * **프로젝트 ID**: 프로젝트 ID를 입력하세요.
   * **파일 업로드**: 에서 생성한 키 파일 또는 자격 증명 구성 파일을 추가하세요 [1단계](#step-1-create-required-google-cloud-platform-gcp-infrastructure).
   * **토픽 ID**: 토픽 ID를 입력하세요.
   * **심각도**: 이 대상으로 보낼 알러트의 심각도 수준을 선택하세요.
   * **알러트 유형**: 이 대상으로 보낼 알러트 유형을 선택하세요.
   * **로그 유형**: 기본적으로 모든 로그 유형의 알러트를 전송합니다. 특정 로그 유형의 알러트만 보내려면 여기에 로그 유형을 지정하세요.
   * **수동 전송 허용**: 수동으로 전송할 수 있도록 하려면 이 토글을 켜세요 [알러트를 수동으로 전송](https://docs.panther.com/alerts#manual-alert-dispatch) 이 대상으로.

     <figure><img src="/files/6d41e3a1d5ea68ac87c2b1d62e7f7b79153566f2" alt="Under a &#x22;Configure your GCP Pub/Sub Destination&#x22; header is a form with various fields, like Display Name, Project ID, and Topic ID. At the bottom is an &#x22;Add Destination&#x22; button." width="375"><figcaption></figcaption></figure>
5. 다음을 클릭합니다: **대상 추가**.
6. 다음을 클릭합니다: **설정 완료** 설정을 완료하려면, 또는 **테스트 알러트 보내기** 설정을 테스트하려면.

## 대상에 대한 추가 정보

알러트 라우팅 순서, 대상 수정 또는 삭제, 워크플로 자동화에 대한 자세한 내용은 Panther 문서를 참조하세요: [대상](https://docs.panther.com/destinations).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.panther.com/ko/alerts/destinations/pubsub.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
