Skip to content

Get Security Detection Rule Configuration



GET /api/v1/security_rule/{rule_uuid}/get

Overview

Returns the security rule configuration that the caller has permission to operate on in the current Workspace. AI semantic security rules are supported.

Prerequisites and Usage Steps

Obtain the rule UUID from content.data[].uuid in Security Detection Rule List, or from content.uuid in the creation result. The response returns only public configuration fields.

Route Parameters

Parameter Type Required Description
rule_uuid string Y Security detection rule UUID.
Empty string allowed: False
Example: srul_example
How to obtain or enter: Obtain from content.data[].uuid in Security Detection Rule List.

Request Headers

Parameter Type Required Description
DF-API-KEY string Y OpenAPI Key of the target Workspace. Obtain it through API Key Management in the Workspace.

Request Example

curl --request GET 'https://openapi.guance.com/api/v1/security_rule/srul_example/get' \
  -H 'DF-API-KEY: <DF-API-KEY>'

Response

HTTP 200, application/json.

Field Type Description
content.uuid string Security rule UUID.
content.name string Rule name.
content.type string Rule type.
content.status integer Rule status; 0 means enabled and 2 means disabled.
content.updateAt integer Update time in Unix seconds. Can be -1 if not updated.
content.declaration object Public declaration of the current Workspace.
content.desc string Rule description.
content.jsonScript object Public rule script configuration.
content.alertPolicyUUIDs array<string> Associated Alert Policy UUIDs.
content.tags array<string> Rule tags.
{
    "code": 200,
    "content": {
        "uuid": "srul_example",
        "name": "登录检测",
        "type": "ai_monitor",
        "status": 2,
        "updateAt": 1795737600,
        "desc": "",
        "jsonScript": {
            "type": "aiMonitor",
            "every": "1h",
            "interval": 3600,
            "checkerOpt": {
                "userPrompt": "检查异常登录",
                "systemPromptId": "ai-monitor-security-logging@1.0",
                "mentions": []
            }
        },
        "alertPolicyUUIDs": [],
        "tags": [],
        "declaration": {}
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-EXAMPLE"
}

Error Response

For authentication, rate limiting, and common request errors, see Common Error Definitions.

HTTP Status errorCode Trigger Condition Message or Response Description Resolution
406 ft.ParameterValidationFailed / ft.InvalidParameter Missing fields, or type or configuration does not meet requirements Invalid parameter Check the fields and values against the request parameter table.
403 ft.Forbidden API Key lacks endpoint permission, or has no operation permission on the current AI rule Access forbidden Verify the Key's Workspace, permissions, and target rule.
400 ft.UnsupportFreeWorkspaceSecurityCfg Current Workspace edition does not support security configuration Unsupported edition Verify the target Workspace edition.
404 ft.ObjectNotExists Rule does not exist, has been deleted, or does not belong to the current Workspace Rule does not exist Obtain the UUID again from the rule list in the current Workspace.
403 ft.ForbiddenCspmOperation / ft.ForbiddenSiemOperation / ft.ForbiddenAbaOperation The caller has no operation permission for the corresponding category of security rules Rule operation denied Check the permissions for the corresponding rule category.

Feedback

Is this page helpful?