ServiceNow 대상(커스텀 웹후크)

Panther의 커스텀 웹후크 옵션을 사용하여 ServiceNow 경고 설정하기

개요

ServiceNow 콘솔에서 간단한 Scripted Rest API 구성으로 Panther에서 발생한 경보를 새로운 인시던트로 직접 매핑할 수 있습니다. 경보의 내용을 다음으로 사용자 지정할 수 있습니다 Python 탐지의 alert 함수YAML 탐지의 동적 alert 키.

Panther 경보로부터 티켓을 생성하도록 ServiceNow를 구성하는 방법

Panther 경보로부터 티켓을 생성하도록 ServiceNow를 구성하려면 ServiceNow에서 Scripted REST API를 생성한 다음 ServiceNow 전달 URL을 사용하여 Panther에서 사용자 지정 웹후크 경보 대상을 생성합니다.

circle-info

이 과정에 대한 추가 정보는 ServiceNow 문서에서 확인할 수 있습니다: Webhooks를 ServiceNow에 통합하는 방법arrow-up-right.

전제 조건

  • 완료하려면 이 프로세스의 1단계ServiceNow에서 Scripted REST API를 생성하려면, ServiceNow 사용자에게 다음 권한이 있어야 합니다 web_service_admin 역할을 가져야 합니다.

1단계: ServiceNow에서 Scripted REST API 생성

circle-info

ServiceNow 문서에서 Scripted REST API에 대해 자세히 알아보세요: Scripted REST APIarrow-up-right.

  1. ServiceNow 콘솔에서 왼쪽 상단의 모든 탭을 클릭합니다.

  2. 다음을 확장합니다 System Web ServicesScripted Web Services 네비게이션을 확장한 다음 Scripted REST APIs를 클릭합니다. In the ServiceNow console, the "All" tab is selected at the top. In the navigation menu, System Web Services is expanded, and Scripted REST APIs is highlighted.

  3. 클릭 새로 만들기 오른쪽 상단 코너.

  4. 이름과 ID를 선택합니다. 예를 들어 Panther Incident Creationpanther_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.

  5. 클릭 제출.

  6. Scripted Rest API 페이지에서 방금 생성한 이름을 검색합니다. 하이퍼링크된 이름을 클릭합니다.

  7. 페이지 하단 근처에서 Resources 탭을 클릭합니다. 다음 항목을 클릭하십시오 새로 만들기 오른쪽 코너의 버튼.

  8. 다음을 작성하세요 Scripted REST Resource Alert 페이지:

    • 이름: 설명적인 이름을 입력합니다. 예: Panther_Alert. 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".

    • HTTP 메서드: POST를 선택합니다.

    • 스크립트: 아래의 스키마 코드를 붙여넣습니다:

      • (function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
        
        	// 다양한 필드를 준비합니다 
        	var data = request.body.data;
        	var title = data.title;
        	var alert = JSON.stringify(data);
        	var alertContext = JSON.stringify(data.alertContext);
        	var severity = data.severity;
        	var link = data.link;
        	var runbook = data.runbook;
        	var type = data.type;
        	var alertId = data.alertId;
        	
        	var grIncident = new GlideRecord('incident');
        
        	grIncident.initialize();
        	
        	grIncident.setValue('short_description', title);
        	grIncident.setValue('description', alert );
        	grIncident.setValue('category', type);
        	grIncident.setValue('subcategory', alertId);
        	
        	// 긴급도를 Panther 심각도로 매핑
        	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) {
        	// 응답은 생성된 레코드의 sys_id 또는 null이 됩니다
        	alert('새로 생성된 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.Alert","createdAt":"2022-04-26T03:17:32.099054303Z","severity":"INFO","type":"RULE","link":"https://domain.runpanther.net","title":"This is a Test Alert","name":"Test Alert","alertId":"Test.Alert","alertContext":{},"description":"This is a Test Alert","runbook":"Stuck? Check out our docs: https://docs.runpanther.io","tags":["test"],"version":"abcdefg"}
        
        })(request, response);
      • indicators: [ url ] 보안 탭에서 다음 항목 옆의 체크박스를 해제합니다 인증 필요. The Security tab is displayed in ServiceNow. The "Requires Authentication" box is circled, and the box next to it is not checked.

  9. 클릭 제출.

circle-exclamation

2단계: Panther에서 사용자 지정 Webhook 통합 생성

  1. Panther 콘솔의 왼쪽 탐색 바에서 클릭하십시오 Configure > Alert Destinations.

  2. 클릭 +첫 번째 대상을 추가하세요.

    • 이미 대상을 생성한 경우, 새 대상을 추가하려면 새로 만들기 페이지 오른쪽 상단을 클릭하세요.

  3. 다음 항목을 클릭하십시오 커스텀 웹훅 타일.

  4. 페이지에서 웹후크 대상 구성 페이지에서 양식을 작성하세요:

    • 표시 이름: 설명적인 이름을 입력하세요.

    • 사용자 지정 웹후크 URL: 사용자 지정 웹후크 전달 URL을 입력하세요.

      • 웹후크 URL은 다음 형식입니다: https://<your_domain>.service-now.com/<base_api_path>

      • 이 값은 ServiceNow 콘솔에서 다음 값을 결합하여 만들 수 있습니다:

        • 브라우저 주소 표시줄의 도메인

        • 다음 항목의 값 Base API path 필드

          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.
    • 경고의 심각도는 탐지의: 이 대상으로 전송할 경고의 심각도 수준을 선택하세요.

    • 기본 알림 유형: 이 대상으로 전송할 경고 유형을 선택하세요.

    • 로그 유형: 기본적으로 모든 로그 유형의 알림을 전송합니다. 특정 로그 유형에서만 알림을 전송하려면 여기에서 로그 유형을 지정하세요. 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.

  5. 클릭 대상 추가.

  6. 클릭 테스트 알림 전송 모두가 올바르게 작동하는지 확인하기 위해.

    • 이제 ServiceNow 인시던트 테이블에 테스트 이벤트가 존재해야 합니다. The image shows the Incidents Table in ServiceNow. There is a test event highlighted in the list.

  7. 클릭 설정 완료.

예제

다음 항목을 클릭하십시오 테스트 경보 버튼을 눌러 경보를 생성하고 ServiceNow로 전송합니다; 경보의 페이로드는 아래와 같습니다:

경보가 ServiceNow에서 수신되면 ServiceNow 인시던트 테이블에 인시던트가 생성됩니다:

The Incident Table in ServiceNow contains a test alert.

Last updated

Was this helpful?