> 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).

# 맞춤형 웹훅 대상

## 개요

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

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

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

### Panther의 웹훅 호출 인증하기

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

### 전달 및 Ack

웹훅은 Panther의 `POST` 요청을 HTTP 상태 코드의 `2XX` 범위 내에서 수락하고 확인해야 합니다. 네트워크 장애나 비 `2XX` 코드가 있었다면, Panther는 영구 실패 전에 요청을 최대 열(10) 번까지 재시도합니다.

웹훅 응답 본문은 전달 상태에 저장되며, 이는 알러트 상세 페이지에서 확인할 수 있습니다.

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

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

1. Panther Console에 로그인합니다.
2. 왼쪽 사이드바에서 **알러트 대상**.
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>

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

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

<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>severity</code></td><td><code>문자열</code></td><td>알러트의 심각도</td></tr><tr><td><code>유형</code></td><td><code>문자열</code></td><td>알러트의 유형</td></tr><tr><td><code>link</code></td><td><code>문자열</code></td><td>Panther Console의 알러트 링크</td></tr><tr><td><code>title</code></td><td><code>문자열</code></td><td>알러트 제목</td></tr><tr><td><code>name</code></td><td><code>문자열</code></td><td>알러트의 디택션 이름</td></tr><tr><td><code>alertId</code></td><td><code>문자열</code></td><td>Panther Backend의 알러트 식별자</td></tr><tr><td><code>description</code></td><td><code>문자열</code></td><td>알러트와 관련된 설명</td></tr><tr><td><code>runbook</code></td><td><code>문자열</code></td><td>알러트와 관련된 런북</td></tr><tr><td><code>tags</code></td><td><code>string[]</code></td><td>알러트와 관련된 태그 목록</td></tr><tr><td><code>version</code></td><td><code>문자열</code></td><td>알러트의 디택션 버전 식별자</td></tr><tr><td><code>alertContext</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",
  "severity": "INFO",
  "type": "룰",
  "link": "https://runpanther.io/alerts/b90c19e66e160e194a5b3b94ec27fb7c",
  "title": "새 알러트: [123.123.123.123]에서 의심스러운 트래픽이 디택션됨",
  "name": "의심스러운 IP 모니터링",
  "alertId": "b90c19e66e160e194a5b3b94ec27fb7c",
  "alertContext": {
    "key": "value" // alertContext 내용은 디택션에서 구성됩니다
  },
  "description": "이 룰은 IP 주소 허용 목록 밖의 모든 활동에 대해 경고합니다",
  "runbook": "",
  "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("success"); // (선택 사항) 응답 본문
       });
     }
   }

   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 콘솔**, 새로 만들 **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.
