请求将排除项添加到网络隔离规则

要将排除项添加到之前创建的网络隔离规则中,您必须创建添加排除项的请求。要创建请求,请使用 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

内部服务器错误。稍后重复该请求。

如果要编辑已创建的排除项的设置,您必须创建一个新请求以添加具有新设置的排除项。

页面顶部