PostCustomizeRule - 添加或者更新自定义规则

添加或者更新自定义规则。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

yundun-sas:PostCustomizeRule

create

*全部资源

*

请求参数

名称

类型

必填

描述

示例值

Id

integer

自定义规则 ID。

123456789

RuleName

string

规则名称。

waf_scan

RuleDesc

string

规则描述。

this rule is for waf scan

ThreatLevel

string

威胁等级。取值:

  • serious:高危

  • suspicious:中危

  • remind:低危

remind

AttCk

string

att&ck。

T1595.002 Vulnerability Scanning

AlertType

string

威胁类型。

WEBSHELL

AlertTypeMds

string

威胁类型美杜莎 Code。

${siem_rule_type_process_abnormal_command}

LogType

string

规则对应的日志类型。

ALERT_ACTIVITY

LogTypeMds

string

规则对应的日志类型美杜莎 Code。

${security_event_config.event_name.webshellName_clientav}

LogSource

string

规则对应的日志源。

cloud_siem_aegis_sas_alert

LogSourceMds

string

规则对应的日志源美杜莎 Code。

${sas.cloudsiem.prod.cloud_siem_aegis_sas_alert}

RuleCondition

string

规则查询条件 json。

[[{"not":false,"left":"alert_name","operator":"=","right":"WEBSHELL"}]]

RuleGroup

string

日志聚合字段,json 数组格式。

["asset_id"]

RuleThreshold

string

规则阈值配置 json。

{"aggregateFunction":"count","aggregateFunctionName":"count","field":"activity_name","operator":"<=","value":1}

QueryCycle

string

规则窗口长度。

{"time":"1","unit":"HOUR"}

EventTransferSwitch

integer

告警是否转换事件开关。取值:

  • 0:不转换

  • 1:转换

1

EventTransferType

string

事件生成方式。取值:

  • default:默认内置方式

  • singleToSingle:每个告警生成一个事件

  • allToSingle:周期内告警生成一个事件

allToSingle

EventTransferExt

string

事件生成扩展信息,当 eventTransferType 值为 allToSingle 时,该字段有值,表示告警聚合窗口的周期长度以及周期单位。

{"time":"1","unit":"MINUTE"}

RoleType

integer

视图类型。

  • 0:当前阿里云账号视图。

  • 1:企业下所有账号的视图。

1

RoleFor

integer

管理员切换成其他成员视角的用户 ID。

113091674488****

RegionId

string

威胁分析的数据管理中心所在地。您需要根据资产所在地域,选择管理中心所在地。取值:

  • cn-hangzhou:资产属于中国内地与中国香港

  • ap-southeast-1:资产属于海外地域

cn-hangzhou

返回参数

名称

类型

描述

示例值

object

BaseResponse

Data

object

请求返回值。

123456

Id

integer

自定义规则 id。

123456789

GmtCreate

string

自定义规则创建时间。

2021-01-06 16:37:29

GmtModified

string

自定义规则最后更新时间。

2021-01-06 16:37:29

Aliuid

integer

购买威胁分析产品的阿里云账号 ID。

127608589417****

RuleName

string

规则名称。

waf_scan

RuleDesc

string

规则描述。

this rule is for waf scan

RuleType

string

规则类型。取值:

  • predefine:预定义

  • customize:自定义

customize

ThreatLevel

string

威胁等级。取值:

  • serious:高危

  • suspicious:中危

  • remind:低危

remind

AlertType

string

威胁类型。

WEBSHELL

AlertTypeMds

string

威胁类型美杜莎 Code。

${siem_rule_type_process_abnormal_command}

LogType

string

规则对应的日志类型。

ALERT_ACTIVITY

LogTypeMds

string

规则对应的日志类型美杜莎 Code。

${security_event_config.event_name.webshellName_clientav}

LogSource

string

规则对应的日志源。

cloud_siem_aegis_sas_alert

LogSourceMds

string

规则对应的日志源美杜莎 code。

${sas.cloudsiem.prod.cloud_siem_aegis_sas_alert}

RuleCondition

string

规则查询条件 json(需要对 html 转义字符进行反向转义)。

[[{"not":false,"left":"alert_name","operator":"=","right":"WEBSHELL"}]]

RuleGroup

string

日志聚合字段,json 数组格式(需要对 html 转义字符进行反向转义)。

["asset_id"]

RuleThreshold

string

规则阈值配置 json(需要对 html 转义字符进行反向转义)。

{"aggregateFunction":"count","aggregateFunctionName":"count","field":"activity_name","operator":"<=","value":1}

QueryCycle

string

规则窗口长度(需要对 html 转义字符进行反向转义)。

{"time":"1","unit":"HOUR"}

AttCk

string

告警附加字段 attck

T1595.002 Vulnerability Scanning

EventTransferSwitch

integer

告警是否转换事件开关。取值:

  • 0:不转换

  • 1:转换

1

EventTransferType

string

事件生成方式。取值:

  • default:默认内置方式

  • singleToSingle:每个告警生成一个事件

  • allToSingle:周期内告警生成一个事件

allToSingle

EventTransferExt

string

事件生成扩展信息,当 eventTransferType 值为 allToSingle 时,该字段有值,表示告警聚合窗口的周期长度以及周期单位,(需要对 html 转义字符进行反向转义)。

{"time":"1","unit":"MINUTE"}

Status

integer

规则状态。取值:

  • 0:初始状态

  • 10:模拟数据测试

  • 15:业务数据测试中

  • 20:业务数据测试结束

  • 100:规则上线

0

DataType

integer

自动化响应规则条件字段数据类型。

varchar

Success

boolean

请求是否成功。取值:

  • true:成功

  • false:失败

true

Code

integer

请求状态码。

200

Message

string

请求返回消息。

success

RequestId

string

请求 ID。

9AAA9ED9-78F4-5021-86DC-D51C7511****

示例

正常返回示例

JSON格式

{
  "Data": {
    "Id": 123456789,
    "GmtCreate": "2021-01-06 16:37:29",
    "GmtModified": "2021-01-06 16:37:29",
    "Aliuid": 0,
    "RuleName": "waf_scan",
    "RuleDesc": "this rule is for waf scan",
    "RuleType": "customize",
    "ThreatLevel": "remind",
    "AlertType": "WEBSHELL",
    "AlertTypeMds": "${siem_rule_type_process_abnormal_command}",
    "LogType": "ALERT_ACTIVITY",
    "LogTypeMds": "${security_event_config.event_name.webshellName_clientav}",
    "LogSource": "cloud_siem_aegis_sas_alert",
    "LogSourceMds": "${sas.cloudsiem.prod.cloud_siem_aegis_sas_alert}",
    "RuleCondition": "[[{"not":false,"left":"alert_name","operator":"=","right":"WEBSHELL"}]]",
    "RuleGroup": "["asset_id"]",
    "RuleThreshold": "{"aggregateFunction":"count","aggregateFunctionName":"count","field":"activity_name","operator":"<=","value":1}",
    "QueryCycle": "{"time":"1","unit":"HOUR"}",
    "AttCk": "T1595.002 Vulnerability Scanning",
    "EventTransferSwitch": 1,
    "EventTransferType": "allToSingle",
    "EventTransferExt": "{"time":"1","unit":"MINUTE"}",
    "Status": 0,
    "DataType": 0
  },
  "Success": true,
  "Code": 200,
  "Message": "success",
  "RequestId": "9AAA9ED9-78F4-5021-86DC-D51C7511****"
}

错误码

HTTP status code

错误码

错误信息

描述

400 CloudSiemCustomizeRuleUpdateExcepiton this customize rule can only update in init status.
400 CloudSiemCustomizeRuleConditionExceedExcepiton the number of rule conditions cannot exceed 100.
400 CloudSiemCustomizeRuleDuplicateRuleNameExcepiton the rule name is duplicated.
500 InternalError The request processing has failed due to some unknown error. 服务发生某些未知错误,请稍后再试

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情