請求將排除項目新增至網路隔離規則

若要將排除項目新增至先前建立的網路隔離規則中,您必須建立新增排除項目的請求。若要建立請求,請使用 HTTP POST 方法。

命令設定以 JSON 格式在請求主體中傳遞。

命令語法

curl -k --cert<TLS 憑證檔案路徑> --key <私鑰檔案路徑> -X POST "<Central Node 伺服器的 URL> :<連接埠,預設為443>/kata/response_api/v1/<external_system_id > /settings?sensor_id=<sensor_id> &settings_type=network_isolation" -H 'Content-Type:application/json' -d '

{
"settings":
{"excludedRules": [
{
"direction": "<outbound、inbound 或 both>",
"protocol": <IP 協定編號>,
"remoteIpv4Address": "<具有 Endpoint Agent 元件的主機的 IP 位址,該元件的流量不得被封鎖>",
"localPortRange":
{
"fromPort": <連接埠號>,
"toPort": <連接埠號>
}
}
,
{
"direction": "<outbound、inbound 或 both>",
"protocol": <IP 協定編號>,
"remoteIpv4Address": "<具有 Endpoint Agent 元件的主機的 IP 位址,該元件的流量不得被封鎖>",
"remotePortRange":
{
"fromPort": <連接埠號>,
"toPort": <連接埠號>
}
}
,
{
"direction": "<outbound、inbound 或 both>",
"protocol": <IP 協定編號>,
"remoteIpv4Address": "<具有 Endpoint Agent 元件的主機的 IP 位址,該元件的流量不得被封鎖>"
}
]
,
"autoTurnoffTimeoutInSec": <網路隔離時長>
}
}
'

如果請求處理成功,則會新增網路隔離規則的排除項目。

設定

參數

類型

敘述

external_system_id

UUID

用於 Kaspersky Anti Targeted Attack Platform 授權的外部系統的唯一 ID。

sensor_id

UUID

具有 Endpoint Agent 元件的主機的唯一 ID。

direction

陣列

不得被封鎖的網路流量方向。可能值:

  • inbound
  • outbound
  • both

如果您沒有為此參數指定值,則預設值為“both”,這表示應用程式在兩個方向上傳輸流量。

protocol

integer

由網際網路號碼分配機構 (IANA) 指派的 IP 協定號

如果不指定此參數的值,則預設情況下,網路隔離將套用於所有協定。

remoteIpv4Address

string

具有 Endpoint Agent 元件的主機的 IP 位址,其流量不得被阻止

remotePortRange

string

目的連接埠。

只有當您選擇了網路流量的傳出方向時,才可以指定目標連接埠。無法為雙向流量指定連接埠範圍。

localPortRange

string

從其發起連線的連接埠。

只有當您選擇了網路流量的傳入方向時,才可以指定目標連接埠。無法為雙向流量指定連接埠範圍。

autoTurnoffTimeoutInSec

integer

網路隔離處於活動狀態的時間段。

允許範圍- 1 到 9999 小時。網路隔離時間以秒為單位指定。例如,如果要啟用主機網路隔離兩個小時,則必須指定 7200 秒。

輸入具有開關的命令的範例

curl -k --cert <TLS 证书文件路径> --key <私鑰檔案路徑> -X POST "https://10.10.0.22:443/kata/response_api/v1/15301050-0490-4A41-81EA-B0391CF21EF3/settings?sensor_id=DF64838B-B518-414B-B769-2B8BE341A2F0&settings_type=network_isolation" -H 'Content-Type: application/json' -d '

{
"settings":
{"excludedRules": [
{
"direction": "inbound",
"protocol": 6,
"remoteIpv4Address": "10.16.41.0",
"localPortRange":
{
"fromPort": 3389,
"toPort": 3389
}
}
,
{
"direction": "outbound",
"remoteIpv4Address": "10.16.41.1",
"remotePortRange":
{
"fromPort": 13957,
"toPort": 55409
}
}
,
{
"direction": "both",
"protocol": 6,
"remoteIpv4Address": "10.16.41.2"
}
]
,
"autoTurnoffTimeoutInSec": 7200
}
}
'

Response

HTTP 代碼:200

格式:JSON

type Response []Settings
type Settings struct {
ExcludedRules array `json:"excludedRules"`
AutoTurnoffTimeoutInSec integer `json:"autoTurnoffTimeoutInSec"`
}
type ExcludedRules struct {
Direction array `json:"direction"`
Protocol integer `json:"autoTurnoffTimeoutInSec"`
RemotePortRange string `json:"remotePortRange"`
LocalPortRange string `json:"localPortRange"`
}

返回值

返回碼

敘述

400

參數不正確。

401

需要授權。

404

未找到具有 Endpoint Agent 元件的指定主機。

500, 502, 503, 504

未知伺服器錯誤。稍後重複該請求。

如果要編輯已建立的排除項目的設定,您必須建立一個新請求以新增具有新設定的排除項目。

頁面頂部