import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; export interface WafCustomRuleConfig extends cdktf.TerraformMetaArguments { /** * Action type, 1(Block), 2(Captcha), 3(log), 4(Redirect). * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#action_type WafCustomRule#action_type} */ readonly actionType: string; /** * Domain. * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#domain WafCustomRule#domain} */ readonly domain: string; /** * Expiration time in second-level timestamp, for example, 1677254399 indicates the expiration time is 2023-02-24 23:59:59; 0 indicates it will never expire. * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#expire_time WafCustomRule#expire_time} */ readonly expireTime: string; /** * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#id WafCustomRule#id} * * Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. * If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable. */ readonly id?: string; /** * Rule execution mode: TimedJob indicates scheduled execution. CronJob indicates periodic execution. * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#job_type WafCustomRule#job_type} */ readonly jobType?: string; /** * Rule Name. * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#name WafCustomRule#name} */ readonly name: string; /** * If the action is a Redirect, it represents the redirect address; Other situations can be left blank. * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#redirect WafCustomRule#redirect} */ readonly redirect?: string; /** * Priority, value range 0-100. * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#sort_id WafCustomRule#sort_id} */ readonly sortId: string; /** * The status of the rule, 1(open), 0(close). * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#status WafCustomRule#status} */ readonly status?: string; /** * job_date_time block * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#job_date_time WafCustomRule#job_date_time} */ readonly jobDateTime?: WafCustomRuleJobDateTime; /** * strategies block * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#strategies WafCustomRule#strategies} */ readonly strategies: WafCustomRuleStrategies[] | cdktf.IResolvable; } export interface WafCustomRuleJobDateTimeCron { /** * Days in each month for execution. Note: This field may return null, indicating that no valid values can be obtained. * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#days WafCustomRule#days} */ readonly days?: number[]; /** * End time. Note: This field may return null, indicating that no valid values can be obtained. * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#end_time WafCustomRule#end_time} */ readonly endTime?: string; /** * Start time. Note: This field may return null, indicating that no valid values can be obtained. * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#start_time WafCustomRule#start_time} */ readonly startTime?: string; /** * Days of each week for execution. Note: This field may return null, indicating that no valid values can be obtained. * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#w_days WafCustomRule#w_days} */ readonly wDays?: number[]; } export declare function wafCustomRuleJobDateTimeCronToTerraform(struct?: WafCustomRuleJobDateTimeCron | cdktf.IResolvable): any; export declare function wafCustomRuleJobDateTimeCronToHclTerraform(struct?: WafCustomRuleJobDateTimeCron | cdktf.IResolvable): any; export declare class WafCustomRuleJobDateTimeCronOutputReference extends cdktf.ComplexObject { private isEmptyObject; private resolvableValue?; /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param complexObjectIndex the index of this item in the list * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) */ constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean); get internalValue(): WafCustomRuleJobDateTimeCron | cdktf.IResolvable | undefined; set internalValue(value: WafCustomRuleJobDateTimeCron | cdktf.IResolvable | undefined); private _days?; get days(): number[]; set days(value: number[]); resetDays(): void; get daysInput(): number[]; private _endTime?; get endTime(): string; set endTime(value: string); resetEndTime(): void; get endTimeInput(): string; private _startTime?; get startTime(): string; set startTime(value: string); resetStartTime(): void; get startTimeInput(): string; private _wDays?; get wDays(): number[]; set wDays(value: number[]); resetWDays(): void; get wDaysInput(): number[]; } export declare class WafCustomRuleJobDateTimeCronList extends cdktf.ComplexList { protected terraformResource: cdktf.IInterpolatingParent; protected terraformAttribute: string; protected wrapsSet: boolean; internalValue?: WafCustomRuleJobDateTimeCron[] | cdktf.IResolvable; /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) */ constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean); /** * @param index the index of the item to return */ get(index: number): WafCustomRuleJobDateTimeCronOutputReference; } export interface WafCustomRuleJobDateTimeTimed { /** * End timestamp, in seconds. Note: This field may return null, indicating that no valid values can be obtained. * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#end_date_time WafCustomRule#end_date_time} */ readonly endDateTime?: number; /** * Start timestamp, in seconds. Note: This field may return null, indicating that no valid values can be obtained. * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#start_date_time WafCustomRule#start_date_time} */ readonly startDateTime?: number; } export declare function wafCustomRuleJobDateTimeTimedToTerraform(struct?: WafCustomRuleJobDateTimeTimed | cdktf.IResolvable): any; export declare function wafCustomRuleJobDateTimeTimedToHclTerraform(struct?: WafCustomRuleJobDateTimeTimed | cdktf.IResolvable): any; export declare class WafCustomRuleJobDateTimeTimedOutputReference extends cdktf.ComplexObject { private isEmptyObject; private resolvableValue?; /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param complexObjectIndex the index of this item in the list * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) */ constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean); get internalValue(): WafCustomRuleJobDateTimeTimed | cdktf.IResolvable | undefined; set internalValue(value: WafCustomRuleJobDateTimeTimed | cdktf.IResolvable | undefined); private _endDateTime?; get endDateTime(): number; set endDateTime(value: number); resetEndDateTime(): void; get endDateTimeInput(): number; private _startDateTime?; get startDateTime(): number; set startDateTime(value: number); resetStartDateTime(): void; get startDateTimeInput(): number; } export declare class WafCustomRuleJobDateTimeTimedList extends cdktf.ComplexList { protected terraformResource: cdktf.IInterpolatingParent; protected terraformAttribute: string; protected wrapsSet: boolean; internalValue?: WafCustomRuleJobDateTimeTimed[] | cdktf.IResolvable; /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) */ constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean); /** * @param index the index of the item to return */ get(index: number): WafCustomRuleJobDateTimeTimedOutputReference; } export interface WafCustomRuleJobDateTime { /** * Time zone. Note: This field may return null, indicating that no valid values can be obtained. * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#time_t_zone WafCustomRule#time_t_zone} */ readonly timeTZone?: string; /** * cron block * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#cron WafCustomRule#cron} */ readonly cron?: WafCustomRuleJobDateTimeCron[] | cdktf.IResolvable; /** * timed block * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#timed WafCustomRule#timed} */ readonly timed?: WafCustomRuleJobDateTimeTimed[] | cdktf.IResolvable; } export declare function wafCustomRuleJobDateTimeToTerraform(struct?: WafCustomRuleJobDateTimeOutputReference | WafCustomRuleJobDateTime): any; export declare function wafCustomRuleJobDateTimeToHclTerraform(struct?: WafCustomRuleJobDateTimeOutputReference | WafCustomRuleJobDateTime): any; export declare class WafCustomRuleJobDateTimeOutputReference extends cdktf.ComplexObject { private isEmptyObject; /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing */ constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string); get internalValue(): WafCustomRuleJobDateTime | undefined; set internalValue(value: WafCustomRuleJobDateTime | undefined); private _timeTZone?; get timeTZone(): string; set timeTZone(value: string); resetTimeTZone(): void; get timeTZoneInput(): string; private _cron; get cron(): WafCustomRuleJobDateTimeCronList; putCron(value: WafCustomRuleJobDateTimeCron[] | cdktf.IResolvable): void; resetCron(): void; get cronInput(): any; private _timed; get timed(): WafCustomRuleJobDateTimeTimedList; putTimed(value: WafCustomRuleJobDateTimeTimed[] | cdktf.IResolvable): void; resetTimed(): void; get timedInput(): any; } export interface WafCustomRuleStrategies { /** * Matching parameter * There are two types of configuration parameters: unsupported parameters and supported parameters. * The matching parameter can be entered only when the matching field is one of the following four. Otherwise, the parameter is not supported. * GET (GET parameter value) * POST (POST parameter value) * ARGS_COOKIE (Cookie parameter value) * ARGS_HEADER (Header parameter value) * Note: This field may return null, indicating that no valid values can be obtained. * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#arg WafCustomRule#arg} */ readonly arg: string; /** * 0: case-sensitive, 1: case-insensitive. Note: This field may return null, indicating that no valid values can be obtained. * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#case_not_sensitive WafCustomRule#case_not_sensitive} */ readonly caseNotSensitive?: number; /** * Logic symbol * Logical symbols are divided into the following types: * empty (content is empty) * null (do not exist) * eq (equal to) * neq (not equal to) * contains (contain) * ncontains (do not contain) * strprefix (prefix matching) * strsuffix (suffix matching) * len_eq (length equals to) * len_gt (length is greater than) * len_lt (length is less than) * ipmatch (belong to) * ipnmatch (do not belong to) * numgt (number greater than) * numlt (number less than) * geo_in (IP geo belongs to) * geo_not_in (IP geo not belongs to) * rematch (regex match) * numgt (numerically greater than) * numlt (numerically less than) * numeq (numerically equal to) * numneq (numerically not equal to) * numle (numerically less than or equal to) * numge (numerically greater than or equal to) * Different matching fields correspond to different logical operators. For details, see the matching field table above. * Note: This field may return null, indicating that no valid values can be obtained. * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#compare_func WafCustomRule#compare_func} */ readonly compareFunc: string; /** * Matching content * Currently, when the matching field is COOKIE (cookie), the matching content is not required. In other scenes, the matching content is required. * Note: This field may return null, indicating that no valid values can be obtained. * * Docs at Terraform Registry: {@link https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/1.82.49/docs/resources/waf_custom_rule#content WafCustomRule#content} */ readonly content: string; /** * Matching field * Different matching fields result in different matching parameters, logical operators, and matching contents. The details are as follows: *
| Matching Field | Matching Parameter | Logical Symbol | Matching Content |
|---|---|---|---|
| IP (source IP) | Parameters are not supported. | ipmatch (match) ipnmatch (mismatch) | Multiple IP addresses are separated by commas. A maximum of 20 IP addresses are allowed. |
| IPv6 (source IPv6) | Parameters are not supported. | ipmatch (match) ipnmatch (mismatch) | A single IPv6 address is supported. |
| Referer (referer) | Parameters are not supported. | empty (Content is empty.) null (do not exist) eq (equal to) neq (not equal to) contains (contain) ncontains (do not contain) len_eq (length equals to) len_gt (length is greater than) len_lt (length is less than) strprefix (prefix matching) strsuffix (suffix matching) rematch (regular expression matching) | Enter the content, with a maximum of 512 characters. |
| URL (request path) | Parameters are not supported. | eq (equal to) neq (not equal to) contains (contain) ncontains (do not contain) len_eq (length equals to) len_gt (length is greater than) len_lt (length is less than) strprefix (prefix matching) strsuffix (suffix matching) rematch (regular expression matching) | Enter the content starting with /, with a maximum of 512 characters. |
| UserAgent (UserAgent) | Parameters are not supported. | Same logical symbols as the matching field Referer | Enter the content with a maximum of 512 characters. |
| HTTP_METHOD (HTTP request method) | Parameters are not supported. | eq (equal to) neq (not equal to) | Enter the method name. The uppercase is recommended. |
| QUERY_STRING (request string) | Parameters are not supported. | Same logical symbol as the matching field Request Path | Enter the content with a maximum of 512 characters. |
| GET (GET parameter value) | Parameter entry is supported. | contains (contain) ncontains (do not contain) len_eq (length equals to) len_gt (length is greater than) len_lt (length is less than) strprefix (prefix matching) strsuffix (suffix matching) | Enter the content with a maximum of 512 characters. |
| GET_PARAMS_NAMES (GET parameter name) | Parameters are not supported. | exist (Parameter exists.) nexist (Parameter does not exist.) len_eq (length equals to) len_gt (length is greater than) len_lt (length is less than) strprefix (prefix matching) strsuffix (suffix matching) | Enter the content with a maximum of 512 characters. |
| POST (POST parameter value) | Parameter entry is supported. | Same logical symbol as the matching field GET Parameter Value | Enter the content with a maximum of 512 characters. |
| GET_POST_NAMES (POST parameter name) | Parameters are not supported. | Same logical symbol as the matching field GET Parameter Name | Enter the content with a maximum of 512 characters. |
| POST_BODY (complete body) | Parameters are not supported. | Same logical symbol as the matching field Request Path | Enter the body content with a maximum of 512 characters. |
| COOKIE (cookie) | Parameters are not supported. | empty (Content is empty.) null (do not exist) rematch (regular expression matching) | Unsupported currently |
| GET_COOKIES_NAMES (cookie parameter name) | Parameters are not supported. | Same logical symbol as the matching field GET Parameter Name | Enter the content with a maximum of 512 characters. |
| ARGS_COOKIE (cookie parameter value) | Parameter entry is supported. | Same logical symbol as the matching field GET Parameter Value | Enter the contentwith a maximum of 512 characters. |
| GET_HEADERS_NAMES (header parameter name) | Parameters are not supported. | exist (Parameter exists.) nexist (Parameter does not exist.) len_eq (length equals to) len_gt (length is greater than) len_lt (length is less than) strprefix (prefix matching) strsuffix (suffix matching) rematch (regular expression matching) | Enter the content with a maximum of 512 characters. The lowercase is recommended. |
| ARGS_HEADER (header parameter value) | Parameter entry is supported. | contains (contain) ncontains (do not contain) len_eq (length equals to) len_gt (length is greater than) len_lt (length is less than) strprefix (prefix matching) strsuffix (suffix matching) rematch (regular expression matching) | Enter the content with a maximum of 512 characters. |
| CAPTCHA_RISK (CAPTCHA risk) | Parameters are not supported. | eq (equal to) neq (not equal to) belong (belongs to) not_belong (does not belong to) null (does not exist) exist (exists) | Enter risk level value, supporting numerical range 0-255 |
| CAPTCHA_DEVICE_RISK (CAPTCHA device risk) | Parameters are not supported. | eq (equal to) neq (not equal to) belong (belongs to) not_belong (does not belong to) null (does not exist) exist (exists) | Enter device risk code, supporting values: 101, 201, 301, 401, 501, 601, 701 |
| CAPTCHAR_SCORE (CAPTCHA risk assessment score) | Parameters are not supported. | numeq (numerically equal to) numgt (numerically greater than) numlt (numerically less than) numle (numerically less than or equal to) numge (numerically greater than or equal to) null (does not exist) exist (exists) | Enter assessment score, supporting numerical range 0-100 |