Class FirewallRule
Define Firewall rules using filter expressions for more control over how traffic is matched to the rule. A filter expression permits selecting traffic by multiple criteria allowing greater freedom in rule creation.
Filter expressions needs to be created first before using Firewall Rule. See Filter.
Example Usage
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
class MyStack : Stack
{
public MyStack()
{
var wordpressFilter = new Cloudflare.Filter("wordpressFilter", new Cloudflare.FilterArgs
{
ZoneId = "d41d8cd98f00b204e9800998ecf8427e",
Description = "Wordpress break-in attempts that are outside of the office",
Expression = "(http.request.uri.path ~ \".*wp-login.php\" or http.request.uri.path ~ \".*xmlrpc.php\") and ip.src ne 192.0.2.1",
});
var wordpressFirewallRule = new Cloudflare.FirewallRule("wordpressFirewallRule", new Cloudflare.FirewallRuleArgs
{
ZoneId = "d41d8cd98f00b204e9800998ecf8427e",
Description = "Block wordpress break-in attempts",
FilterId = wordpressFilter.Id,
Action = "block",
});
}
}
Inherited Members
Namespace: Pulumi.Cloudflare
Assembly: Pulumi.Cloudflare.dll
Syntax
public class FirewallRule : CustomResource
Constructors
View SourceFirewallRule(String, FirewallRuleArgs, CustomResourceOptions)
Create a FirewallRule resource with the given unique name, arguments, and options.
Declaration
public FirewallRule(string name, FirewallRuleArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| FirewallRuleArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceAction
The action to apply to a matched request. Allowed values: "block", "challenge", "allow", "js_challenge", "bypass". Enterprise plan also allows "log".
Declaration
public Output<string> Action { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Description
A description of the rule to help identify it.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
FilterId
Declaration
public Output<string> FilterId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Paused
Whether this filter based firewall rule is currently paused. Boolean value.
Declaration
public Output<bool?> Paused { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Priority
The priority of the rule to allow control of processing order. A lower number indicates high priority. If not provided, any rules with a priority will be sequenced before those without.
Declaration
public Output<int?> Priority { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Products
List of products to bypass for a request when the bypass action is used. Allowed values: "zoneLockdown", "uaBlock", "bic", "hot", "securityLevel", "rateLimit", "waf".
Declaration
public Output<ImmutableArray<string>> Products { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
ZoneId
The DNS zone to which the Filter should be added.
Declaration
public Output<string> ZoneId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, FirewallRuleState, CustomResourceOptions)
Get an existing FirewallRule resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static FirewallRule Get(string name, Input<string> id, FirewallRuleState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| FirewallRuleState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| FirewallRule |