API для реагирования на угрозы EDR

23 июля 2026

ID 300214

В Kaspersky Endpoint Security для Windows 12.9 добавлена поддержка действий по реагированию на угрозы EDR (EDR responses) с помощью Kaspersky Security Center OpenAPI. То есть вы можете вызывать методы OpenAPI для автоматизации реагирования на угрозы EDR с помощью Python. Вы можете вызывать эти методы при взаимодействии с SIEM-решениями. SIEM-решение от "Лаборатории Касперского" – Kaspersky Unified Monitoring and Analysis Platform – поддерживает OpenAPI для реагирования на угрозы EDR начиная с версии 3.4.1. В справке KUMA приведены примеры скриптов.

Для выполнения действий по реагированию на угрозы EDR вам нужно создать запрос и отправить его с помощью KSC Open API (AddIncident). После обработки запроса в консоли Kaspersky Security Center будет создана специальная задача.

Для создания задач при реагировании на угрозы EDR вам нужно установить фоновое соединение между Сервером администрирования и Kaspersky Security Center Web Console. Служба фонового соединения доступна в Kaspersky Security Center Windows 14.2 и выше и Kaspersky Security Center Linux 15.2 и выше. Другие консоли, включая консоли решений Detection and Response от "Лаборатории Касперского", не поддерживаются.

Для реагирования на угрозы EDR необходимо задать основные параметры запроса, например, с помощью JSON:

  • task – тип задачи (см. ниже).
  • targetHost – идентификатор компьютера, на котором нужно запустить скрипт. Обязательный аргумент. Скрипт получает этот аргумент из события.
  • responseEventIncidentArea – название приложения, которое инициировало запуск скрипта (например, KUMA). Этот параметр будет добавлен в название создаваемой задачи.

Для настройки параметров реагирования на угрозы EDR вам нужно в параметре "KLINCDT_BODY": json.dumps(data) задать параметры задачи в JSON. В результате в консоли Kaspersky Security Center приложение создает задачу [Response][KUMA] <task type> - <Date> <Time> - <ID>.

Подключение к Kaspersky Security Center OpenAPI

При реагировании на угрозы EDR приложение создает в консоли Kaspersky Security Center специальные задачи. Для создания этих задач нужно установить соединение между компьютером и Kaspersky Security Center. Для этого в запросе необходимо указать параметры подключения к Kaspersky Security Center.

В Kaspersky XDR версии 2.1 изменился способ авторизации запросов. Kaspersky XDR использует PAT-токены вместо авторизации по имени пользователя и паролю. Поэтому в Kaspersky XDR запустить скрипты невозможно. Подробнее об авторизации запросов см. в справке Kaspersky XDR.

Параметры подключения к Kaspersky Security Center

Пример

# KSC connection info

# reads Environment variables by default, change with corresponding values

# KSC host, string, required

kscHost = "kscHost"

# KSC port, required, default is "13299"

kscPort = "13299"

# KSC certificate file path, default is False

kscCert = False

# KSC user, string, required

kscUser = "kscUser"

# KSC password, string, required

kscPassword = "kscPassword"

server_url = 'https://' + kscHost + ':' + str(kscPort)

    server = KlAkAdmServer.Create(

        server_url, kscUser, kscPassword, verify=kscCert)

    params = validate(args)

    data = {"targetHost": <MyHost>,

            "task": task,

            "params": params,

            "responseEventIncident": True,

            "responseEventIncidentArea":"Kuma"}

    oHostGroup = KlAkHostGroup(server)

    incdnt = oHostGroup.AddIncident({"KLINCDT_SEVERITY": 2,

                                     "KLINCDT_ADDED": paramDateTime(datetime.datetime.now()),

                                     "KLINCDT_BODY": json.dumps(data),

                                     "KLHST_WKS_HOSTNAME":  args.targetHost}).RetVal()

    oHostGroup.UpdateIncident(incdnt, {"KLINCDT_IS_HANDLED": False,

                                       "KLHST_WKS_HOSTNAME":  args.targetHost})

Так как учетные данные пользователя не защищены, для работы со скриптами необходимо выделить отдельного пользователя, который выполняет только эти действия.

Получение файла – getFile

Параметры задачи Получение файла

Пример

type getFile = {

task: 'getFile';

targetHost: string;

params: {

// an empty string or a valid md5 hash of the file

md5hash: string;

// an empty string or a valid sha256 hash of the file

sha256hash: string;

// the path to the file

path: string;

};

responseEventIncidentArea: string;

};

Удаление файла – deleteFile

Параметры задачи Удаление файла

Пример

type deleteFile = {

task: 'deleteFile';

targetHost: string;

params: {

// an empty string or a valid md5 hash of the file

md5hash: string;

// an empty string or a valid sha256 hash of the file

sha256hash: string;

// the path to the file

path: string;

// recursive search for a file (subfolder), optional

searchInSubfolders?: boolean;

};

responseEventIncidentArea: string;

};

Помещение файла на карантин – quarantineFile

Параметры задачи Помещение файла на карантин

Пример

type quarantineFile = {

task: 'quarantineFile';

targetHost: string;

params: {

// an empty string or a valid md5 hash of the file

md5hash: string;

// an empty string or a valid sha256 hash of the file

sha256hash: string;

// the path to the file

path: string;

};

responseEventIncidentArea: string;

};

Поиск IOC – iocScan

Параметры задачи Поиск IOC

Пример

type iocScan = {

task: 'iocScan';

targetHost: string;

params: {

// the path to the zip archive with ioc files in base64 encoding

ioc: string;

// isolation of the computer from the network

isolateHost: boolean;

// critical areas scan

scanCriticalAreas: boolean;

// quarantine the file

quarantineObject: boolean;

};

responseEventIncidentArea: string;

};

Запуск процесса – startProcess

Параметры задачи Запуск процесса

Пример

type startProcess = {

task: 'startProcess';

targetHost: string;

params: {

// the path to the file

executablePath: string;

// command line arguments, optional

arguments?: string;

// a working folder, optional

workingFolder?: string;

};

responseEventIncidentArea: string;

};

Завершение процесса – terminateProcess

Параметры задачи Завершение процесса

Пример

type terminateProcess = {

task: 'terminateProcess';

targetHost: string;

params: {

// an empty string or a valid md5 hash of the file

md5hash: string;

// an empty string or a valid sha256 hash of the file

sha256hash: string;

// the path to the file

path: string;

// case sensitive of the file name

caseSensitive: boolean;

};

responseEventIncidentArea: string;

};

Сетевая изоляция компьютера – isolateHost

Параметры Сетевой изоляции компьютера

Пример

type isolateHost = {

task: 'isolateHost';

targetHost: string;

params: {

// 0 - turning off network isolation, 1 - turning on network isolation

action: number;

};

responseEventIncidentArea: string;

};

Запрет запуска объектов – preventExecution

Параметры Запрета запуска объектов

Пример

type preventExecution = {

task: 'preventExecution';

targetHost: string;

params: {

// a valid md5 hash of the file

hash: string;

// the path to the file

path: string;

// case sensitive of the file name

caseSensitive: boolean;

};

responseEventIncidentArea: string;

};

Поиск вредоносного ПО – onDemandScan

Параметры задачи Поиск вредоносного ПО

Пример

type onDemandScan = {

task: 'onDemandScan';

targetHost: string;

// please note, this is an array

// array of scan object

params: [{

// enabling the scan object

enabled: boolean;

// an empty string or the path to the folder to scan

path: string;

// recursive scan mode

recursive: boolean;

// ID scan object

type: number;

}];

responseEventIncidentArea: string;

};

Вам помогла эта статья?
Что нам нужно улучшить?
Спасибо за ваш отзыв, вы помогаете нам становиться лучше!
Спасибо за ваш отзыв, вы помогаете нам становиться лучше!