文档

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

更新时间:

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

调试

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

授权信息

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

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
yundun-sas:PostCustomizeRuleWrite
  • acs:yundun-sas::{#accountId}:*

请求参数

名称类型必填描述示例值
Idlong

自定义规则 ID。

123456789
RuleNamestring

规则名称。

waf_scan
RuleDescstring

规则描述。

this rule is for waf scan
ThreatLevelstring

威胁等级。取值:

  • serious:高危
  • suspicious:中危
  • remind:低危
remind
AlertTypestring

威胁类型。

WEBSHELL
AlertTypeMdsstring

威胁类型美杜莎 Code。

${siem_rule_type_process_abnormal_command}
LogTypestring

规则对应的日志类型。

ALERT_ACTIVITY
LogTypeMdsstring

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

${security_event_config.event_name.webshellName_clientav}
LogSourcestring

规则对应的日志源。

cloud_siem_aegis_sas_alert
LogSourceMdsstring

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

${sas.cloudsiem.prod.cloud_siem_aegis_sas_alert}
RuleConditionstring

规则查询条件 json。

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

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

["asset_id"]
RuleThresholdstring

规则阈值配置 json。

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

规则窗口长度。

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

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

  • 0:不转换
  • 1:转换
1
EventTransferTypestring

事件生成方式。取值:

  • default:默认内置方式
  • singleToSingle:每个告警生成一个事件
  • allToSingle:周期内告警生成一个事件
allToSingle
EventTransferExtstring

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

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

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

  • cn-hangzhou:资产属于中国内地与中国香港
  • ap-southeast-1:资产属于海外地域
cn-hangzhou

返回参数

名称类型描述示例值
object

BaseResponse

Successboolean

请求是否成功。取值:

  • true:成功
  • false:失败
true
Codeinteger

请求状态码。

200
Messagestring

请求返回消息。

success
RequestIdstring

请求 ID。

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

请求返回值。

Idlong

自定义规则 id。

123456789
GmtCreatestring

自定义规则创建时间。

2021-01-06 16:37:29
GmtModifiedstring

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

2021-01-06 16:37:29
Aliuidlong

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

127608589417****
RuleNamestring

规则名称。

waf_scan
RuleDescstring

规则描述。

this rule is for waf scan
RuleTypestring

规则类型。取值:

  • predefine:预定义
  • customize:自定义
customize
ThreatLevelstring

威胁等级。取值:

  • serious:高危
  • suspicious:中危
  • remind:低危
remind
AlertTypestring

威胁类型。

WEBSHELL
AlertTypeMdsstring

威胁类型美杜莎 Code。

${siem_rule_type_process_abnormal_command}
LogTypestring

规则对应的日志类型。

ALERT_ACTIVITY
LogTypeMdsstring

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

${security_event_config.event_name.webshellName_clientav}
LogSourcestring

规则对应的日志源。

cloud_siem_aegis_sas_alert
LogSourceMdsstring

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

${sas.cloudsiem.prod.cloud_siem_aegis_sas_alert}
RuleConditionstring

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

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

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

["asset_id"]
RuleThresholdstring

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

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

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

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

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

  • 0:不转换
  • 1:转换
1
EventTransferTypestring

事件生成方式。取值:

  • default:默认内置方式
  • singleToSingle:每个告警生成一个事件
  • allToSingle:周期内告警生成一个事件
allToSingle
EventTransferExtstring

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

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

规则状态。取值:

  • 0:初始状态
  • 10:模拟数据测试
  • 15:业务数据测试中
  • 20:业务数据测试结束
  • 100:规则上线
0

示例

正常返回示例

JSON格式

{
  "Success": true,
  "Code": 200,
  "Message": "success",
  "RequestId": "9AAA9ED9-78F4-5021-86DC-D51C7511****",
  "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"}",
    "EventTransferSwitch": 1,
    "EventTransferType": "allToSingle",
    "EventTransferExt": "{"time":"1","unit":"MINUTE"}",
    "Status": 0
  }
}

错误码

HTTP status code错误码错误信息
400CloudSiemCustomizeRuleUpdateExcepitonthis customize rule can only update in init status.
400CloudSiemCustomizeRuleConditionExceedExcepitonthe number of rule conditions cannot exceed 100.
400CloudSiemCustomizeRuleDuplicateRuleNameExcepitonthe rule name is duplicated.
501CloudSiem_Internal_ExceptionCloudSiem_Internal_Exception

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

变更历史

变更时间变更内容概要操作
2024-04-17OpenAPI 错误码发生变更、OpenAPI 入参发生变更、OpenAPI 返回结构发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    删除错误码:400
    删除错误码:501
    新增错误码:500
入参OpenAPI 入参发生变更
    新增入参:AttCk
    新增入参:RoleType
    新增入参:RoleFor
出参OpenAPI 返回结构发生变更
  • 本页导读 (1)
文档反馈