tencent cloud

Tencent Cloud EdgeOne

TEO 정책
개인 정보 보호 정책
데이터 처리 및 보안 계약
문서Tencent Cloud EdgeOne

DescribeWebSecurityTemplate

포커스 모드
폰트 크기
마지막 업데이트 시간: 2025-10-30 22:02:08

1. API Description

Domain name for API request: teo.intl.tencentcloudapi.com.

This API is used to query security policy configuration template details.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: DescribeWebSecurityTemplate.
Version Yes String Common Params. The value used for this API: 2022-09-01.
Region No String Common Params. This parameter is not required.
ZoneId Yes String Zone ID. The zone to which the target policy template belongs for access control. Use the DescribeWebSecurityTemplates interface to query the zone of the policy template.
TemplateId Yes String Policy template ID.

3. Output Parameters

Parameter Name Type Description
SecurityPolicy SecurityPolicy Web Security policy template configuration. Bot management configuration is not currently supported (under development).
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Querying Security Policy Configuration Template Details

This example shows you how to query the configuration content of the policy template temp-a9s1ekqt in site zone-a012rw4m76cy.

Input Example

POST / HTTP/1.1
Host: teo.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeWebSecurityTemplate
<Common request parameters>

{
    "ZoneId": "zone-a012rw4m76cy",
    "TemplateId": "temp-a9s1ekqt"
}

Output Example

{
    "Response": {
        "RequestId": "cb5d2c0e-295e-412a-891a-9f8ab6057b4a",
        "SecurityPolicy": {
            "ExceptionRules": {
                "Rules": [
                    {
                        "Id": "1492837231",
                        "Name": "ExampleSkipModule",
                        "Condition": "${http.request.uri.path} in ['/api/v3/test','/api/v3/submit'] and ${http.request.method} in ['POST']",
                        "SkipScope": "WebSecurityModules",
                        "WebSecurityModulesForException": [
                            "websec-mod-custom-rules",
                            "websec-mod-rate-limiting"
                        ],
                        "Enabled": "On"
                    },
                    {
                        "Id": "1492837231",
                        "Name": "SampleSkipManagedRule",
                        "Condition": "${http.request.uri.path} in ['/api/v3/test','/api/v3/submit'] and ${http.request.method} in ['POST']",
                        "SkipScope": "ManagedRules",
                        "SkipOption": "SkipOnAllRequestFields",
                        "ManagedRulesForException": [
                            "4401215074",
                            "4368124487"
                        ],
                        "Enabled": "On"
                    },
                    {
                        "Id": "1492837231",
                        "Name": "SampleSkipManagedRule",
                        "Condition": "${http.request.uri.path} in ['/api/v3/test','/api/v3/submit'] and ${http.request.method} in ['POST']",
                        "SkipScope": "ManagedRules",
                        "SkipOption": "SkipOnAllRequestFields",
                        "ManagedRuleGroupsForException": [
                            "wafgroup-sql-injection-attacks"
                        ],
                        "Enabled": "On"
                    },
                    {
                        "Id": "1492837231",
                        "Name": "SampleSkipManagedRuleForField",
                        "Condition": "${http.request.uri.path} in ['/api/v3/test','/api/v3/submit'] and ${http.request.method} in ['POST']",
                        "SkipScope": "ManagedRules",
                        "ManagedRulesForException": [
                            "4401215074",
                            "4368124487"
                        ],
                        "SkipOption": "SkipOnSpecifiedRequestFields",
                        "RequestFieldsForException": [
                            {
                                "Scope": "cookie",
                                "Condition": "",
                                "TargetField": "key"
                            },
                            {
                                "Scope": "cookie",
                                "Condition": "${key} in ['session-id']",
                                "TargetField": "value"
                            },
                            {
                                "Scope": "cookie",
                                "Condition": "${key} in ['account-id'] and ${value} like ['prefix-*']",
                                "TargetField": "value"
                            },
                            {
                                "Scope": "header",
                                "Condition": "",
                                "TargetField": "key"
                            },
                            {
                                "Scope": "header",
                                "Condition": "${key} in ['x-trace-id']",
                                "TargetField": "value"
                            },
                            {
                                "Scope": "header",
                                "Condition": "${key} like ['x-auth-*'] and ${value} like ['Bearer *']",
                                "TargetField": "value"
                            },
                            {
                                "Scope": "uri.query",
                                "Condition": "",
                                "TargetField": "key"
                            },
                            {
                                "Scope": "uri.query",
                                "Condition": "${key} in ['action']",
                                "TargetField": "value"
                            },
                            {
                                "Scope": "uri.query",
                                "Condition": "${key} in ['action'] and ${value} in ['upload', 'delete']",
                                "TargetField": "value"
                            },
                            {
                                "Scope": "uri",
                                "Condition": "",
                                "TargetField": "query"
                            },
                            {
                                "Scope": "uri",
                                "Condition": "",
                                "TargetField": "path"
                            },
                            {
                                "Scope": "uri",
                                "Condition": "",
                                "TargetField": "fullpath"
                            },
                            {
                                "Scope": "body.json",
                                "Condition": "",
                                "TargetField": "key"
                            },
                            {
                                "Scope": "body.json",
                                "Condition": "${key} in ['user.id']",
                                "TargetField": "value"
                            },
                            {
                                "Scope": "body.json",
                                "Condition": "${key} in ['user.id'] and ${value} in ['1234', '5678']",
                                "TargetField": "value"
                            },
                            {
                                "Scope": "body",
                                "Condition": "",
                                "TargetField": "fullbody"
                            },
                            {
                                "Scope": "body",
                                "Condition": "",
                                "TargetField": "multipart"
                            }
                        ],
                        "Enabled": "On"
                    }
                ]
            },
            "CustomRules": {
                "Rules": [
                    {
                        "Id": "1492837231",
                        "Name": "ASimpleIPRule",
                        "Condition": "${http.request.ip} in ['1.1.1.1', '10.10.10.0/24'] or ${http.request.ip.asn} in ['132203']",
                        "Action": {
                            "Name": "Deny"
                        },
                        "Enabled": "on",
                        "RuleType": "PreciseMatchRule",
                        "Priority": 50
                    }
                ]
            },
            "HttpDDoSProtection": {
                "AdaptiveFrequencyControl": {
                    "Enabled": "on",
                    "Sensitivity": "Loose",
                    "Action": {
                        "Name": "Monitor"
                    }
                },
                "ClientFiltering": {
                    "Enabled": "on",
                    "Action": {
                        "Name": "Monitor"
                    }
                },
                "BandwidthAbuseDefense": {
                    "Enabled": "on",
                    "Action": {
                        "Name": "Monitor"
                    }
                },
                "SlowAttackDefense": {
                    "Enabled": "on",
                    "Action": {
                        "Name": "Monitor"
                    },
                    "MinimalRequestBodyTransferRate": {
                        "MinimalAvgTransferRateThreshold": "50bps",
                        "CountingPeriod": "60s"
                    },
                    "RequestBodyTransferTimeout": {
                        "IdleTimeout": "5s"
                    }
                }
            },
            "RateLimitingRules": {
                "Rules": [
                    {
                        "Enabled": "on",
                        "Name": "SampleHttpDdosRule",
                        "Condition": "${http.request.uri.path} in ['/api/v3/test','/api/v3/submit']",
                        "CountBy": [
                            "http.request.ip",
                            "http.request.cookies['UserSession']"
                        ],
                        "MaxRequestThreshold": 1000,
                        "CountingPeriod": "2m",
                        "ActionDuration": "20h",
                        "Action": {
                            "Name": "ManagedChallenge"
                        },
                        "Id": "2181399690",
                        "Priority": 100
                    }
                ]
            },
            "ManagedRules": {
                "Enabled": "on",
                "AutoUpdate": {
                    "AutoUpdateToLatestVersion": "off",
                    "RulesetVersion": "2023-12-21T12:00:32Z"
                },
                "SemanticAnalysis": "on",
                "DetectionOnly": "on",
                "ManagedRuleGroups": [
                    {
                        "GroupId": "wafmanagedrulegroup-vulnerability-scanners",
                        "SensitivityLevel": "loose",
                        "Action": {
                            "Name": "Monitor"
                        },
                        "MetaData": {
"GroupDetail": "Vulnerability scanner attack protection"
"GroupName": "Vulnerability Scanner Attack Protection"
                            "RuleDetails": [
                                {
                                    "RuleId": "4401215444",
                                    "RiskLevel": "extreme",
"Description": "Protection rule against historic sql injection vulnerability in dedecms"
                                    "Tags": [],
                                    "RuleVersion": "2023-12-21T12:00:32Z"
                                },
                                {
                                    "RuleId": "4401214877",
                                    "RiskLevel": "medium",
"Description": "Block common scanner xss verification payloads"
                                    "Tags": [],
                                    "RuleVersion": "2023-12-21T12:00:32Z"
                                }
                            ]
                        }
                    }
                ]
            }
        }
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

There is no error code related to the API business logic. For other error codes, please see Common Error Codes.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백