EDR 威脅回應的 API

Kaspersky Endpoint Security 12.9 for Windows 引入了使用 卡巴斯基安全管理中心 API 對 EDR 威脅回應操作的支援 (EDR responses)。也就是說,您可以呼叫 OpenAPI 方法使用 Python 自動化 EDR 威脅回應。當與 SIEM 解決方案整合時,您可以呼叫這些方法。卡巴斯基統一監控與分析平台(卡巴斯基 SIEM 解決方案)從 3.4.1 版本開始支援 EDR 威脅回應 OpenAPI。有關範例指令碼,請參閱 KUMA 文件。

若要執行 EDR 威脅回應操作,您需要建立一個請求並使用 KSC Open API (AddIncident)傳送它。處理請求後,將在卡巴斯基安全管理中心主控台中建立特殊工作。

若要在回應 EDR 威脅時建立工作,您必須在管理伺服器和卡巴斯基安全管理中心網頁主控台之間建立背景連線。背景連線服務在卡巴斯基安全管理中心 Windows 14.2 或更高版本以及卡巴斯基安全管理中心 Linux 15.2 中可用。其他主控台(包括 Kaspersky Detection and Response 解決方案的主控台)不受支援。

對於 EDR 威脅回應,您需要以 JSON 格式指定基本請求參數,例如:

要配置 EDR 威脅回應,您需要以 JSON 格式在 "KLINCDT_BODY": json.dumps(data) 參數中指定工作設定。結果,應用程式在卡巴斯基安全管理中心主控台中建立 [Response][KUMA] <task type> - <Date> <Time> - <ID>

連線到卡巴斯基安全管理中心 OpenAPI

作為 EDR 威脅回應的一部分,該應用程式可在卡巴斯基安全管理中心主控台中建立特殊工作。建立這些工作需要在電腦和卡巴斯基安全管理中心之間建立連線。為此,必須在請求中指定卡巴斯基安全管理中心連線參數。

卡巴斯基安全管理中心連線參數

參數

類型

描述

kscHost

string

卡巴斯基安全管理中心管理伺服器位址。必須參數。

kscPort

int

管理員伺服器連線連接埠。必須參數。

kscCert

string

用於連線到卡巴斯基安全管理中心管理伺服器的憑證檔案的路徑。預設情況下,參數被設為 False

kscUser

string

使用者帳戶名稱。必須參數。

kscPassword

string

使用者帳戶密碼。必須參數。

範例

# 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

獲取檔案工作設定

參數

類型

描述

md5hash

string

您想要取得的檔​​案的 MD5 雜湊值。

sha256hash

string

您想要取得的檔​​案的 SHA256 雜湊值。

path

string

您想要取得的檔案的路徑。

範例

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

刪除檔案工作設定

參數

類型

描述

md5hash

string

您要刪除的檔案的 MD5 雜湊值。

sha256hash

string

您要刪除的檔案的 SHA256 雜湊值。

path

string

您要刪除的檔案的路徑。

searchInSubfolders?

boolean

在子資料夾中搜尋要刪除的檔案。

範例

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

移動檔案到隔離區工作設定

參數

類型

描述

md5hash

string

您要隔離的檔案的 MD5 雜湊值。

sha256hash

string

您要隔離的檔案的 SHA256 雜湊值。

path

string

您想要隔離的檔案的路徑。

範例

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 掃描工作設定

參數

類型

描述

ioc

string

您想要用於掃描的包含 IOC 檔案的 ZIP 壓縮檔案路徑。

isolateHost

boolean

當偵測到入侵指標時將電腦與網路隔離,以防止威脅蔓延。

scanCriticalAreas

boolean

當偵測到入侵指標時執行 關鍵區域掃描工作。

quarantineObject

boolean

當偵測到入侵指標時刪除惡意物件。在刪除物件之前,Kaspersky Endpoint Security 會建立備份副本以防物件以後需要還原。Kaspersky Endpoint Security 會將備份副本移動到隔離。

範例

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

啟動處理程序工作設定

參數

類型

描述

executablePath

string

用於啟動處理程序的可執行檔的路徑。

arguments?

string

用於啟動處理程序的附加命令列參數。

workingFolder?

string

處理程序工作資料夾的路徑。

範例

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

停止處理程序工作設定

參數

類型

描述

md5hash

string

您想要終止其處理程序的檔案的 MD5 雜湊值。

sha256hash

string

您想要終止其處理程序的檔案的 SHA256 雜湊值。

path

string

您要刪除的檔案的路徑。

caseSensitive

boolean

搜尋文件時區分大小寫。

範例

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

電腦網路隔離設定

參數

類型

描述

action

string

您想要取得的檔​​案的 MD5 雜湊值。

範例

type isolateHost = {

task: 'isolateHost';

targetHost: string;

params: {

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

action: number;

};

responseEventIncidentArea: string;

};

執行防護 – – preventExecution

執行防護設定

參數

類型

描述

hash

string

您想要阻止執行的檔案的 MD5 雜湊值。

path

string

您想要阻止執行的檔案的路徑。

caseSensitive

boolean

搜尋文件時區分大小寫。

範例

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

惡意軟體掃描工作設定

參數

類型

描述

path

string

自訂掃描的檔案和資料夾的空格分隔清單。

recursive

boolean

遞歸掃描模式。

type

number

掃描範圍。

ScanObjectType = Enum("ScanObjectType",

[

("SystemMemory", 14),

("StartupObjectsAndRunningProcesses", 15),

("DiskBootSectors", 16),

("SystemBackupStorage", 17),

("Email", 18),

("Folder", 22),

("AllRemovableDrives", 23),

("AllNetworkDrives", 24),

("AllFixedDrives", 25)])

範例

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;

};

頁面頂部