> 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/custom_webhook.md).

# 사용자 지정 Webhook 대상

## 개요

대상은 룰, 정책, 시스템 상태 알림 및 룰 오류로부터 알러트를 받는 통합입니다. Panther는 알러트를 수신할 대상으로 Custom Webhook을 구성할 수 있도록 지원합니다.

Custom Webhook 대상에는 다음만 필요합니다 `URL` HTTP 요청을 받을 수 있는 서비스로 `POST` 다음을 포함하는 요청 `JSON` 페이로드. 이 대상 유형은 Panther가 다른 서드파티 통합과 통신할 수 있도록 설계되었습니다.

## Panther에서 Custom Webhook 알러트 대상을 설정하는 방법

### Panther에서 전송되는 webhook 호출 인증하기

Panther의 webhook 호출로 전달 위치에 인증 자격 증명을 전달하려면 사용자 지정 HTTP 헤더를 추가할 수 있습니다. 설정하는 동안 [webhook 설정](#set-up-a-custom-webhook-in-panther), 하나 이상의 **헤더 이름** / **헤더 값** 쌍.

### 전달 및 확인 응답

webhook은 Panther의 `POST` HTTP 상태 코드로 요청에 응답해야 합니다 `2XX` 범위입니다. 네트워크 장애나 비 `2XX` 코드가 반환되면, Panther는 영구 실패 전에 해당 요청을 최대 열(10) 번까지 재시도합니다.

webhook 응답 본문은 전달 상태에 저장되며 알러트 상세 페이지에서 볼 수 있습니다.

영구적인 전달 실패가 발생하면, Panther는 로그를 남기고 워크플로 연속성을 제공합니다. 알러트 상세 페이지를 방문하여 전달 상태 섹션을 확인하면 알러트를 수동으로 다시 보낼 수 있습니다.

### Panther에서 사용자 지정 webhook 설정하기

1. Panther 콘솔에 로그인합니다.
2. 왼쪽 사이드바에서 클릭하세요 **Configure > 알러트 대상**.
3. 다음을 클릭합니다: **+첫 번째 대상 추가**.
   * 이미 대상을 생성한 경우, 클릭하세요 **새로 만들기** 페이지 오른쪽 상단에서 새 대상을 추가하세요.
4. 다음을 클릭합니다: **Custom Webhook**.
5. 양식을 작성합니다:
   * **표시 이름**: 대상 식별을 위해 친숙한 이름을 추가하세요.
   * **Custom Webhook URL**: Custom Webhook 전달 URL을 입력하세요.
     * 다음을 따르는 경우 [ngrok 예제](#custom-webhook-example) 이 문서의 뒤쪽에서, 다음을 입력하게 됩니다 `http` 또는 `https` **전달** 다음의 URL `ngrok` 출력.
   * **심각도 수준**: 이 대상으로 보낼 알러트의 심각도 수준을 선택하세요.
   * **기본 알러트 유형**: 이 대상으로 보낼 알러트 유형을 선택하세요.
   * **로그 유형**: 기본적으로 모든 로그 유형의 알러트를 전송합니다. 특정 로그 유형의 알러트만 보내려면 여기에 로그 유형을 지정하세요.
   * **수동 전송 허용**: 수동으로 전송할 수 있도록 하려면 이 토글을 켜세요 [알러트를 수동으로 전송](https://docs.panther.com/alerts#manual-alert-dispatch) 이 대상으로.\
     ![In the Panther Console, the "Configure your Custom Webhook Destination" page is displayed. It contains fields for Display Name, Custom Webhook URL, Severity, Alert Types, and Log Types.](/files/f614f05e64a68aac101d7021628142afcd23627e)
   * **사용자 지정 HTTP 헤더**: 알러트를 보내는 POST 요청에 포함할 하나 이상의 사용자 지정 HTTP 헤더를 선택적으로 제공하세요.\
     ![Next to "Add custom HTTP headers?" the toggle is set to "yes."](/files/551b79a0c53253143394f4fb470b8da5dd67bdf1)
6. 다음을 클릭합니다: **대상 추가**.
7. 마지막 페이지에서, 필요하면 클릭 **테스트 알러트 보내기** 테스트 페이로드를 사용하여 통합을 테스트합니다. 완료되면 클릭 **설정 완료**.

<figure><img src="/files/5da6c2609108c1b78e31f61244da65e0f12198be" alt="The screen displays a large green circle with a checkmark in it. A message at the top says &#x22;Everything looks good!&#x22; There is a blue button at the button labeled &#x22;Send Test Alert&#x22; and below that there is a link labeled &#x22;Finish Setup.&#x22;" width="563"><figcaption></figcaption></figure>

### 사용자 지정 Webhook 알러트 스키마

사용자 지정 Webhook은 다음 필드를 포함하는 페이로드를 전달합니다:

<table><thead><tr><th width="172">필드</th><th width="121.33333333333331">유형</th><th>설명</th></tr></thead><tbody><tr><td><code>id</code></td><td><code>문자열</code></td><td>알러트의 디택션 식별자</td></tr><tr><td><code>createdAt</code></td><td><code>문자열</code></td><td>AWSDateTime(ISO-8601) 형식의 알러트 생성 시간</td></tr><tr><td><code>심각도</code></td><td><code>문자열</code></td><td>알러트의 심각도</td></tr><tr><td><code>유형</code></td><td><code>문자열</code></td><td>알러트의 유형</td></tr><tr><td><code>링크</code></td><td><code>문자열</code></td><td>Panther Console의 알러트 링크</td></tr><tr><td><code>제목</code></td><td><code>문자열</code></td><td>알러트의 제목</td></tr><tr><td><code>이름</code></td><td><code>문자열</code></td><td>알러트의 디택션 이름</td></tr><tr><td><code>알러트ID</code></td><td><code>문자열</code></td><td>Panther Backend의 알러트 식별자</td></tr><tr><td><code>설명</code></td><td><code>문자열</code></td><td>알러트와 관련된 설명</td></tr><tr><td><code>런북</code></td><td><code>문자열</code></td><td>알러트와 관련된 런북</td></tr><tr><td><code>태그</code></td><td><code>문자열[]</code></td><td>알러트와 관련된 태그 목록</td></tr><tr><td><code>버전</code></td><td><code>문자열</code></td><td>알러트의 디택션에 대한 버전 식별자</td></tr><tr><td><code>알러트 컨텍스트</code></td><td><code>object</code></td><td><a href="/pages/976596f76fb276afe164a6e4430da9acfae8f601#alert_context">알러트 컨텍스트</a> 알러트에 첨부된 데이터</td></tr></tbody></table>

해당 [AWSDateTime](https://docs.aws.amazon.com/appsync/latest/devguide/scalars.html) 스칼라 타입은 유효한 확장 ISO 8601 DateTime 문자열을 나타냅니다. 즉, 이 스칼라 타입은 다음 형식의 datetime 문자열을 허용합니다 `YYYY-MM-DDThh:mm:ss.sssZ`. 초 필드 뒤의 필드는 나노초 필드입니다. 1\~9자리 숫자를 허용할 수 있습니다. 초 필드와 나노초 필드는 선택 사항입니다(나노초 필드를 사용하려면 초 필드를 지정해야 합니다). 이 스칼라에서는 시간대 오프셋이 필수입니다. 시간대 오프셋은 Z(UTC 시간대를 나타냄)이어야 하며, 또는 다음 형식이어야 합니다 `±hh:mm:ss`. 시간대 오프셋의 초 필드는 ISO 8601 표준의 일부가 아니더라도 유효한 것으로 간주됩니다.

#### 예시 JSON 페이로드:

```json
{
  "id": "AllLogs.IPMonitoring",
  "createdAt": "2020-10-13T03:35:24Z",
  "심각도": "정보",
  "유형": "룰",
  "링크": "https://runpanther.io/알러트들/b90c19e66e160e194a5b3b94ec27fb7c",
  "제목": "새 알러트: [123.123.123.123]에서 의심스러운 트래픽이 감지됨",
  "이름": "의심스러운 IP 모니터링",
  "알러트Id": "b90c19e66e160e194a5b3b94ec27fb7c",
  "알러트Context": {
    "키": "값" // 알러트Context 내용은 디택션에서 구성됩니다
  },
  "설명": "이 룰은 IP 주소 허용 목록 밖의 모든 활동에 대해 알러트를 발생시킵니다",
  "런북": "",
  "tags": [
    "네트워크 모니터링",
    "위협 인텔"
  ],
  "version": "CJm9PiaXV0q8U0JhoFmE6L21ou7e5Ek0"
}
```

## 커스텀 웹훅 예시

다음 예시는 Panther 알러트를 커스텀 웹훅으로 전송하여 페이로드를 간단한 [Node.js](https://nodejs.org/en/) 를 통해 프록시된 서버 [Ngrok](https://ngrok.com/).

1. 명령줄을 엽니다.
2. 생성합니다 [ngrok 계정](https://dashboard.ngrok.com/signup) 그리고 [설치](https://ngrok.com/download) ngrok
   1. 다음 구성 명령을 실행합니다: `ngrok config add-authtoken <token>`
   2. 포트 8081에서 서비스를 시작하려면 이 명령을 실행합니다: `ngrok http 8081`
3. [Node.js 설치](https://nodejs.org/en/download).
4. 파일을 생성하고, `webhook.js`, 그런 다음 다음 코드 조각을 붙여넣습니다:

   ```javascript
   const http = require('http')
   const util = require('util')
   const port = 8081

   const requestHandler = (req, res) => {

     if (req.method === 'POST') {
       let body = '';
       req.on('data', chunk => {
         body += chunk.toString();
       });
       req.on('end', () => {
         console.log(util.inspect(JSON.parse(body), false, null, true));
         res.statusCode = 200; // 요청을 반드시 확인해야 합니다
         res.end("성공"); // (선택 사항) 응답 본문
       });
     }
   }

   const server = http.createServer(requestHandler)

   server.listen(port, (err) => {
     if (err) {
       return console.log('문제가 발생했습니다', err)
     }

     console.log(`서버가 ${port}에서 수신 중입니다`)
   })
   ```
5. 다른 터미널을 열고 Node.js 서버를 시작합니다:

   ```shell
   > node webhook.js
   서버가 8081에서 수신 중입니다
   ```
6. 다음의 **Panther Console**, 새로 만들고 **Custom Webhook** 그리고 다음을 붙여넣습니다 **전달** 다음의 URL을 `ngrok` 에 **Custom Webhook URL** 필드에 붙여넣습니다.
   * 예를 들어, 전달 URL은 다음과 같을 수 있습니다: `https://2d9c-174-27-211-147.ngrok-free.app`
7. 다음을 클릭합니다: **테스트 알러트를 보내세요** node.js 서버가 테스트 이벤트를 기록하는지 확인합니다.

## 대상에 대한 추가 정보

알러트 라우팅 순서, 대상 수정 또는 삭제, 워크플로 자동화에 대한 자세한 내용은 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/custom_webhook.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.
