Use ALIYUN::ESA::WafRule to create a WAF rule.
Syntax
{
"Type": "ALIYUN::ESA::WafRule",
"Properties": {
"Phase": String,
"SiteId": Integer,
"Config": Map,
"RulesetId": Integer,
"Shared": Map,
"SiteVersion": Integer
}
}Properties
Property | Type | Required | Editable | Description | Constraints |
Phase | String | Yes | Yes | The deployment phase. | None |
SiteId | Integer | Yes | No | The site ID. | None |
Config | Map | No | Yes | The rule configuration. | For more information, see Config Properties. |
RulesetId | Integer | No | Yes | The WAF ruleset ID. | None |
Shared | Map | No | No | The shared configuration. | For more information, see Shared Properties. |
SiteVersion | Integer | No | No | The site version. | None |
Config syntax
"Config": {
"status": String,
"action": String,
"actions": Map,
"managed_list": String,
"managed_rulesets": List,
"Sigchl": List,
"name": String,
"app_sdk": Map,
"rate_limit": Map,
"type": String,
"app_package": Map,
"managed_group_id": Integer,
"timer": Map,
"expression": String,
"security_level": Map,
"value": String,
"id": Integer,
"notes": String
}Config properties
Property | Type | Required | Editable | Description | Constraint |
Action | String | No | Yes | Specifies the action to take. | None |
Actions | Map | No | Yes | Additional actions. | See the Actions property for more information. |
AppPackage | Map | No | Yes | App repackaging detection settings. | See the AppPackage property for more information. |
AppSdk | Map | No | Yes | App SDK settings. | See the AppSdk property for more information. |
Expression | String | No | Yes | The matching expression for the rule. | None |
Id | Integer | No | No | A unique identifier for the rule. | None |
ManagedGroupId | Integer | No | Yes | The ID of the managed rule group to which this rule belongs. | None |
ManagedList | String | No | Yes | The name of the managed list to use in the rule. | None |
ManagedRulesets | List | No | Yes | A list of managed rulesets to apply. | See the ManagedRulesets property for more information. |
Name | String | No | Yes | A user-defined name for the rule. | None |
Notes | String | No | Yes | Optional notes or comments about the rule. | None |
RateLimit | Map | No | Yes | Rate limiting configuration. | See the RateLimit property for more information. |
SecurityLevel | Map | No | Yes | Security level configuration. | See the SecurityLevel property for more information. |
Sigchl | List | No | Yes | Token validation settings. | None |
Status | String | No | Yes | Indicates the current status of the rule (for example, enabled or disabled). | None |
Timer | Map | No | Yes | Timer configuration. | See the Timer property for more information. |
Type | String | No | Yes | Specifies the type of the rule. | None |
Value | String | No | Yes | The value to match for an IP access control rule. | None |
Actions syntax
"Actions": {
"Response": Map
}Actions properties
Property | Type | Required | Editable | Description | Constraints |
Response | Map | No | No | Specifies the custom response. | See Response attributes. |
Response syntax
"response": {
"ID": Integer,
"code": Integer
}Response properties
Property | Type | Required | Editable | Description | Constraints |
Code | Integer | No | No | Custom response code. | None |
Id | Integer | No | No | Custom response page ID. | None |
Bypass syntax
"Bypass": {
"Skip": String,
"RegularRules": List,
"CustomRules": List,
"RegularTypes": List,
"Tags": List
}Bypass properties
Property | Type | Required | Editable | Description | Constraint |
CustomRules | List | No | Yes | The IDs of custom rules to skip. | None |
RegularRules | List | No | Yes | The IDs of managed rules to skip. | None |
RegularTypes | List | No | Yes | The types of managed rules to skip. | None |
Skip | String | No | Yes | The module type to skip. | None |
Tags | List | No | Yes | The modules to skip. | None |
ManagedRulesets syntax
"ManagedRulesets": [
{
"ProtectionLevel": Integer,
"Action": String,
"ManagedRules": List,
"AttackType": Integer,
"NumberTotal": Integer,
"NumberEnabled": Integer
}
]ManagedRulesets properties
Property | Type | Required | Editable | Description | Constraints |
Action | String | No | Yes | The action to perform. | None |
AttackType | Integer | No | Yes | The attack type. | None |
ManagedRules | List | No | Yes | A list of managed rules. | For more information, see ManagedRule properties. |
NumberEnabled | Integer | No | No | The number of enabled rules. | None |
NumberTotal | Integer | No | No | The total number of rules. | None |
ProtectionLevel | Integer | No | Yes | The protection level to apply. | None |
ManagedRules syntax
"ManagedRules": [
{
"Status": String,
"Action": String,
"Id": Integer
}
]Managed rule properties
Property | Type | Required | Editable | Description | Constraint |
action | String | No | Yes | The rule's action. | None |
id | Integer | No | Yes | The rule's ID. | None |
status | String | No | Yes | The rule's status. | None |
AppSdk syntax
"AppSdk": {
"CustomSign": Map,
"CustomSignStatus": String,
"FeatureAbnormal": List
}AppSdk properties
Property | Type | Required | Editable | Description | Constraints |
CustomSign | Map | No | Yes | Custom tag settings. | See CustomSign property for details. |
CustomSignStatus | String | No | Yes | Enables or disables the custom tag feature. | None |
FeatureAbnormal | List | No | Yes | Detected abnormal features. | None |
CustomSign syntax
"CustomSign": {
"Value": string,
"Key": string
}CustomSign properties
Property | Type | Required | Editable | Description | Constraints |
key | string | No | Yes | The name of the field. | None |
value | string | No | Yes | The value of the field. | None |
RateLimit syntax
"RateLimit": {
"Characteristics": Map,
"OnHit": Boolean,
"Ttl": Integer,
"Threshold": Map,
"Interval": Integer
}RateLimit properties
Property | Type | Required | Editable | Description | Constraints |
Characteristics | Map | No | Yes | Specifies the request characteristics to track for rate limiting. | For more information, see Characteristics properties. |
Interval | Integer | No | Yes | The time interval, in seconds, during which requests are counted. | None |
OnHit | Boolean | No | Yes | Indicates whether to apply the rate limit to requests that result in a cache hit. | None |
Threshold | Map | No | Yes | The threshold settings for the rate limit. | For more information, see Threshold properties. |
Ttl | Integer | No | Yes | Specifies the time to live (TTL), in seconds, for the rate limit counter. | None |
Characteristics syntax
"Characteristics": {
"Criteria": List,
"Logic": String
}Properties
Property | Type | Required | Editable | Description | Constraints |
Criteria | List | No | Yes | A list of criteria to be evaluated. | For more information, see Criteria Properties. |
Logic | String | No | Yes | The logical relationship between criteria, such as 'AND' or 'OR'. | None |
Criteria syntax
"Criteria": [
{
"MatchType": string
}
]Criteria properties
Property | Type | Required | Editable | Description | Constraints |
MatchType | String | No | No | Specifies the field to match. | None |
Threshold syntax
"Threshold": {
"DistinctManagedRules": Integer,
"ManagedRulesBlocked": Integer,
"ResponseStatus": Map,
"Traffic": String,
"Request": Integer
}Threshold properties
Property | Type | Required | Editable | Description | Constraint |
DistinctManagedRules | Integer | No | Yes | The threshold for distinct managed rules. | None |
ManagedRulesBlocked | Integer | No | Yes | The threshold for requests blocked by managed rules. | None |
Request | Integer | No | Yes | The request count threshold. | None |
ResponseStatus | Map | No | Yes | The thresholds for specific response status codes. | See the ResponseStatus property. |
Traffic | String | No | Yes | The threshold for traffic. | None |
ResponseStatus syntax
"ResponseStatus": {
"Ratio": Integer,
"Count": Integer,
"Code": Integer
}ResponseStatus properties
Property | Type | Required | Editable | Description | Constraints |
Code | Integer | No | Yes | Specifies the HTTP response code. | None |
Count | Integer | No | Yes | Specifies the response code count threshold. | None |
Ratio | Integer | No | Yes | Specifies the response code percentage. | None |
AppPackage syntax
"AppPackage": {
"PackageSigns": List
}AppPackage properties
Property | Type | Required | Editable | Description | Constraints |
PackageSigns | list | No | Yes | Settings for repackaging detection. |
PackageSigns syntax
"PackageSigns": [
{
"Sign": String,
"Name": String
}
]PackageSigns properties
Property | Type | Required | Editable | Description | Constraint |
Name | String | No | Yes | The package name. | None |
Sign | String | No | Yes | The package signature. | None |
Timer syntax
"Timer": {
"Periods": List,
"Scopes": String,
"Zone": Integer,
"WeeklyPeriods": List
}Timer properties
Property | Type | Required | Editable | Description | Constraints |
Periods | List | No | Yes | Effective periods. | For more information, see Periods properties. |
Scopes | String | No | Yes | Timer type. | Valid values:
|
WeeklyPeriods | List | No | Yes | Weekly effective periods. | For more information, see WeeklyPeriods properties. |
Zone | String | No | Yes | The time zone in which the schedule is interpreted. | Defaults to UTC+00:00 if not specified. |
Periods syntax
"Periods": [{
"Start": String,
"End": String
}]Period properties
Property | Type | Required | Editable | Description | Constraint |
End | String | No | Yes | The end time. | Must be a UTC timestamp in RFC 3339 format. |
Start | String | No | Yes | The start time. | Must be a UTC timestamp in RFC 3339 format. |
WeeklyPeriods syntax
"WeeklyPeriods": [{
"Days": String,
"DailyPeriods": List
}]WeeklyPeriods properties
Property | Type | Required | Editable | Description | Constraint |
DailyPeriods | List | no | yes | The time periods within a day during which the rule is active. | See the |
Days | String | no | yes | The days of the week on which the rule is active. | Use a comma-separated list of numbers from 1 (Monday) to 7 (Sunday). |
DailyPeriods syntax
"DailyPeriods": [{
"Start": string,
"End": string
}]DailyPeriods properties
Property | Type | Required | Editable | Description | Constraint |
End | String | No | Yes | The end time. | The format must be HH:mm:ss. |
Start | String | No | Yes | The start time. | The format must be HH:mm:ss. |
SecurityLevel syntax
"SecurityLevel": {
"Value": String
}SecurityLevel properties
Property | Type | Required | Editable | Description | Constraint |
Value | String | No | Yes | The security level. | None |
Shared syntax
"Shared": {
"Target": String,
"Action": String,
"Actions": Map,
"Expression": String,
"Mode": String,
"CrossSiteId": Integer,
"Match": Map,
"Name": String
}Shared properties
Property | Type | Required | Editable | Description | Constraint |
Action | String | No | No | The action. | None |
Actions | Map | No | No | The action extension. | See Actions Property. |
CrossSiteId | Integer | No | No | The cross-site ID. | None |
Expression | String | No | No | The expression. | None |
Match | Map | No | No | The matching engine. | See Match Property. |
Mode | String | No | No | The Web SDK integration mode. | Valid values:
|
Name | String | No | No | The rule set name. | None |
Target | String | No | No | The protection target type. | Valid values:
|
Match syntax
"Match": {
"MatchType": String,
"Criteria": List,
"Logic": String
}Match properties
Property | Type | Required | Editable | Description | Constraint |
Criteria | List | No | No | A logical list of criteria. | None |
Logic | String | No | No | The logical relationship between the criteria. | None |
MatchType | String | No | No | The field to match. | None |
Return value
When you pass the logical ID of this resource to the Fn::GetAtt intrinsic function, it returns a value for the specified attribute.
RulesetId: The ID of the WAF ruleset.
Phase: The processing phase of the WAF rule.
WafRuleId: The ID of the WAF rule.
Config: The rule configuration.
UpdateTime: The last modification time of the rule.
Example
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
SiteVersion:
Type: Number
Description:
en: The version of the site.
Default: Null
Required: false
RulesetId:
Type: Number
Description:
en: The ID of the WAF ruleset. You can obtain this ID by calling the [ListWafRulesets](https://www.alibabacloud.com/help/en/doc-detail/2850233.html) operation.
Default: Null
Required: false
SiteId:
Type: Number
Description:
en: The ID of the site. You can obtain this ID by calling the [ListSites](https://www.alibabacloud.com/help/en/doc-detail/2850189.html) operation.
Required: true
Phase:
Type: String
Description:
en: The processing phase of the WAF rule.
Required: true
Shared:
Description:
en: Configurations that are shared by multiple rules.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
Target:
Type: String
Description:
en: 'The type of the protection target. Valid values: `web` and `app`.'
AllowedValues:
- web
- app
Default: Null
Required: false
Actions:
Description:
en: The extended action.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
Response:
Description:
en: Custom response settings.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
Code:
Type: Number
Description:
en: The custom response code.
Default: Null
Required: false
Id:
Type: Number
Description:
en: The ID of the custom response page.
Default: Null
Required: false
CrossSiteId:
Type: Number
Description:
en: The ID of the cross-domain site.
Default: Null
Required: false
Mode:
Type: String
Description:
en: |-
The integration mode for the Web SDK. Valid values:
- `automatic`
- `manual`
AllowedValues:
- automatic
- manual
Default: Null
Required: false
Action:
Type: String
Description:
en: The action to take.
Default: Null
Required: false
Expression:
Type: String
Description:
en: The expression for the rule.
Default: Null
Required: false
Match:
Description:
en: The matching engine configuration.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
MatchType:
Type: String
Description:
en: The match field.
Default: Null
Required: false
Logic:
Type: String
Description:
en: The logical relationship between criteria.
Default: Null
Required: false
Criteria:
Description:
en: The match criteria.
Required: false
Default: Null
Type: Json
AssociationProperty: List[Parameter]
AssociationPropertyMetadata:
Parameter:
Description:
en: The match criteria.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
MatchType:
Type: String
Description:
en: The match field.
Default: Null
Required: false
Logic:
Type: String
Description:
en: The logical relationship between criteria.
Default: Null
Required: false
Criteria:
Description:
en: The match criteria.
Required: false
Default: Null
Type: Json
AssociationProperty: List[Parameter]
AssociationPropertyMetadata:
Parameter:
Description:
en: The match criteria.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
MatchType:
Type: String
Description:
en: The match field.
Default: Null
Required: false
Logic:
Type: String
Description:
en: The logical relationship between criteria.
Default: Null
Required: false
Criteria:
Description:
en: The match criteria.
Required: false
Default: Null
Type: Json
AssociationProperty: List[Parameters]
AssociationPropertyMetadata:
Parameters:
MatchType:
Type: String
Description:
en: The match field.
Default: Null
Required: false
Name:
Type: String
Description:
en: The name of the ruleset.
Default: Null
Required: false
Config:
Description:
en: The configuration of the rule.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
Status:
Type: String
Description:
en: The status of the rule.
Default: Null
Required: false
ManagedGroupId:
Type: Number
Description:
en: The ID of the managed rule group.
Default: Null
Required: false
Type:
Type: String
Description:
en: The type of the rule.
Default: Null
Required: false
Sigchl:
Description:
en: Token validation settings.
Required: false
Default: Null
Type: Json
AssociationProperty: List[Parameter]
AssociationPropertyMetadata:
Parameter:
Type: String
Description:
en: A token validation setting.
Default: Null
Required: false
Name:
Type: String
Description:
en: The name of the rule.
Default: Null
Required: false
SecurityLevel:
Description:
en: Security level configuration.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
Value:
Type: String
Description:
en: The security level.
Default: Null
Required: false
ManagedRulesets:
Description:
en: A list of managed rulesets.
Required: false
Default: Null
Type: Json
AssociationProperty: List[Parameter]
AssociationPropertyMetadata:
Parameter:
Description:
en: A managed ruleset.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
NumberTotal:
Type: Number
Description:
en: The total number of rules.
Default: Null
Required: false
ProtectionLevel:
Type: Number
Description:
en: The protection level.
Default: Null
Required: false
ManagedRules:
Description:
en: A list of managed rules.
Required: false
Default: Null
Type: Json
AssociationProperty: List[Parameters]
AssociationPropertyMetadata:
Parameters:
Status:
Type: String
Description:
en: The status of the managed rule.
Default: Null
Required: false
Action:
Type: String
Description:
en: The action of the managed rule.
Default: Null
Required: false
Id:
Type: Number
Description:
en: The ID of the managed rule.
Default: Null
Required: false
NumberEnabled:
Type: Number
Description:
en: The number of enabled rules.
Default: Null
Required: false
AttackType:
Type: Number
Description:
en: The attack type.
Default: Null
Required: false
Action:
Type: String
Description:
en: The action to perform.
Default: Null
Required: false
Notes:
Type: String
Description:
en: Remarks about the rule.
Default: Null
Required: false
Value:
Type: String
Description:
en: The value for IP access control.
Default: Null
Required: false
Actions:
Description:
en: The extended action.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
Response:
Description:
en: Custom response settings.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
Code:
Type: Number
Description:
en: The custom response code.
Default: Null
Required: false
Id:
Type: Number
description:
en: The ID of the custom response page.
Default: Null
Required: false
Bypass:
Description:
en: Settings for bypassing WAF modules or rules.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
Skip:
Type: String
Description:
en: The type of module to skip.
Default: Null
Required: false
Tags:
Description:
en: A list of modules to skip.
Required: false
Default: Null
Type: Json
AssociationProperty: List[Parameter]
AssociationPropertyMetadata:
Parameter:
Type: String
Description:
en: A module to skip.
Default: Null
Required: false
ListMetadata:
Order:
- Key
- Value
RegularTypes:
Description:
en: A list of managed rule types to skip.
Required: false
Default: Null
Type: Json
AssociationProperty: List[Parameter]
AssociationPropertyMetadata:
Parameter:
Type: String
Description:
en: A managed rule type to skip.
Default: Null
Required: false
RegularRules:
Description:
en: A list of managed rule IDs to skip.
Required: false
Default: Null
Type: Json
AssociationProperty: List[Parameter]
AssociationPropertyMetadata:
Parameter:
Type: Number
Description:
en: A managed rule ID to skip.
Default: Null
Required: false
CustomRules:
Description:
en: A list of custom rule IDs to skip.
Required: false
Default: Null
Type: Json
AssociationProperty: List[Parameter]
AssociationPropertyMetadata:
Parameter:
Type: Number
Description:
en: A custom rule ID to skip.
Default: Null
Required: false
RateLimit:
Description:
en: Rate limit configuration.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
Threshold:
Description:
en: The rate limit threshold.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
DistinctManagedRules:
Type: Number
Description:
en: The threshold for the number of distinct managed rules that are triggered.
Default: Null
Required: false
Request:
Type: Number
Description:
en: The request count threshold.
Default: Null
Required: false
Traffic:
Type: String
Description:
en: The traffic volume threshold.
Default: Null
Required: false
ResponseStatus:
Description:
en: The response status threshold.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
Count:
Type: Number
Description:
en: The threshold for the count of a specific response code.
Default: Null
Required: false
Code:
Type: Number
Description:
en: The HTTP response code.
Default: Null
Required: false
Ratio:
Type: Number
Description:
en: The threshold for the percentage of a specific response code.
Default: Null
Required: false
ManagedRulesBlocked:
Type: Number
Description:
en: The block count threshold for managed rules.
Default: Null
Required: false
Characteristics:
Description:
en: The statistical characteristics for rate limiting.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
Logic:
Type: String
Description:
en: The logical relationship between criteria.
Default: Null
Required: false
Criteria:
Description:
en: The match criteria.
Required: false
Default: Null
Type: Json
AssociationProperty: List[Parameter]
AssociationPropertyMetadata:
Parameter:
Description:
en: The match criteria.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
MatchType:
Type: String
Description:
en: The match field.
Default: Null
Required: false
Logic:
Type: String
Description:
en: The logical relationship between criteria.
Default: Null
Required: false
Criteria:
Description:
en: The match criteria.
Required: false
Default: Null
Type: Json
AssociationProperty: List[Parameter]
AssociationPropertyMetadata:
Parameter:
Description:
en: The match criteria.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
MatchType:
Type: String
Description:
en: The match field.
Default: Null
Required: false
Logic:
Type: String
Description:
en: The logical relationship between criteria.
Default: Null
Required: false
Criteria:
Description:
en: The match criteria.
Required: false
Default: Null
Type: Json
AssociationProperty: List[Parameters]
AssociationPropertyMetadata:
Parameters:
MatchType:
Type: String
Description:
en: The match field.
Default: Null
Required: false
Interval:
Type: Number
Description:
en: The statistical interval in seconds.
Default: Null
Required: false
Ttl:
Type: Number
Description:
en: The time-to-live (TTL) in seconds for the rate limit counter.
Default: Null
Required: false
OnHit:
Type: Boolean
Description:
en: Specifies whether to apply the rate limit to requests that are served from the cache.
Default: Null
Required: false
Expression:
Type: String
Description:
en: The expression for the rule.
Default: Null
Required: false
Timer:
Description:
en: The timer configuration.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
Scopes:
Type: String
Description:
en: |-
The type of schedule. Valid values:
- `permanent`
- `periods`
- `weekly`
AllowedValues:
- permanent
- periods
- weekly
Default: Null
Required: false
WeeklyPeriods:
Description:
en: The recurring weekly schedule.
Required: false
Default: Null
Type: Json
AssociationProperty: List[Parameter]
AssociationPropertyMetadata:
Parameter:
Description:
en: A recurring weekly schedule entry.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
Days:
Type: String
Description:
en: The days of the week, represented by numbers from 1 (Monday) to 7 (Sunday). Multiple days are separated by commas. For example, "1,3" indicates Monday and Wednesday.
Default: Null
Required: false
DailyPeriods:
Description:
en: The time periods within the specified days when the rule is active.
Required: false
Default: Null
Type: Json
AssociationProperty: List[Parameters]
AssociationPropertyMetadata:
Parameters:
Start:
Type: String
Description:
en: The start time in HH:mm:ss format.
Default: Null
Required: false
End:
Type: String
Description:
en: The end time in HH:mm:ss format.
Default: Null
Required: false
Periods:
Description:
en: The specific time periods when the rule is active.
Required: false
Default: Null
Type: Json
AssociationProperty: List[Parameters]
AssociationPropertyMetadata:
Parameters:
Start:
Type: String
Description:
en: The start time in UTC, specified in RFC 3339 format.
Default: Null
Required: false
End:
Type: String
Description:
en: The end time in UTC, specified in RFC 3339 format.
Default: Null
Required: false
Zone:
Type: Number
Description:
en: The time zone, specified as an offset from UTC in hours. For example, 8 for UTC+8 and -8 for UTC-8. Valid values: -12 to +14. If you do not specify this parameter, UTC is used by default.
Default: Null
Required: false
AppPackage:
Description:
en: Secondary packaging inspection settings.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
PackageSigns:
Description:
en: The legitimate package signatures.
Required: false
Default: Null
Type: Json
AssociationProperty: List[Parameters]
AssociationPropertyMetadata:
Parameters:
Name:
Type: String
Description:
en: The name of a legitimate package.
Default: Null
Required: false
Sign:
Type: String
Description:
en: The package signature.
Default: Null
Required: false
Action:
Type: String
Description:
en: The action to perform.
Default: Null
Required: false
AppSdk:
Description:
en: The App SDK configuration.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
CustomSign:
Description:
en: Custom tag settings.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
Key:
Type: String
Description:
en: The name of the custom tag.
Default: Null
Required: false
Value:
Type: String
Description:
en: The value of the custom tag.
Default: Null
Required: false
CustomSignStatus:
Type: String
Description:
en: The status of the custom tag feature.
Default: Null
Required: false
FeatureAbnormal:
Description:
en: A list of detected abnormal features.
Required: false
Default: Null
Type: Json
AssociationProperty: List[Parameter]
AssociationPropertyMetadata:
Parameter:
Type: String
Description:
en: A detected abnormal feature.
Default: Null
Required: false
ManagedList:
Type: String
Description:
en: The name of the managed list.
Default: Null
Required: false
Id:
Type: Number
Description:
en: The ID of the rule.
Default: Null
Required: false
Resources:
ExtensionResource:
Type: ALIYUN::ESA::WafRule
Properties:
SiteVersion:
Ref: SiteVersion
RulesetId:
Ref: RulesetId
SiteId:
Ref: SiteId
Phase:
Ref: Phase
Shared:
Ref: Shared
Config:
Ref: Config
Outputs:
Phase:
Value:
Fn::GetAtt:
- ExtensionResource
- Phase
Description: The processing phase of the WAF rule.
RulesetId:
Value:
Fn::GetAtt:
- ExtensionResource
- RulesetId
Description: The ID of the WAF ruleset.
UpdateTime:
Value:
Fn::GetAtt:
- ExtensionResource
- UpdateTime
Description: The time when the rule was last modified.
Config:
Value:
Fn::GetAtt:
- ExtensionResource
- Config
Description: The configuration of the rule.
WafRuleId:
Value:
Fn::GetAtt:
- ExtensionResource
- WafRuleId
Description: The WAF rule ID.
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"SiteVersion": {
"Type": "Number",
"Description": {
"en": "The version of the website."
},
"Default": null,
"Required": false
},
"RulesetId": {
"Type": "Number",
"Description": {
"en": "The ID of the WAF ruleset. You can call the [ListWafRulesets](https://www.alibabacloud.com/help/en/doc-detail/2850233.html) operation to obtain this ID."
},
"Default": null,
"Required": false
},
"SiteId": {
"Type": "Number",
"Description": {
"en": "The ID of the website. You can call the [ListSites](https://www.alibabacloud.com/help/en/doc-detail/2850189.html) operation to obtain this ID."
},
"Required": true
},
"Phase": {
"Type": "String",
"Description": {
"en": "The processing phase of the WAF rule."
},
"Required": true
},
"Shared": {
"Description": {
"en": "Shared rule configurations."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"Target": {
"Type": "String",
"Description": {
"en": "The protection target. Valid values: `web` and `app`."
},
"AllowedValues": [
"web",
"app"
],
"Default": null,
"Required": false
},
"Actions": {
"Description": {
"en": "Extended action configuration."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"Response": {
"Description": {
"en": "Custom response settings."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"Code": {
"Type": "Number",
"Description": {
"en": "The custom response code."
},
"Default": null,
"Required": false
},
"Id": {
"Type": "Number",
"Description": {
"en": "The custom response page ID."
},
"Default": null,
"Required": false
}
}
}
}
}
}
},
"CrossSiteId": {
"Type": "Number",
"Description": {
"en": "The cross-domain website ID."
},
"Default": null,
"Required": false
},
"Mode": {
"Type": "String",
"Description": {
"en": "The Web SDK integration mode. Valid values:\n- `automatic`\n- `manual`"
},
"AllowedValues": [
"automatic",
"manual"
],
"Default": null,
"Required": false
},
"Action": {
"Type": "String",
"Description": {
"en": "The action to perform."
},
"Default": null,
"Required": false
},
"Expression": {
"Type": "String",
"Description": {
"en": "The rule expression."
},
"Default": null,
"Required": false
},
"Match": {
"Description": {
"en": "The matching engine configuration."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"MatchType": {
"Type": "String",
"Description": {
"en": "The match field."
},
"Default": null,
"Required": false
},
"Logic": {
"Type": "String",
"Description": {
"en": "The logical relationship between the criteria."
},
"Default": null,
"Required": false
},
"Criteria": {
"Description": {
"en": "A list of criteria."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationProperty": "List[Parameter]",
"AssociationPropertyMetadata": {
"Parameter": {
"Description": {
"en": "A list of criteria."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"MatchType": {
"Type": "String",
"Description": {
"en": "The match field."
},
"Default": null,
"Required": false
},
"Logic": {
"Type": "String",
"Description": {
"en": "The logical relationship between the criteria."
},
"Default": null,
"Required": false
},
"Criteria": {
"Description": {
"en": "A list of criteria."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationProperty": "List[Parameter]",
"AssociationPropertyMetadata": {
"Parameter": {
"Description": {
"en": "A list of criteria."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"MatchType": {
"Type": "String",
"Description": {
"en": "The match field."
},
"Default": null,
"Required": false
},
"Logic": {
"Type": "String",
"Description": {
"en": "The logical relationship between the criteria."
},
"Default": null,
"Required": false
},
"Criteria": {
"Description": {
"en": "A list of criteria."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationProperty": "List[Parameters]",
"AssociationPropertyMetadata": {
"Parameters": {
"MatchType": {
"Type": "String",
"Description": {
"en": "The match field."
},
"Default": null,
"Required": false
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
},
"Name": {
"Type": "String",
"Description": {
"en": "The ruleset name."
},
"Default": null,
"Required": false
}
}
}
},
"Config": {
"Description": {
"en": "The rule configuration."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"Status": {
"Type": "String",
"Description": {
"en": "The rule status."
},
"Default": null,
"Required": false
},
"ManagedGroupId": {
"Type": "Number",
"Description": {
"en": "The managed rule group ID."
},
"Default": null,
"Required": false
},
"Type": {
"Type": "String",
"Description": {
"en": "The rule type."
},
"Default": null,
"Required": false
},
"Sigchl": {
"Description": {
"en": "The token check settings."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationProperty": "List[Parameter]",
"AssociationPropertyMetadata": {
"Parameter": {
"Type": "String",
"Description": {
"en": "The token check settings."
},
"Default": null,
"Required": false
}
}
},
"Name": {
"Type": "String",
"Description": {
"en": "The rule name."
},
"Default": null,
"Required": false
},
"SecurityLevel": {
"Description": {
"en": "The security level configuration."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"Value": {
"Type": "String",
"Description": {
"en": "The security level."
},
"Default": null,
"Required": false
}
}
}
},
"ManagedRulesets": {
"Description": {
"en": "A list of managed rulesets."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationProperty": "List[Parameter]",
"AssociationPropertyMetadata": {
"Parameter": {
"Description": {
"en": "A list of managed rulesets."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"NumberTotal": {
"Type": "Number",
"Description": {
"en": "The total number of rules."
},
"Default": null,
"Required": false
},
"ProtectionLevel": {
"Type": "Number",
"Description": {
"en": "The protection level."
},
"Default": null,
"Required": false
},
"ManagedRules": {
"Description": {
"en": "A list of managed rules."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationProperty": "List[Parameters]",
"AssociationPropertyMetadata": {
"Parameters": {
"Status": {
"Type": "String",
"Description": {
"en": "The status of the managed rule."
},
"Default": null,
"Required": false
},
"Action": {
"Type": "String",
"Description": {
"en": "The action of the managed rule."
},
"Default": null,
"Required": false
},
"Id": {
"Type": "Number",
"Description": {
"en": "The managed rule ID."
},
"Default": null,
"Required": false
}
}
}
},
"NumberEnabled": {
"Type": "Number",
"Description": {
"en": "The number of enabled rules."
},
"Default": null,
"Required": false
},
"AttackType": {
"Type": "Number",
"Description": {
"en": "The attack type."
},
"Default": null,
"Required": false
},
"Action": {
"Type": "String",
"Description": {
"en": "The action to perform."
},
"Default": null,
"Required": false
}
}
}
}
}
},
"Notes": {
"Type": "String",
"Description": {
"en": "Notes for the rule."
},
"Default": null,
"Required": false
},
"Value": {
"Type": "String",
"Description": {
"en": "The value for IP access control."
},
"Default": null,
"Required": false
},
"Actions": {
"Description": {
"en": "Extended action configuration."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"Response": {
"Description": {
"en": "The custom response settings."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"Code": {
"Type": "Number",
"Description": {
"en": "The custom response code."
},
"Default": null,
"Required": false
},
"Id": {
"Type": "Number",
"Description": {
"en": "The custom response page ID."
},
"Default": null,
"Required": false
}
}
}
},
"Bypass": {
"Description": {
"en": "The settings to skip specific checks."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"Skip": {
"Type": "String",
"Description": {
"en": "The type of module to skip."
},
"Default": null,
"Required": false
},
"Tags": {
"Description": {
"en": "A list of modules to skip."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationProperty": "List[Parameter]",
"AssociationPropertyMetadata": {
"Parameter": {
"Type": "String",
"Description": {
"en": "A list of modules to skip."
},
"Default": null,
"Required": false
},
"ListMetadata": {
"Order": [
"Key",
"Value"
]
}
}
},
"RegularTypes": {
"Description": {
"en": "A list of managed rule types to skip."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationProperty": "List[Parameter]",
"AssociationPropertyMetadata": {
"Parameter": {
"Type": "String",
"Description": {
"en": "A list of managed rule types to skip."
},
"Default": null,
"Required": false
}
}
},
"RegularRules": {
"Description": {
"en": "A list of managed rule IDs to skip."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationProperty": "List[Parameter]",
"AssociationPropertyMetadata": {
"Parameter": {
"Type": "Number",
"Description": {
"en": "A list of managed rule IDs to skip."
},
"Default": null,
"Required": false
}
}
},
"CustomRules": {
"Description": {
"en": "A list of custom rule IDs to skip."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationProperty": "List[Parameter]",
"AssociationPropertyMetadata": {
"Parameter": {
"Type": "Number",
"Description": {
"en": "A list of custom rule IDs to skip."
},
"Default": null,
"Required": false
}
}
}
}
}
}
}
}
},
"RateLimit": {
"Description": {
"en": "The rate limit configuration."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"Threshold": {
"Description": {
"en": "The rate limit threshold."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"DistinctManagedRules": {
"Type": "Number",
"Description": {
"en": "The trigger threshold for distinct managed rules."
},
"Default": null,
"Required": false
},
"Request": {
"Type": "Number",
"Description": {
"en": "The request count threshold."
},
"Default": null,
"Required": false
},
"Traffic": {
"Type": "String",
"Description": {
"en": "The traffic volume threshold."
},
"Default": null,
"Required": false
},
"ResponseStatus": {
"Description": {
"en": "Thresholds for response status codes."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"Count": {
"Type": "Number",
"Description": {
"en": "The trigger count for a specific response code."
},
"Default": null,
"Required": false
},
"Code": {
"Type": "Number",
"Description": {
"en": "The HTTP response code."
},
"Default": null,
"Required": false
},
"Ratio": {
"Type": "Number",
"Description": {
"en": "The percentage threshold for a specific response code."
},
"Default": null,
"Required": false
}
}
}
},
"ManagedRulesBlocked": {
"Type": "Number",
"Description": {
"en": "The hit count threshold for managed rules."
},
"Default": null,
"Required": false
}
}
}
},
"Characteristics": {
"Description": {
"en": "The characteristics to track for rate limiting."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"Logic": {
"Type": "String",
"Description": {
"en": "The logical relationship between the criteria."
},
"Default": null,
"Required": false
},
"Criteria": {
"Description": {
"en": "A list of criteria."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationProperty": "List[Parameter]",
"AssociationPropertyMetadata": {
"Parameter": {
"Description": {
"en": "A list of criteria."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"MatchType": {
"Type": "String",
"Description": {
"en": "The match field."
},
"Default": null,
"Required": false
},
"Logic": {
"Type": "String",
"Description": {
"en": "The logical relationship between the criteria."
},
"Default": null,
"Required": false
},
"Criteria": {
"Description": {
"en": "A list of criteria."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationProperty": "List[Parameter]",
"AssociationPropertyMetadata": {
"Parameter": {
"Description": {
"en": "A list of criteria."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"MatchType": {
"Type": "String",
"Description": {
"en": "The match field."
},
"Default": null,
"Required": false
},
"Logic": {
"Type": "String",
"Description": {
"en": "The logical relationship between the criteria."
},
"Default": null,
"Required": false
},
"Criteria": {
"Description": {
"en": "A list of criteria."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationProperty": "List[Parameters]",
"AssociationPropertyMetadata": {
"Parameters": {
"MatchType": {
"Type": "String",
"Description": {
"en": "The match field."
},
"Default": null,
"Required": false
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
},
"Interval": {
"Type": "Number",
"Description": {
"en": "The statistical interval in seconds."
},
"Default": null,
"Required": false
},
"Ttl": {
"Type": "Number",
"Description": {
"en": "The time-to-live (TTL) in seconds for the rate limit counter."
},
"Default": null,
"Required": false
},
"OnHit": {
"Type": "Boolean",
"Description": {
"en": "Specifies whether to apply the rate limit to cached requests."
},
"Default": null,
"Required": false
}
}
}
},
"Expression": {
"Type": "String",
"Description": {
"en": "The rule expression."
},
"Default": null,
"Required": false
},
"Timer": {
"Description": {
"en": "The timer configuration."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"Scopes": {
"Type": "String",
"Description": {
"en": "The schedule type. Valid values: \n- `permanent`\n- `periods`\n- `weekly`"
},
"AllowedValues": [
"permanent",
"periods",
"weekly"
],
"Default": null,
"Required": false
},
"WeeklyPeriods": {
"Description": {
"en": "The recurring weekly schedule."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationProperty": "List[Parameter]",
"AssociationPropertyMetadata": {
"Parameter": {
"Description": {
"en": "The recurring weekly schedule."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"Days": {
"Type": "String",
"Description": {
"en": "The days of the week when the rule is active. Use a comma-separated list of numbers from 1 (Monday) to 7 (Sunday).Example: `1,3` for Monday and Wednesday."
},
"Default": null,
"Required": false
},
"DailyPeriods": {
"Description": {
"en": "The active time periods within the specified days."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationProperty": "List[Parameters]",
"AssociationPropertyMetadata": {
"Parameters": {
"Start": {
"Type": "String",
"Description": {
"en": "The start time in HH:mm:ss format."
},
"Default": null,
"Required": false
},
"End": {
"Type": "String",
"Description": {
"en": "The end time in HH:mm:ss format."
},
"Default": null,
"Required": false
}
}
}
}
}
}
}
}
},
"Periods": {
"Description": {
"en": "The specific time periods when the rule is active."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationProperty": "List[Parameters]",
"AssociationPropertyMetadata": {
"Parameters": {
"Start": {
"Type": "String",
"Description": {
"en": "The start time in UTC, specified in the RFC 3339 format."
},
"Default": null,
"Required": false
},
"End": {
"Type": "String",
"Description": {
"en": "The end time in UTC, specified in the RFC 3339 format."
},
"Default": null,
"Required": false
}
}
}
},
"Zone": {
"Type": "Number",
"Description": {
"en": "The time zone, as an integer offset from UTC. Valid values: -12 to +14.Example: `8` for UTC+8."
},
"Default": null,
"Required": false
}
}
}
},
"AppPackage": {
"Description": {
"en": "Settings for app repackaging detection."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"PackageSigns": {
"Description": {
"en": "The legitimate package signatures."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationProperty": "List[Parameters]",
"AssociationPropertyMetadata": {
"Parameters": {
"Name": {
"Type": "String",
"Description": {
"en": "The legitimate package name."
},
"Default": null,
"Required": false
},
"Sign": {
"Type": "String",
"Description": {
"en": "The package signature."
},
"Default": null,
"Required": false
}
}
}
}
}
}
},
"Action": {
"Type": "String",
"Description": {
"en": "The action to perform."
},
"Default": null,
"Required": false
},
"AppSdk": {
"Description": {
"en": "The App SDK configuration."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"CustomSign": {
"Description": {
"en": "The custom tag settings."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"Key": {
"Type": "String",
"Description": {
"en": "The custom tag name."
},
"Default": null,
"Required": false
},
"Value": {
"Type": "String",
"Description": {
"en": "The custom tag value."
},
"Default": null,
"Required": false
}
}
}
},
"CustomSignStatus": {
"Type": "String",
"Description": {
"en": "The status of the custom tag feature."
},
"Default": null,
"Required": false
},
"FeatureAbnormal": {
"Description": {
"en": "A list of detected abnormal features."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationProperty": "List[Parameter]",
"AssociationPropertyMetadata": {
"Parameter": {
"Type": "String",
"Description": {
"en": "A list of detected abnormal features."
},
"Default": null,
"Required": false
}
}
}
}
}
},
"ManagedList": {
"Type": "String",
"Description": {
"en": "The managed list."
},
"Default": null,
"Required": false
},
"Id": {
"Type": "Number",
"Description": {
"en": "The rule ID."
},
"Default": null,
"Required": false
}
}
}
}
},
"Resources": {
"ExtensionResource": {
"Type": "ALIYUN::ESA::WafRule",
"Properties": {
"SiteVersion": {
"Ref": "SiteVersion"
},
"RulesetId": {
"Ref": "RulesetId"
},
"SiteId": {
"Ref": "SiteId"
},
"Phase": {
"Ref": "Phase"
},
"Shared": {
"Ref": "Shared"
},
"Config": {
"Ref": "Config"
}
}
}
},
"Outputs": {
"Phase": {
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Phase"
]
},
"Description": "The processing phase of the WAF rule."
},
"RulesetId": {
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"RulesetId"
]
},
"Description": "The WAF ruleset ID."
},
"UpdateTime": {
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"UpdateTime"
]
},
"Description": "The time when the rule was last modified."
},
"Config": {
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Config"
]
},
"Description": "The rule configuration."
},
"WafRuleId": {
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"WafRuleId"
]
},
"Description": "The WAF rule ID."
}
}
}