배치 탐지 시나리오 목록 조회

검색 조건과 일치하는 배치 탐지 시나리오 목록을 조회합니다.

HTTP 요청

GET /api/sonar/batch-rules
cURL 예시
curl -H "Authorization: Bearer <API_KEY>" \
     https://HOSTNAME/api/sonar/batch-rules
요청 매개변수
필수타입설명비고
offsetX32비트 정수건너뛸 갯수기본값 0
limitX32비트 정수최대 갯수미지정 시 전체 조회
keywordsX문자열검색 키워드이름, 설명, 쿼리 대상으로 검색

정상 응답

아래는 배치 탐지 시나리오 목록 중 일부입니다.

{
  "total_count": 1,
  "rules": [
    {
      "guid": "f4ca02c8-0679-49e7-8c10-76667c26b595",
      "priority": "LOW",
      "name": "DMZ 포트 스캔",
      "description": "",
      "msg": "DMZ 포트 스캔: $src_ip",
      "enabled": false,
      "category_guid": "8270a382-a47c-401d-9318-037c5d639f2e",
      "category_name": "정보 수집",
      "schedule": "*/10 * * * *",
      "duration": null,
      "datetrunc": null,
      "dataset_guid": null,
      "dataset_name": null,
      "query": "table duration=30m FW_*\n| fields _time, _schema, src_ip, src_port, dst_ip, dst_port, protocol, app, action, sent_pkts, rcvd_pkts, sent_bytes, rcvd_bytes\n| search _schema == \"session\" and protocol == \"TCP\" and sent_bytes <= 200\n| lookup geoip src_ip output country as src_country\n| lookup geoip dst_ip output country as dst_country\n| search src_country != \"--\"\n| eval _time = datetrunc(_time, \"10m\") \n| stats dc(dst_port) as port_count, values(dst_port) as dst_port by src_ip, dst_ip, _time \n| search port_count >= 10 \n| explode dst_port \n| eval protocol = \"TCP\" \n| order _time, host_count, src_ip, dst_ip, dst_port, protocol",
      "address_group_guid": null,
      "address_field": null,
      "ticket_repo_guid": null,
      "ticket_assignee_guid": null,
      "ticket_assignee_name": null,
      "ticket_suppress_interval": 3600,
      "event_suppress_interval": 0,
      "suppress_key": null,
      "keep_alive": false,
      "audit_category_guid": null,
      "audit_category_name": null,
      "auditor_guid": null,
      "auditor_name": null,
      "audit_days": 14,
      "employee_key_field": null,
      "alarm_group_guid": null,
      "alarm_group_name": null,
      "field_order": "_time, host_count, src_ip, dst_ip, dst_port, protocol",
      "company_guid": "6fbe27b7-f1ae-4d7a-a1a5-76d8fa9aa311",
      "company_name": null,
      "user_guid": "ffaf431b-653a-4329-8f83-913cbb00342d",
      "user_name": "관리자",
      "created": "2022-09-01 00:31:15+0900",
      "updated": "2022-09-01 00:31:15+0900"
    }
  ]
}
  • total_count (32비트 정수): 검색 조건과 일치하는 전체 배치 탐지 시나리오 갯수
  • rules (배열): 페이징된 배치 탐지 시나리오 목록
    • priority (문자열): LOW, MEDIUM, HIGH 중 하나.
    • guid (문자열): 배치 탐지 시나리오 GUID
    • name (문자열): 배치 탐지 시나리오 이름
    • description (문자열): 배치 탐지 시나리오 설명
    • msg (문자열): 메시지 템플릿. $field 형식의 매크로를 사용하여 필드 값을 메시지에 반영할 수 있음.
    • enabled (불리언): 탐지 활성화 여부
    • category_guid (문자열): 탐지 시나리오 분류 GUID
    • category_name (문자열): 탐지 시나리오 분류 이름
    • schedule (문자열): 실행 주기. CRON 일정 문법 사용
    • duration (32비트 정수): 분석 대상 기간 (초). 설정 값은 쿼리의 from, to 매개변수로 전달됩니다.
    • datetrunc (32비트 정수): 시간 절사 단위 (초). from, to 쿼리 매개변수의 시간 절사.
    • dataset_guid (문자열): 데이터셋 GUID
    • dataset_name (문자열): 데이터셋 이름
    • address_group_guid (문자열): 주소 그룹 GUID
    • address_field (문자열): 주소 그룹에 등록할 대상 필드
    • ticket_repo_guid (문자열): 티켓 분류 GUID
    • ticket_assignee_guid (문자열): 티켓 할당자 GUID
    • ticket_assignee_name (문자열): 티켓 할당자 성명
    • ticket_suppress_interval (32비트 정수): 중복 티켓 축약 기간 (초 단위)
    • event_suppress_interval (32비트 정수): 중복 이벤트 제거 기간 (초 단위)
    • suppress_key (문자열): 중복 기준 필드. $field 형식으로 지정된 매크로를 해당 필드 값으로 대체하여 이벤트 컨텍스트 키로 사용함.
    • keep_alive (불리언): true인 경우 축약 타이머 유지. false인 경우 축약 타이머 초기화.
      Note
      축약 타이머 유지 시 티켓을 완료 처리하더라도 만료 시간에 도달할 때까지 이벤트가 기존 티켓에 병합됩니다.
    • audit_category_guid (문자열): 소명 분류 GUID
    • audit_category_name (문자열): 소명 분류 이름
    • auditor_guid (문자열): 소명 확인 계정의 GUID. 미지정 시 부서장 전결.
    • auditor_name (문자열): 소명 확인 계정의 성명. 미지정 시 부서장 전결.
    • audit_days (32비트 정수): 소명 제출 마감 시한 (일 단위)
    • employee_key_field (문자열): 사번 필드 이름. 통상 정규화된 필드인 emp_key를 사용함.
    • alarm_group_guid (문자열): 알람 그룹 GUID
    • alarm_group_name (문자열): 알람 그룹 이름
    • field_order (문자열): 근거 자료 출력 시 필드 순서. 쉼표로 구분된 필드 이름 목록.
    • company_guid (문자열): 시나리오가 속한 회사 (테넌트) GUID
    • company_name (문자열): 시나리오가 속한 회사 (테넌트) 이름
    • user_guid (문자열): 시나리오를 생성한 사용자 GUID
    • user_name (문자열): 시나리오를 생성한 사용자 성명
    • created (문자열): 생성일시 (yyyy-MM-dd HH:mm:ssZ 형식)
    • updated (문자열): 수정일시 (yyyy-MM-dd HH:mm:ssZ 형식)

오류 응답

offset, limit 값이 정수가 아닌 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-argument",
  "error_msg": "'offset' parameter should be int type"
}
offset, limit 값이 음수인 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-argument",
  "error_msg": "'offset' must be greater than or equal to 0."
}