@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
264 lines (263 loc) • 12.1 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs } from "../types";
/**
* Manages a WAF policy resource within HuaweiCloud.
*
* > **NOTE:** All WAF resources depend on WAF instances, and the WAF instances need to be purchased before they can be
* used. The policy resource can be used in Cloud Mode and Dedicated Mode.
*
* ## Import
*
* There are two ways to import WAF policy state. * Using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Waf/policy:Policy test <id>
* ```
*
* * Using `id` and `enterprise_project_id`, separated by a slash, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Waf/policy:Policy test <id>/<enterprise_project_id>
* ```
*/
export declare class Policy extends pulumi.CustomResource {
/**
* Get an existing Policy resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: PolicyState, opts?: pulumi.CustomResourceOptions): Policy;
/**
* Returns true if the given object is an instance of Policy. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Policy;
/**
* The protection switches. The options object structure is documented below.
*/
readonly bindHosts: pulumi.Output<outputs.Waf.PolicyBindHost[]>;
/**
* Specifies the deep inspection in basic web protection. Defaults to **false**.
*/
readonly deepInspection: pulumi.Output<boolean>;
/**
* Specifies the enterprise project ID of WAF policy.
* For enterprise users, if omitted, default enterprise project will be used.
* Changing this parameter will create a new resource.
*/
readonly enterpriseProjectId: pulumi.Output<string | undefined>;
/**
* Specifies the detection mode in precise protection. Defaults to **false**.
* + **false**: Instant detection. When a request hits the blocking conditions in precise protection, WAF terminates
* checks and blocks the request immediately.
* + **true**: Full detection. If a request hits the blocking conditions in precise protection, WAF does not block the
* request immediately. Instead, it blocks the requests until other checks are finished.
*/
readonly fullDetection: pulumi.Output<boolean | undefined>;
/**
* Specifies the header inspection in basic web protection. Defaults to **false**.
*/
readonly headerInspection: pulumi.Output<boolean>;
/**
* Specifies the protection level. Defaults to `2`. Valid values are:
* + `1`: Low. At this protection level, WAF blocks only requests with obvious attack features. If a large number of
* false alarms have been reported, this value is recommended.
* + `2`: Medium. This protection level meets web protection requirements in most scenarios.
* + `3`: High. At this protection level, WAF provides the finest granular protection and can intercept attacks with
* complex bypass features, such as Jolokia cyberattacks, common gateway interface (CGI) vulnerability detection,
* and Druid SQL injection attacks.
*/
readonly level: pulumi.Output<number>;
/**
* Specifies the policy name. The maximum length is `256` characters. Only digits, letters,
* underscores (_), and hyphens (-) are allowed.
*/
readonly name: pulumi.Output<string>;
/**
* Specifies the switch options of the protection item in the policy.
* The options structure is documented below.
*/
readonly options: pulumi.Output<outputs.Waf.PolicyOption[]>;
/**
* Specifies the protective action after a rule is matched. Defaults to **log**.
* Valid values are:
* + **block**: WAF blocks and logs detected attacks.
* + **log**: WAF logs detected attacks only.
*/
readonly protectionMode: pulumi.Output<string>;
/**
* Specifies the region in which to create the WAF policy resource. If omitted, the
* provider-level region will be used. Changing this setting will push a new certificate.
*/
readonly region: pulumi.Output<string>;
/**
* Specifies the protective actions for each rule in anti-crawler protection.
* Defaults to **log**. Valid values are:
* + **block**: WAF blocks discovered attacks.
* + **log**: WAF only logs discovered attacks.
*/
readonly robotAction: pulumi.Output<string>;
/**
* Specifies the shiro decryption check in basic web protection.
* Defaults to **false**.
*/
readonly shiroDecryptionCheck: pulumi.Output<boolean>;
/**
* Create a Policy resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args?: PolicyArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Policy resources.
*/
export interface PolicyState {
/**
* The protection switches. The options object structure is documented below.
*/
bindHosts?: pulumi.Input<pulumi.Input<inputs.Waf.PolicyBindHost>[]>;
/**
* Specifies the deep inspection in basic web protection. Defaults to **false**.
*/
deepInspection?: pulumi.Input<boolean>;
/**
* Specifies the enterprise project ID of WAF policy.
* For enterprise users, if omitted, default enterprise project will be used.
* Changing this parameter will create a new resource.
*/
enterpriseProjectId?: pulumi.Input<string>;
/**
* Specifies the detection mode in precise protection. Defaults to **false**.
* + **false**: Instant detection. When a request hits the blocking conditions in precise protection, WAF terminates
* checks and blocks the request immediately.
* + **true**: Full detection. If a request hits the blocking conditions in precise protection, WAF does not block the
* request immediately. Instead, it blocks the requests until other checks are finished.
*/
fullDetection?: pulumi.Input<boolean>;
/**
* Specifies the header inspection in basic web protection. Defaults to **false**.
*/
headerInspection?: pulumi.Input<boolean>;
/**
* Specifies the protection level. Defaults to `2`. Valid values are:
* + `1`: Low. At this protection level, WAF blocks only requests with obvious attack features. If a large number of
* false alarms have been reported, this value is recommended.
* + `2`: Medium. This protection level meets web protection requirements in most scenarios.
* + `3`: High. At this protection level, WAF provides the finest granular protection and can intercept attacks with
* complex bypass features, such as Jolokia cyberattacks, common gateway interface (CGI) vulnerability detection,
* and Druid SQL injection attacks.
*/
level?: pulumi.Input<number>;
/**
* Specifies the policy name. The maximum length is `256` characters. Only digits, letters,
* underscores (_), and hyphens (-) are allowed.
*/
name?: pulumi.Input<string>;
/**
* Specifies the switch options of the protection item in the policy.
* The options structure is documented below.
*/
options?: pulumi.Input<pulumi.Input<inputs.Waf.PolicyOption>[]>;
/**
* Specifies the protective action after a rule is matched. Defaults to **log**.
* Valid values are:
* + **block**: WAF blocks and logs detected attacks.
* + **log**: WAF logs detected attacks only.
*/
protectionMode?: pulumi.Input<string>;
/**
* Specifies the region in which to create the WAF policy resource. If omitted, the
* provider-level region will be used. Changing this setting will push a new certificate.
*/
region?: pulumi.Input<string>;
/**
* Specifies the protective actions for each rule in anti-crawler protection.
* Defaults to **log**. Valid values are:
* + **block**: WAF blocks discovered attacks.
* + **log**: WAF only logs discovered attacks.
*/
robotAction?: pulumi.Input<string>;
/**
* Specifies the shiro decryption check in basic web protection.
* Defaults to **false**.
*/
shiroDecryptionCheck?: pulumi.Input<boolean>;
}
/**
* The set of arguments for constructing a Policy resource.
*/
export interface PolicyArgs {
/**
* Specifies the deep inspection in basic web protection. Defaults to **false**.
*/
deepInspection?: pulumi.Input<boolean>;
/**
* Specifies the enterprise project ID of WAF policy.
* For enterprise users, if omitted, default enterprise project will be used.
* Changing this parameter will create a new resource.
*/
enterpriseProjectId?: pulumi.Input<string>;
/**
* Specifies the detection mode in precise protection. Defaults to **false**.
* + **false**: Instant detection. When a request hits the blocking conditions in precise protection, WAF terminates
* checks and blocks the request immediately.
* + **true**: Full detection. If a request hits the blocking conditions in precise protection, WAF does not block the
* request immediately. Instead, it blocks the requests until other checks are finished.
*/
fullDetection?: pulumi.Input<boolean>;
/**
* Specifies the header inspection in basic web protection. Defaults to **false**.
*/
headerInspection?: pulumi.Input<boolean>;
/**
* Specifies the protection level. Defaults to `2`. Valid values are:
* + `1`: Low. At this protection level, WAF blocks only requests with obvious attack features. If a large number of
* false alarms have been reported, this value is recommended.
* + `2`: Medium. This protection level meets web protection requirements in most scenarios.
* + `3`: High. At this protection level, WAF provides the finest granular protection and can intercept attacks with
* complex bypass features, such as Jolokia cyberattacks, common gateway interface (CGI) vulnerability detection,
* and Druid SQL injection attacks.
*/
level?: pulumi.Input<number>;
/**
* Specifies the policy name. The maximum length is `256` characters. Only digits, letters,
* underscores (_), and hyphens (-) are allowed.
*/
name?: pulumi.Input<string>;
/**
* Specifies the switch options of the protection item in the policy.
* The options structure is documented below.
*/
options?: pulumi.Input<pulumi.Input<inputs.Waf.PolicyOption>[]>;
/**
* Specifies the protective action after a rule is matched. Defaults to **log**.
* Valid values are:
* + **block**: WAF blocks and logs detected attacks.
* + **log**: WAF logs detected attacks only.
*/
protectionMode?: pulumi.Input<string>;
/**
* Specifies the region in which to create the WAF policy resource. If omitted, the
* provider-level region will be used. Changing this setting will push a new certificate.
*/
region?: pulumi.Input<string>;
/**
* Specifies the protective actions for each rule in anti-crawler protection.
* Defaults to **log**. Valid values are:
* + **block**: WAF blocks discovered attacks.
* + **log**: WAF only logs discovered attacks.
*/
robotAction?: pulumi.Input<string>;
/**
* Specifies the shiro decryption check in basic web protection.
* Defaults to **false**.
*/
shiroDecryptionCheck?: pulumi.Input<boolean>;
}