All Products
Search
Document Center

Security Center:AddClientUserDefineRule

Last Updated:Jul 23, 2024

Creates a custom defense rule.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
NamestringYes

The name of the custom defense rule.

Rule 1
TypeintegerYes

The type of the custom defense rule. Valid values:

  • 1: Process hash
  • 2: Command line
  • 3: Process Network
  • 4: File Read and Write
  • 5: Operation on Registry
  • 6: Dynamic-link Library Loading
  • 7: File Renaming
1
Md5ListstringNo

The hash values of processes.

0c9045b5bec90f9825f1f3f64dd4****
ActionTypeintegerYes

The action of the custom defense rule. Valid values:

  • 0: allow
  • 1: block
1
ProcPathstringNo

The path to the process.

c:/windows/system32/i****
CmdlinestringNo

The command line.

/usr/sbin/s****
PlatformstringNo

The type of the operating system. Valid values:

  • windows: Windows
  • linux: Linux
  • all: all types
linux
IPstringNo

The IP address.

10.240.XX.XX
PortintegerNo

The port number. This parameter is deprecated.

22
FilePathstringNo

The file path.

/etc/pam****
RegistryKeystringNo

The registry key.

HKEY_DYN_****
RegistryContentstringNo

The registry value.

*SECOH-QAD.exe*
NewFilePathstringNo

The new file path after the file is renamed.

/etc/pam****
ParentProcPathstringNo

The path to the parent process.

c:/windows/system32/i****
ParentCmdlinestringNo

The parent command line.

/usr/sbin/s****
PortStrstringNo

The port number. Valid values: 1 to 65535.

80
DomainstringNo

The domain name.

example.com

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

379a9b8f-107b-4630-9e95-2299a1ea****
UserDefineRuleAddResultobject

The identifier of the custom defense rule.

SwitchIdstring

The switch ID of the custom defense rule.

USER-DEFINE-RULE-SWITCH-TYPE_200****
Idlong

The ID of the rule.

1
Platformstring

The type of the operating system. Valid values:

  • windows: Windows
  • linux: Linux
  • all: all types
linux

Examples

Sample success responses

JSONformat

{
  "RequestId": "379a9b8f-107b-4630-9e95-2299a1ea****",
  "UserDefineRuleAddResult": {
    "SwitchId": "USER-DEFINE-RULE-SWITCH-TYPE_200****",
    "Id": 1,
    "Platform": "linux"
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidPlatformInvalid Platform value.-
400InvalidUserDefineRuleNameInvalid Name value.-
400UserDefineRuleNameTooLongUser define rule name too long.-
400InvalidUserDefineRuleActionTypeInvalid ActionType value.-
400InvalidUserDefineRuleTypeInvalid Type value.-
400InvalidUserDefineRuleMd5ListInvalid Md5List value.-
400UserDefineRuleMd5TooManyToo many user define rule md5s.-
400InvalidProcPathProcess path is invalid.-
400UserDefineRuleProcPathMustContainsLetterUser define rule process path must contain letter.-
400InvalidUserDefineRuleProcPathUser define rule process path is invalid.-
400InvalidCmdlineCommand line is invalid.-
400UserDefineRuleCmdlineTooLongUser define rule command line too long.-
400InvalidIPInvalid IP value.-
400InvalidPortInvalid PortStr value.-
400InvalidFilePathInvalid FilePath value.-
400UserDefineRuleFilePathTooLongUser define rule file path too long.-
400UserDefineRulesTooManyToo many rules.-
403NoPermissioncaller has no permissionYou are not authorized to do this operation.
500ServerErrorServerError-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-03-13The Error code has changed. The request parameters of the API has changedView Change Details
2023-10-20The Error code has changedView Change Details
2023-09-07The Error code has changedView Change Details