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

# ServiceNow 대상(사용자 지정 Webhook)

## 개요

ServiceNow 콘솔에서 간단한 Scripted Rest API 구성을 사용하면 Panther에서 발생한 알러트를 새 인시던트로 직접 매핑할 수 있습니다. 알러트의 내용을 [Python 탐지의 알러트 함수](/ko/detections/rules/python.md#alert-functions-in-python-detections) 그리고 [YAML 탐지의 동적 알러트 키](/ko/detections/rules/writing-simple-detections.md#dynamic-alert-keys-in-yaml-detections).

## Panther 알러트로부터 티켓을 생성하도록 ServiceNow를 구성하는 방법

Panther 알러트로부터 티켓을 생성하도록 ServiceNow를 구성하려면 ServiceNow에서 Scripted REST API를 만든 다음, ServiceNow 전달 URL을 사용하여 Panther에서 사용자 지정 웹훅 알러트 대상을 만듭니다.

{% hint style="info" %}
이 과정에 대한 추가 정보는 ServiceNow 문서에서 확인할 수 있습니다: [ServiceNow에 웹훅을 통합하는 방법](https://www.servicenow.com/community/in-other-news/how-to-integrate-webhooks-into-servicenow/ba-p/2271745).
{% endhint %}

### 사전 요구 사항

* 완료하려면 [이 과정의 1단계](#step-1-create-a-scripted-rest-api-in-servicenow), ServiceNow에서 Scripted REST API를 만들려면 ServiceNow 사용자에게 다음 권한이 있어야 합니다 `web_service_admin` 해당 역할을 보유해야 합니다.

### 1단계: ServiceNow에서 Scripted REST API 만들기

{% hint style="info" %}
ServiceNow 문서에서 Scripted REST API에 대해 자세히 알아보세요: [Scripted REST API](https://docs.servicenow.com/bundle/washingtondc-api-reference/page/integrate/custom-web-services/concept/c_CustomWebServices.html).
{% endhint %}

1. ServiceNow 콘솔에서 다음을 클릭합니다 **모든** 왼쪽 상단 모서리의 탭.
2. 다음을 확장합니다 **시스템 웹 서비스** 그리고 **스크립트 웹 서비스** 탐색 메뉴를 확장한 다음 다음을 클릭합니다 **Scripted REST API.**\ <img src="/files/fb4a992b6d014fa0279e0007e9014b6579ca4bf3" alt="In the ServiceNow console, the &#x22;All&#x22; tab is selected at the top. In the navigation menu, System Web Services is expanded, and Scripted REST APIs is highlighted." data-size="original">
3. 다음을 클릭합니다: **새로 만들기** 오른쪽 상단 모서리에서.
4. 이름과 ID를 선택합니다. 예를 들면, `Panther 인시던트 생성` 그리고 `panther_incident_creation`를 각각 클릭합니다.\
   ![The image shows the form to create a new Scripted REST Service in ServiceNow. It contains fields for Name, API ID, Protection Policy, Application, and API namespace.](/files/8000223ddaea5982e5b1fc5e99ae3d285769823a)
5. 다음을 클릭합니다: **제출**.
6. Scripted REST API 페이지에서 방금 만든 이름을 검색한 다음, 다음을 클릭합니다 **하이퍼링크된 이름.**
7. 페이지 하단 근처에서 다음을 클릭합니다 **리소스 탭.** 다음을 클릭합니다: **새로 만들기** 오른쪽 모서리의 버튼.
8. 다음을 채우세요 **Scripted REST 리소스 알러트** 페이지:
   * **이름:** 설명적인 이름을 입력합니다. 예: `Panther_알러트`.\
     ![The image shows the Scripted REST Resource configuration page in Service Now. The "Name" field has a red circle around it, and it is filled in with "Panther\_Alert".](/files/d6fd55c9d91877b594ae79585d2431e5b411422d)
   * **HTTP 메서드:** POST를 선택합니다.
   * **스크립트:** 아래의 스키마 코드를 붙여넣습니다:
     * ```
       (function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {

       	// 여러 필드를 준비합니다 
       	var data = request.body.data;
       	var title = data.title;
       	var 알러트 = JSON.stringify(data);
       	var 알러트Context = JSON.stringify(data.알러트Context);
       	var severity = data.severity;
       	var link = data.link;
       	var runbook = data.runbook;
       	var type = data.type;
       	var 알러트Id = data.알러트Id;
       	
       	var grIncident = new GlideRecord('incident');

       	grIncident.initialize();
       	
       	grIncident.setValue('short_description', title);
       	grIncident.setValue('description', 알러트 );
       	grIncident.setValue('category', type);
       	grIncident.setValue('subcategory', 알러트Id);
       	
       	//urgency를 Panther severity로 매핑
       	if (severity == "CRITICAL" || severity == "HIGH") {
       		grIncident.setValue('urgency','1');
       		grIncident.setValue('impact','1');
       	} else if (severity == "LOW" || severity == "MEDIUM") {
       		grIncident.setValue('urgency','2');
       	} else {
       		grIncident.setValue('urgency','3');
       	}
       	
       	//grIncident.insert();
       	var recResponse = grIncident.insert(handleResponse);

       	function handleResponse(recResponse, answer) {
       	// Answer는 생성된 레코드의 sys_id이거나 null
       	알러트('새로 생성된 sys_id는 - ' + answer + '가 존재합니다');
       	}

       	var url = gs.getProperty('glide.servlet.uri');

               //API의 응답을 구성하며, 이 예제는 위에서 생성된 인시던트 ID를 반환합니다.
       	var body = {};
       	body.sys_id = recResponse;
       	body.link = url + "task.do?sys_id=" + recResponse;
       	response.setBody(body);
       	
       	//대상 통합을 생성하고 테스트할 때 Panther의 예제 테스트 이벤트
       	//{"id":"Test.알러트","createdAt":"2022-04-26T03:17:32.099054303Z","severity":"INFO","type":"룰","link":"https://domain.runpanther.net","title":"이것은 테스트 알러트입니다","name":"Test 알러트","alertId":"Test.알러트","alertContext":{},"description":"이것은 테스트 알러트입니다","runbook":"멈췄나요? 문서를 확인하세요: https://docs.runpanther.io","tags":["테스트"],"version":"abcdefg"}

       })(request, response);
       ```
     * 다음 아래에서 **보안** 탭, 옆의 확인란을 선택 해제 **인증이 필요합니다**.\
       ![The Security tab is displayed in ServiceNow. The "Requires Authentication" box is circled, and the box next to it is not checked.](/files/0aa38bb85dbb9430ff7b5c30d962a41b39e3e61d)
9. 다음을 클릭합니다: **제출**.

{% hint style="warning" %}
위에 제공된 스키마는 Panther의 알러트 payload를 ServiceNow 티켓의 관련 필드에 매핑합니다. The [ServiceNow 블로그](https://community.servicenow.com/community?id=community_blog\&sys_id=886d2a29dbd0dbc01dcaf3231f9619b0) 에서는 POST payload를 수신하는 다른 예시도 제공합니다. 각 고객 환경은 다르므로, 알러트 payload가 ServiceNow 티켓에서 처리되고 파싱되는 방식에 가장 적합한 것을 선택하세요.
{% endhint %}

### 2단계: Panther에서 사용자 지정 웹훅 통합 만들기

1. Panther 콘솔의 왼쪽 탐색 표시줄에서 다음을 클릭합니다: **구성 > 알러트 대상.**
2. 다음을 클릭합니다: **+첫 번째 대상 추가**.
   * 이미 대상을 생성한 경우, 클릭하세요 **새로 만들기** 페이지 오른쪽 상단에서 새 대상을 추가하세요.
3. 다음을 클릭합니다: **Custom Webhook** 타일.
4. 다음에서 **웹훅 대상 구성** 페이지에서 양식을 작성하세요:
   * **표시 이름:** 설명적인 이름을 입력하세요.
   * **Custom Webhook URL**: Custom Webhook 전달 URL을 입력하세요.
     * 웹훅 URL의 형식은 다음과 같습니다: `https://<your_domain>.service-now.com/<base_api_path>`
     * 이 값은 ServiceNow 콘솔에서 다음 값들을 결합하여 만들 수 있습니다:
       * 브라우저 주소 표시줄의 도메인
       * 다음의 값 **기본 API 경로** 필드

         <figure><img src="/files/08da2401185da4b9e68953450c5f7fc37639c56a" alt="The servicenow console is shown, with various fields visible, like Name and API ID. Two areas are highlighted: the domain in the URL address bar, and the Base API path field."><figcaption></figcaption></figure>
   * **심각도 수준**: 이 대상에 보낼 알러트의 심각도 수준을 선택하세요.
   * **기본 알러트 유형**: 이 대상으로 보낼 알러트 유형을 선택하세요.
   * **로그 유형**: 기본적으로 모든 로그 유형의 알러트를 전송합니다. 특정 로그 유형의 알러트만 보내려면 여기에 로그 유형을 지정하세요.
   * **수동 전송 허용**: 수동으로 전송할 수 있도록 하려면 이 토글을 켜세요 [알러트를 수동으로 전송](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/062a1e847a2c987d6564d803af42da47e9f80da8)
5. 다음을 클릭합니다: **대상 추가**.
6. 다음을 클릭합니다: **테스트 알러트 보내기** 모든 것이 올바르게 작동하는지 확인하기 위해.
   * 이제 ServiceNow Incidents 테이블에 테스트 이벤트가 존재해야 합니다.\
     ![The image shows the Incidents Table in ServiceNow. There is a test event highlighted in the list.](/files/1f6cbbc9ff1760fe67babf0a6bbc5f8ec5740ff9)
7. 다음을 클릭합니다: **설정 완료.**

### 예시

다음을 클릭합니다: **테스트 알러트** 버튼을 눌러 알러트를 생성하고 ServiceNow로 전송합니다. 알러트의 페이로드는 아래에 표시됩니다:

```json
{"id":"Test.알러트","createdAt":"2022-04-26T03:17:32.099054303Z","severity":"INFO","type":"룰","link":"https://domain.runpanther.net","title":"이것은 테스트 알러트입니다","name":"테스트 알러트","alertId":"Test.알러트","alertContext":{},"description":"이것은 테스트 알러트입니다","runbook":"막히셨나요? 문서를 확인해 보세요: https://docs.runpanther.io","tags":["테스트"],"version":"1"}
```

알러트가 ServiceNow에 수신되면, ServiceNow Incident 테이블에 인시던트가 생성됩니다:

<figure><img src="/files/d366254025013cf2142e96a1f284a9e112fa140d" alt="The Incident Table in ServiceNow contains a test alert."><figcaption></figcaption></figure>


---

# 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/servicenow.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.
