Creates a custom defense rule.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
yundun-sas:AddClientUserDefineRule | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Name | string | Yes | The name of the custom defense rule. | Rule 1 |
Type | integer | Yes | The type of the custom defense rule. Valid values:
| 1 |
Md5List | string | No | The hash values of processes. | 0c9045b5bec90f9825f1f3f64dd4**** |
ActionType | integer | Yes | The action of the custom defense rule. Valid values:
| 1 |
ProcPath | string | No | The path to the process. | c:/windows/system32/i**** |
Cmdline | string | No | The command line. | /usr/sbin/s**** |
Platform | string | No | The type of the operating system. Valid values:
| linux |
IP | string | No | The IP address. | 10.240.XX.XX |
Port | integer | No | The port number. This parameter is deprecated. | 22 |
FilePath | string | No | The file path. | /etc/pam**** |
RegistryKey | string | No | The registry key. | HKEY_DYN_**** |
RegistryContent | string | No | The registry value. | *SECOH-QAD.exe* |
NewFilePath | string | No | The new file path after the file is renamed. | /etc/pam**** |
ParentProcPath | string | No | The path to the parent process. | c:/windows/system32/i**** |
ParentCmdline | string | No | The parent command line. | /usr/sbin/s**** |
PortStr | string | No | The port number. Valid values: 1 to 65535. | 80 |
Domain | string | No | The domain name. | example.com |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "379a9b8f-107b-4630-9e95-2299a1ea****",
"UserDefineRuleAddResult": {
"SwitchId": "USER-DEFINE-RULE-SWITCH-TYPE_200****",
"Id": 1,
"Platform": "linux"
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidPlatform | Invalid Platform value. | - |
400 | InvalidUserDefineRuleName | Invalid Name value. | - |
400 | UserDefineRuleNameTooLong | User define rule name too long. | - |
400 | InvalidUserDefineRuleActionType | Invalid ActionType value. | - |
400 | InvalidUserDefineRuleType | Invalid Type value. | - |
400 | InvalidUserDefineRuleMd5List | Invalid Md5List value. | - |
400 | UserDefineRuleMd5TooMany | Too many user define rule md5s. | - |
400 | InvalidProcPath | Process path is invalid. | - |
400 | UserDefineRuleProcPathMustContainsLetter | User define rule process path must contain letter. | - |
400 | InvalidUserDefineRuleProcPath | User define rule process path is invalid. | - |
400 | InvalidCmdline | Command line is invalid. | - |
400 | UserDefineRuleCmdlineTooLong | User define rule command line too long. | - |
400 | InvalidIP | Invalid IP value. | - |
400 | InvalidPort | Invalid PortStr value. | - |
400 | InvalidFilePath | Invalid FilePath value. | - |
400 | UserDefineRuleFilePathTooLong | User define rule file path too long. | - |
400 | UserDefineRulesTooMany | Too many rules. | - |
403 | NoPermission | caller has no permission | You are not authorized to do this operation. |
500 | ServerError | ServerError | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-03-13 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-10-20 | The Error code has changed | View Change Details |
2023-09-07 | The Error code has changed | View Change Details |